Creates a criterion that measures the mean absolute error (MAE) between each element in the input x and target y.
nn_l1_loss(reduction ="mean")
Arguments
reduction: (string, optional): Specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed.
Details
The unreduced (i.e. with reduction set to 'none') loss can be described as:
ℓ(x,y)=L={l1,…,lN}⊤,\quadln=∣xn−yn∣,
where N is the batch size. If reduction is not 'none'