Lessons › Chapter 8: Neural networks
Dropout
With dropout, every training step switches off a random handful of neurons (greyed out). The rest must cope without them.
Watch it move. This lesson is interactive on Gradient Lab: every step is an animated scene you can replay.
Start the interactive lessonStep by step
Memorizing cheques
The network aces the training cheques but stumbles on new ones.
A network that leans on favorites
A big network can overfit by letting a few neurons work as a tight team that memorizes the training data. If one of them is wrong, they’re all wrong together.
Switch some neurons off
With dropout, every training step switches off a random handful of neurons (greyed out). The rest must cope without them.
A different handful each time
Next step, a different random handful is off. No neuron can count on any particular partner always being there, so each learns something useful on its own.
Everyone plays at test time
When making real predictions, every neuron is switched back on. The result behaves like an average of many slightly different networks: more robust and less overfit.
In real life: practicing with players missing
A coach who makes random players sit out during practice forces everyone else to cover more positions. On match day, with the full team back, nobody depends on a single star. Dropout trains networks the same way.
Quick check: When are neurons switched off by dropout?
- Only during training (correct)
- Only when making predictions
- All the time
Dropout is a training trick; at prediction time the full network is used.
Pseudocode
during training, for each step:
switch off a random 20% of the neurons
train with the rest
when predicting:
use every neuron (scaled to match)
# no neuron can rely on one particular partner
Key terms
- dropout
- Randomly switching off some neurons during training so the network can’t over-rely on any one.