A loss (or cost) function is a function used to represent the difference (error) between a predicted outcome and an optimised target value, .
The value of the function follows the properties:
- Minimised when the error is small
- Increasing as the error increases
- Continuous and Differentiable
- Convex
Loss (Absolute Error)
The loss is the absolute value of the error. It is not differentiable at .
This is:
This is generally equivalent to the Manhattan Distance in all dimensions. The average value of the absolute error over a dataset is the Mean Absolute Error.
Loss (Squared Error)
This is the square of the error. Namely:
As this uses the square, it is sensitive to outliers. This is generally equivalent to the Euclidian Distance in all dimensions. The average of the squared error over a dataset is the Mean Squared Error.
Log Loss (Cross-Entropy)
This is a measure of the loss between possible states.
Note, the partial derivative of this can be derived, with the chain rule on as: