Labs · Neural Networks
Overfitting & Regularization
A big enough network can memorise anything, including the noise. Here the data is split in two: the network trains only on the training points (filled) and is checked on unseen test points (hollow). As training goes on, training loss keeps falling, but test loss eventually turns back up. The decision boundary has started wrapping around individual noisy points.
L2 regularization (weight decay) shrinks every weight a little each step, preferring simpler, smoother functions. With the right amount, both losses stay low together.
Run with λ = 0 until the test loss (pink) rises, then press "Restart" with λ around 0.002.
Controls
- Label noise
- Points
- Neurons per layer
- Hidden layers
- L2 weight decay λ
- Learning rate
- Epochs per frame
Evolved from Neural Network Playground.