Dropout › The Dropout Mask

Michael BrenndoerferApril 27, 20252 min read
Language AI HandbookAll chapters
Part 10 of 67Neural Network Foundations
Chapter 72Dropout › The Dropout Mask
Reading section 4 of 19 · The Dropout Mask · 2 minSection 4 of 19 · 2 min

Book contents

Section 4 of 19 · 2 min read

Dropout › The Dropout MaskOne section · Sections in this chapter4 / 19 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

During a training forward pass, dropout applies a binary mask to the neurons in a layer. Each element of the mask is sampled independently:

mi∼Bernoulli(1−p)m_i \sim \text{Bernoulli}(1-p)

where:

  • mim_i: the mask value for neuron ii (either 0 or 1)
  • pp: the dropout probability (probability of dropping, i.e., setting to zero)
  • 1−p1 - p: the probability that neuron ii is kept active (the "keep probability" or "retention rate")

The masked output of the layer is then:

h~i=mi⋅hi\tilde{h}_i = m_i \cdot h_i

where:

  • h~i\tilde{h}_i: the output of neuron ii after applying dropout
  • hih_i: the pre-dropout activation of neuron ii

The mask is resampled independently for every training example in every mini-batch. This means two examples in the same batch see different network architectures. Over the course of training, this continuous resampling trains all 2n2^n subnetworks simultaneously.

An important subtlety is the timing of mask application relative to the activation function. Dropout is typically applied to the output of the activation function, not to the pre-activation values. If applied before the activation, the scaled values would pass through a nonlinearity and produce a different distribution than the intended behavior. Applying dropout to post-activation values zeroes the contribution of a neuron entirely, which cleanly corresponds to removing that neuron from the computation.

The independence of masks across neurons within a layer is also important. If you dropped neurons in correlated groups, some co-adapted patterns might survive even under heavy dropout (because the neurons they depend on tend to be dropped or kept together). Independent sampling ensures that any co-adapted pair is disrupted with probability p2+(1−p)2p^2 + (1-p)^2, where the first term is the probability both are dropped and the second is that both survive. For p=0.5p = 0.5, both survive with probability 0.25, meaning 75% of forward passes disrupt any given pair. This is the key pressure against co-adaptation.