Loss Functions

Before a network can improve, we need to tell it what counts as an error. A loss function assigns a numerical cost to a prediction, and that choice affects which mistakes the model tries hardest to reduce.

14 sections · 10 questions · 4 coding challenges

1 / 14

What Should Count as a Worse Answer?

BOTIE

A model needs a numerical way to compare mistakes. If one prediction is slightly wrong and another is badly wrong, how much more should the second count? The answer determines which compromises the training procedure will make.

Least squares established one influential answer by squaring discrepancies. But unusually large observations can then dominate the fit. Huber's 1964 work on robust estimation studied procedures that remain useful when the assumed distribution is slightly wrong, motivating a loss that is quadratic near the centre and grows more gently in the tails.

The choice of loss therefore expresses a judgement about the problem. Squared error strongly emphasises large numerical misses. Absolute error treats their growth differently. A probability loss judges the probability assigned to the observed outcome. Before differentiating a loss, we should understand what behaviour minimising it rewards and which kind of bad answer it considers expensive.

Sources for this history