theanets.losses.MeanAbsoluteError

class theanets.losses.MeanAbsoluteError(target, weight=1.0, weighted=False, output_name='out')

Mean-absolute-error (MAE) loss function.

Notes

The mean absolute error (MAE) loss computes the mean difference between the output of a computation graph \(x = (x_1, \dots, x_d)\) and its expected target value \(t = (t_1, \dots, t_d)\). Mathematically,

\[\begin{split}\begin{eqnarray*} \mathcal{L}(x, t) &=& \frac{1}{d} \|x - t\|_1 \\ &=& \frac{1}{d} \sum_{i=1}^d |x_i - t_i| \end{eqnarray*}\end{split}\]

Whereas some MAE computations return the sum over dimensions, the MAE here is computed as an average over the dimensionality of the data.

For cases where \(x\) and \(t\) are matrices, the MAE computes the average over corresponding rows in \(x\) and \(t\).

__init__(target, weight=1.0, weighted=False, output_name='out')

Methods

__init__(target[, weight, weighted, output_name])
log() Log some diagnostic info about this loss.

Attributes

variables A list of Theano variables used in this loss.