Loss function#
Creates a criterion that measures the mean absolute error (MAE) between each element in the input x and target y.
\[
\textbf{MAE}= \frac{\sum_{i=1}^n (\hat{y}-y_i)}{n}
\]
Creates a criterion that measures the mean squared error (squared L2 norm) between each element in the input xand target y.
\[
\textbf{MES}=\frac{\sum_i^n (\hat{y}-y_i)^2}{n}
\]
This criterion computes the cross entropy loss between input logits and target.
\[
H(p,q)=-\sum_{x\in\mathcal{X}}p(x)\log{q(x)}
\]