SmoothL1Loss
class torch.nn.SmoothL1Loss(size_average=None, reduce=None, reduction='mean', beta=1.0)
Creates a criterion that uses a squared term if the absolute
   element-wise error falls below beta and an L1 term otherwise. It is
   less sensitive to outliers than "torch.nn.MSELoss" and in some
   cases prevents exploding gradients (e.g. see the paper Fast R-CNN
   by Ross Girshick).
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 / beta, & \text{if } |x_n
  - y_n| < beta \\ |x_n - y_n| - 0.5 * beta, & \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:
 Smooth L1 loss can be seen as exactly "L1Loss", but with the |x -
