In dropout with keep probability , why are the kept activations divided by during training (inverted dropout), and what goes wrong at test time if you do not scale?
Deep learning, Training and regularisation
Level L2 Elementary. Length Short. Nature Th+Mat Both.
What's being asked
Whether you can show with an expectation that the scaling keeps the next layer's input the same between training and testing.
Key idea
Dropout multiplies each activation by a random mask , which is 1 with probability and 0 otherwise. With , the expected value is . So at test time you can use the full network with no mask and no rescaling.
Steps
- Write the training-time operation: , with each drawn independently. Here is element-wise multiplication.
- Compute the expectation: . Example: and give , with mean 2.
- At test time all units are kept. Without the scaling during training, test activations would on average be times what the next layer was trained on (25% too large for ). The original paper instead multiplied the weights by at test time. Inverted dropout moves that cost to training, so inference needs no change.
- Give the ensemble view. Each mask picks one of thinned sub-networks that share weights, where is the number of units. The scaled full network approximates averaging their predictions.
Common mistakes
- Mixing up keep and drop probability. PyTorch's nn.Dropout(p) uses as the drop probability, so it scales by .
- Leaving dropout on at evaluation (forgetting model.eval()).
- Claiming the network output is exactly the ensemble mean. The expectation matches only for the linear input to the next layer, not after a non-linearity.
How long your answer should be
3–5 sentences with one expectation.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: What is the receptive field of a unit after three stacked convolutions with stride 1, and how does their total parameter count compare with a single convolution (both with input and output channels, ignoring biases)?
Next in Deep learning: Why do convolutional neural networks suit image data better than fully connected MLPs, and what is the difference between translation equivariance and translation invariance?