Learn Before
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 ) with probability and dropped (value ) with probability . An efficient way to achieve this is to generate a tensor of samples from a uniform distribution and apply a threshold, keeping only those elements where the uniformly sampled value is strictly greater than the dropout probability .
0
1
Updated 2026-05-07
Tags
D2L
Dive into Deep Learning @ D2L