ML0007 Dropout

What is dropout in neural network training?

Answer

Dropout is a regularization technique used during neural network training to prevent overfitting. At each training step, a fraction of neurons (and their connections) are randomly “dropped out”, meaning their activations are set to zero. This forces the network to learn more robust features, because it cannot rely on any single neuron; instead it learns distributed representations, effectively training an ensemble of many smaller sub-networks that share weights. At inference time every neuron is active, so the model uses all learned features without randomness. To bridge the train/inference gap, inverted dropout scales the active neurons by 1/(1-p) during training so no adjustment is needed at inference; the alternative standard dropout scales the weights by (1-p) at inference instead.

(1) Mechanism: Randomly zero a fraction p of activations per training step; the dropped set changes every step.
(2) Why It Works: Prevents co-adaptation of neurons and approximates training an exponentially large ensemble of sub-networks.
(3) Training vs Inference: Inference uses the full network; activations are rescaled (during training with inverted dropout, or at inference with standard dropout) so expected magnitudes match.

Full network versus the same network with randomly dropped neurons

Figure 1: Left: the full network. Right: one training step with dropout: grayed, crossed-out neurons are zeroed, forcing the remaining sub-network to carry the prediction.

Mathematical Formulation:
\tilde{h}_i = \frac{m_i}{1-p} \cdot h_i
m_i \sim \mathrm{Bernoulli}(1-p)

Where:

  • \tilde{h}_i is the scaled activation of neuron i actually passed to the next layer during training.
  • h_i is the original activation of neuron i, and i indexes the neurons in a layer.
  • m_i is the binary dropout mask: 1 keeps the neuron, 0 drops it.
  • p is the drop probability; 1-p is the keep probability, and dividing by it is the inverted-dropout scaling that keeps \mathbb{E}[\tilde{h}_i] = h_i.
Training and test error versus dropout rate with a sweet spot region

Figure 2: Choosing the drop probability p: too little dropout leaves overfitting, too much underfits; the test-error minimum is the sweet spot (typically p around 0.2–0.5).


Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *