Overfitting and Regularization
Learning the exam, or learning the subject?
A network overfits when it memorises the training examples instead of learning the pattern that will work on new ones. The loss on the data you trained on keeps falling, while the loss on data the net has never seen goes up.
An everyday picture is a student who memorises last year’s exam word for word, and then sits a new paper. The practice score is perfect; the real score is not. A looser jacket — a simpler explanation that still fits the main facts — usually travels better.
The usual guard is a split. You hold back a validation set (and, later, a test set) that the training loop is not allowed to learn from. You watch two numbers: training loss and validation loss. When the first is still falling and the second has started to rise, it is time to stop or to change something. Early stopping is exactly that: keep the weights from the moment validation was at its best.
Dropout, in training, randomly silences a fraction of the units on each step, as if you covered some of the student’s notes so they cannot rely on one lucky phrase. At test time dropout is switched off. Other regularisers include a penalty on large weights, and simply less of a network: fewer layers, or fewer units, can be enough.
None of these is magic. They are ways of asking the model to keep a little humility: fit the pattern, not the accidents in the training sample. The split is the habit to learn first.
See also
- Training a Deep Net
- ANN: Gradient
- Why Depth
- ANN: Evolution — dropout in the 2012 story