HuberLoss
class torch.nn.HuberLoss(reduction='mean', delta=1.0)
Creates a criterion that uses a squared term if the absolute
   element-wise error falls below delta and a delta-scaled L1 term
   otherwise. This loss combines advantages of both "L1Loss" and
   "MSELoss"; the delta-scaled L1 region makes the loss less sensitive
   to outliers than "MSELoss", while the L2 region provides smoothness
   over "L1Loss" near 0. See Huber loss for more information.
For a batch of size N, the unreduced loss can be described as:
  \ell(x, y) = L = \{l_1, ..., l_N\}^T

with
  l_n = \begin{cases} 0.5 (x_n - y_n)^2, & \text{if } |x_n - y_n|
  < delta \\ delta * (|x_n - y_n| - 0.5 * delta), &
  \text{otherwise } \end{cases}

If reduction is not none, then:
  \ell(x, y) = \begin{cases}     \operatorname{mean}(L), &
  \text{if reduction} = \text{`mean';}\\
  \operatorname{sum}(L),  &  \text{if reduction} = \text{`sum'.}
  \end{cases}

Note: