L1Loss¶

class L1Loss[source]

Bases: Loss

This class computes the L1 loss (i.e. absolute error) for each sample as:

$\text{L1Loss}(predict, target) = \sum_{i=0}^{N_{\text{elements}}} \left| predict_i - target_i \right|.$

Methods

 evaluate(predict, target) An abstract method for evaluating the loss function. gradient(predict, target) An abstract method for computing the gradient.