Concept

Implementing Dropout via Uniform Sampling

To implement dropout for a layer computationally, we must draw samples from a Bernoulli distribution for each dimension, where a node is kept (value 11) with probability 1p1-p and dropped (value 00) with probability pp. An efficient way to achieve this is to generate a tensor of samples from a uniform distribution U[0,1]U[0, 1] and apply a threshold, keeping only those elements where the uniformly sampled value is strictly greater than the dropout probability pp.

0

1

Updated 2026-05-07

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L