From 3305c8766e2df7e614bfb1d45ea5a7dddfda3ea9 Mon Sep 17 00:00:00 2001 From: yangyaming Date: Thu, 23 Nov 2017 13:12:07 +0800 Subject: [PATCH] Add more comment. --- paddle/operators/huber_loss_op.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/paddle/operators/huber_loss_op.cc b/paddle/operators/huber_loss_op.cc index 707ee60b6..938803d5b 100644 --- a/paddle/operators/huber_loss_op.cc +++ b/paddle/operators/huber_loss_op.cc @@ -71,15 +71,18 @@ X to Y. Different from MSE loss, Huber loss is more robust for outliers. The shape of X and Y are [batch_size, 1]. The equation is: $$ -Out_{\delta}(i, x, y) = +Out_{\delta}(X, Y)_i = \begin{cases} -0.5 * (Input(i, y) - Input(i, x))^2, -\quad |Input(i, y) - Input(i, x)| \leq \delta \\ -\delta * (|Input(i, y) - Input(i, x)| - 0.5 * \delta), +0.5 * (Y_i - X_i)^2, +\quad |Y_i - X_i| \leq \delta \\ +\delta * (|Y_i - X_i| - 0.5 * \delta), \quad otherwise \end{cases} $$ +In the above equation, $Out_\delta(X, Y)_i$, $X_i$ and $Y_i$ represent the ith +element of Out, X and Y. + )DOC"); } }; -- GitLab