Dropout

Regularization · node type · Dropout

During training, zeroes a random fraction of values so the network cannot rely on any single unit.

Also called Spatial dropout

During training each unit is zeroed with probability p and the survivors are scaled by 1 / (1 − p), so the expected sum stays the same. At inference dropout does nothing.

sum in = 7.80 · sum out = 6.57 · 4 of 12 dropped

Figure 1. Try it: every number is computed in your browser from the formula below.

What it does

While training, dropout sets each value to zero with probability p and scales the survivors by 1/(1 − p), so the expected sum stays the same. Each update therefore trains a slightly different thinned network, which discourages units from depending on one another and reduces overfitting. At inference dropout does nothing: the full network is used and the layer passes values through unchanged. Exported graphs often still contain the node, or have it removed entirely.

Formula

training: mi ~ Bernoulli(1 − p), yi = mi · xi / (1 − p)inference: y = x

Shapes and parameters

Shapes
Any shape in, the same shape out (plus an optional mask).
Parameters
None. The ratio p is a training setting.
Used for
Large dense layers of classic CNNs (the voice command model drops 25% and 50%), text classifiers, and transformers during pretraining.

Figure 2. Dropout inside Classify the tone of a film review, a real model in WeightSpace. The outlined node is Dropout; select any node for its shapes and parameters.

Figure 3. The typed ports of Dropout, in the same format as every model drawing. Letters such as N or C stand for any size.

In WeightSpace

Read-only in WeightSpace today, and inactive while models run: every edit you compare uses the full network.