liveBook · Manning

Dropout

As explained in Deep Learning with PyTorch, Second Edition

A regularization technique that randomly omits activations during training and is turned off or altered for inference.

Dropout is a regularization technique for reducing overfitting. During each training iteration, it randomly sets a fraction of neuron outputs to zero, discouraging the network from relying too heavily on any single input or feature. section 8.5.2

Dropout works by:

  • Generating slightly different neuron topologies from one iteration to the next, making memorization harder. section 8.5.2
  • Perturbing features throughout the network in a way related to data augmentation. section 8.5.2
  • Using nn.Dropout for general layers, or nn.Dropout2d and nn.Dropout3d to zero entire input channels in convolutional networks. section 8.5.2
  • Keeping dropout active while training and changing its behavior for evaluation. section 8.5.2

Dropout in a convolutional model

A PyTorch classifier can place nn.Dropout2d(p=0.4) after each convolutional activation and before the next layer. The example applies this pattern twice, then flattens the result for fully connected layers.

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Defines random activation omission, explains its anti-memorization rationale, and demonstrates PyTorch placement without developing mathematical internals.
Examples
Demonstrates a two-convolution NetDropout model using Dropout2d with probability 0.4 after activation and pooling.
What it assumes
Assumes basic neural-network layers, activations, convolution, and the distinction between training and evaluation.
What you can do after
Apply it via PyTorch by inserting the appropriate dropout module and switching the model between training and evaluation modes.
How it connects
Connects dropout with regularization, overfitting, data augmentation, convolutional layers, activation functions, and training and evaluation modes.

Also explained in

Compare how 12 books explain dropout →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.