How would you choose the dropout rate, and which layers would you apply dropout to?
Last updated
Treat the drop rate as a hyperparameter tuned on validation data. Start from defaults: about 0.5 for hidden fully connected layers, 0.1–0.2 for inputs, about 0.1 in Transformers, and low or spatial dropout (
Dropout2d) for conv layers.Raise it if the train–validation gap is large, lower it if the model underfits. Bigger models and smaller datasets need more dropout.
Avoid dropout right before the output layer and before BatchNorm (variance shift). In RNNs use the same mask at every timestep. Note that
nn.Dropout(p)takes the drop probability, unlike the original paper's retain probability.