Training Foundations

Dropout Variants

Why deliberately breaking your own network during training — silencing random neurons every step — is one of the most effective ways to make it generalize.

Prerequisites: A neuron is a weighted sum plus activation + What overfitting means. That’s it.
10
Chapters
9+
Simulations
0
Assumed Knowledge

Chapter 0: The Conspiracy of Neurons

A big neural network has a sneaky way to cheat. Instead of each neuron learning a genuinely useful, standalone feature, groups of neurons learn to lean on each other — forming brittle little conspiracies. Neuron A only works if neuron B is also firing in just the right way; B only works if C does; and so on. The group produces the right answer on the training set through an elaborate, fragile handshake. This is called co-adaptation, and it is a hallmark of overfitting.

The problem is that these handshakes are tuned to the training data specifically. Show the network a slightly different input and the delicate arrangement falls apart — the conspiracy was never about the real concept, just about reproducing the training answers. The network memorized rather than understood.

In 2012, Geoffrey Hinton's group proposed a wonderfully blunt fix: dropout. On every training step, randomly switch off a fraction of the neurons — set their outputs to zero — and train on what remains. A neuron can never rely on any particular partner being present, because that partner might vanish next step. The conspiracies become impossible to maintain. Each neuron is forced to learn something useful on its own.

The one-sentence version. Dropout randomly silences neurons during training so that no neuron can depend on any other specific neuron. Forced to be useful in the company of random teammates, each neuron learns a robust, standalone feature — and the network stops memorizing and starts generalizing.

An analogy: the unreliable team

Imagine a project team where, on any given day, half the members randomly call in sick. If you're a team member, you can't build a workflow that depends on one specific colleague always being there — they might be out tomorrow. So you learn to do your part in a way that works regardless of who shows up. The team becomes robust: any subset can carry the project. Dropout imposes exactly this discipline on neurons.

See it: co-adaptation breaking

The network below has neurons connected into fragile chains (co-adapted, in red). Toggle dropout on and press step: random neurons get silenced each step, the brittle chains can't survive, and connections redistribute into a robust, redundant web (green) where many neurons can do each job. Watch the structure change from fragile to resilient.

Co-adaptation → Robustness

Toggle dropout, then step. Without it, a few brittle chains carry everything (red). With it, random silencing forces redundant, robust connections (green).

Common misconception. “Dropping neurons throws away capacity, so it must hurt.” During training it does make each step noisier and a bit slower to converge. But the payoff is a network whose neurons are individually useful and collectively redundant — which generalizes far better to new data. You trade a little training efficiency for a lot of robustness. And at test time, as we'll see, all the neurons come back.
What problem is dropout primarily designed to prevent?

Chapter 1: The Dropout Mask — Mechanically Simple

For all its power, dropout is mechanically trivial. At each training step, for each neuron, flip a biased coin. With probability p (the drop rate), set that neuron's output to zero. Otherwise, keep it. That's the whole operation: multiply the layer's activations by a random mask of zeros and ones.

Formally, you sample a mask — a vector the same length as the activations, where each entry is 0 (dropped) with probability p and 1 (kept) with probability one-minus-p. You multiply the activations elementwise by this mask. Dropped neurons contribute nothing to the next layer this step; kept neurons pass through unchanged. Next step, a fresh mask — a different random subset vanishes.

Drop rate vs. keep rate. Two names for the same coin. The drop rate p is the probability a neuron is silenced; the keep rate is one-minus-p. A drop rate of 0.5 (the classic value for fully-connected layers) means each neuron has a 50/50 chance of surviving each step. Lower rates like 0.1 are common for inputs or convolutional layers, where dropping too much destroys information.

Worked example: applying a mask by hand

Take a layer with six neurons producing these activations: [2.0, −1.0, 3.0, 0.5, −2.0, 1.0]. We use a drop rate of p = 0.5, and suppose the coin flips give this mask (1 = keep, 0 = drop):

neuronactivationmaskoutput (activation × mask)
12.012.0
2−1.000 (dropped)
33.013.0
40.500 (dropped)
5−2.01−2.0
61.000 (dropped)

The output passed to the next layer is [2.0, 0, 3.0, 0, −2.0, 0]. Three of six neurons were silenced. Notice something important: the surviving activations sum to 2.0 + 3.0 − 2.0 = 3.0, whereas the original sum was 2.0 − 1.0 + 3.0 + 0.5 − 2.0 + 1.0 = 3.5. Dropping neurons changed the total signal reaching the next layer — it shrank, roughly in proportion to how many we dropped. Hold onto that observation; it's the entire subject of the next chapter.

From scratch: a dropout layer

python
import numpy as np

def dropout(x, p=0.5, training=True):
    if not training or p == 0:
        return x                       # at test time, do nothing (for now)
    # sample a 0/1 mask: 1 with prob (1-p), 0 with prob p
    mask = (np.random.rand(*x.shape) > p).astype(x.dtype)
    return x * mask                  # elementwise — drop the zeros

That naive version exposes the problem we just spotted: it does nothing at test time, yet at training time it shrinks the activations. The network is fed weaker signals during training than during testing — a mismatch that will confuse it. Fixing that mismatch is the elegant trick of inverted dropout.

See it: sampling masks

Press “new mask” to resample. Watch which neurons survive each step (they light up) and which are zeroed (they go dark). Drag the drop rate and see how many vanish. Notice the surviving total signal printed below — it drops as you raise the drop rate.

Sampling Dropout Masks

Each cell is a neuron. Bright = kept, dark = dropped this step. Resample the mask and adjust the drop rate. Watch the surviving signal shrink as p grows.

Drop rate p 0.50

Common misconception. “The same neurons get dropped each time.” No — a fresh mask is sampled every forward pass. Over many steps, every neuron is dropped sometimes and kept sometimes, in countless different combinations. That constant reshuffling is what prevents any fixed conspiracy from forming.
A dropout layer with p = 0.5 is applied to a 6-neuron activation. On average, how many neurons pass through, and what happens to the total signal?

Chapter 2: The Scaling Problem — and Inverted Dropout

We spotted it in Chapter 1: dropping neurons shrinks the total signal reaching the next layer. With a drop rate of 0.5, roughly half the neurons vanish, so the next layer receives, on average, about half the input it normally would. This creates a serious mismatch. During training the network learns to work with weakened signals; at test time, when all neurons are present, the signals suddenly double. The network is shocked by inputs twice as strong as anything it trained on, and its outputs go haywire.

We must reconcile two worlds: training (some neurons dropped, weaker signal) and testing (all neurons present, full signal). The expected activation — the average signal a neuron sends — has to match between them, or the network breaks. There are two ways to fix it.

Fix one: scale at test time (the original)

Hinton's original dropout left training alone and fixed it at test time: when all neurons are present, multiply every activation by the keep probability (one-minus-p). With keep probability 0.5, you halve the test-time activations, so they match the weakened training-time signals. It works — but it means test time behaves differently from a normal network, which is awkward to implement and easy to forget.

Fix two: inverted dropout (what everyone uses now)

The modern trick flips the fix to training time. After masking, divide the surviving activations by the keep probability. With keep probability 0.5, you divide by 0.5 — that is, you double the survivors. Now the expected signal during training already equals the full signal, so test time needs no change at all: just run the network normally with every neuron present. This is inverted dropout, and it's the default in every modern framework because it keeps inference dead simple.

Why “inverted.” The scaling correction is inverted from test time to training time. Instead of scaling down at test (multiply by keep), we scale up at train (divide by keep). The math works out identically — the expected activation matches in both cases — but inverted dropout puts all the bookkeeping in the training code and leaves inference untouched. Test-time code doesn't even need to know dropout exists.

Worked example: making the expectation match

Suppose a neuron normally outputs 4.0, and we use drop rate p = 0.5 (keep probability 0.5). What is the neuron's expected contribution under each scheme?

The division by the keep probability exactly compensates for the neurons that went missing, restoring the expected signal to its full-strength value. That one division is the difference between a model that works at inference and one that doesn't.

From scratch: inverted dropout

python
def inverted_dropout(x, p=0.5, training=True):
    if not training or p == 0:
        return x                          # test time: untouched, all neurons present
    keep = 1.0 - p
    mask = (np.random.rand(*x.shape) < keep)
    return x * mask / keep             # ← scale UP survivors so E[output] = x

Compare to the naive version from Chapter 1: the only change is the / keep. That single division moves all the correction into training, so the test-time branch is a plain pass-through. Trace the expectation: a survivor outputs x/keep with probability keep, so its expected output is keep × x/keep = x — exactly the full-strength value. The mismatch is gone.

See it: matching the expectation

The widget compares expected activation at train vs test under three schemes. Watch the naive scheme leave a gap (train signal too weak), the test-time-scaling scheme close it by weakening test, and inverted dropout close it by boosting training — leaving test at full strength. Adjust the drop rate and see the correction track it.

Train vs Test: Closing the Expectation Gap

Bars = expected activation at train (teal) and test (orange) for each scheme. They must match. Only inverted dropout matches them and leaves test at full strength.

Drop rate p 0.50

Common misconception. “Dropout is just zeroing neurons — the scaling is a minor detail.” The scaling is essential. Forget it and your model trains fine but produces garbage at inference, because every activation is suddenly twice as large as it learned to expect. Many a mysterious “works in training, broken at test” bug is a missing dropout rescale.
With inverted dropout at keep probability 0.5, why are surviving activations multiplied by 2 during training?

Chapter 3: Dropout as a Giant Ensemble

Here is the second, deeper reason dropout works — and it reframes the whole technique. Every time you sample a dropout mask, you are training a different network: the subset of neurons that survived, wired together, is a distinct thinned subnetwork. Over training you sample countless masks, so you are really training an astronomical number of these subnetworks at once — and they all share the same underlying weights.

How many subnetworks? If a layer has n neurons, each can be present or absent, so there are two-to-the-n possible masks. With just 20 neurons that's over a million subnetworks; with hundreds, the number dwarfs the atoms in the universe. Dropout trains this unimaginably large family, each member glimpsed only briefly, all woven into one shared set of weights.

Why ensembles are good, and why this is one. Averaging many models that make different mistakes cancels out their individual errors — that's why ensembles reliably beat single models. Normally an ensemble costs you N times the compute (train and run N networks). Dropout gives you an ensemble of exponentially many networks for the price of one, because they all share weights. It is an ensemble in disguise — the cheapest one ever invented.

Test time: averaging the ensemble

If training secretly built an ensemble of subnetworks, test time should average their predictions. Running two-to-the-n networks is impossible, so dropout uses a brilliant approximation: just run the full network once, with all neurons present (and the inverted-dropout scaling from Chapter 2). It turns out that this single full-network pass closely approximates the geometric mean of all those subnetworks' predictions. One forward pass stands in for an exponential ensemble vote.

This is the same idea as the scaling fix from Chapter 2, seen from a new angle. The keep-probability scaling isn't just bookkeeping to match expectations — it's precisely what makes the single full network behave like the average of the ensemble it implicitly trained. The two views agree: scale correctly, and inference is both expectation-matched and ensemble-averaging.

Worked example: counting the ensemble

A modest hidden layer of 10 neurons with dropout. Number of distinct subnetworks = two-to-the-tenth = 1,024. Add a second 10-neuron layer and the combinations multiply: two-to-the-twentieth ≈ one million. Each training step trains exactly one of these (whichever mask was sampled), but because they share weights, improving one nudges them all. By the end you've trained an ensemble of a million networks — and you deploy a single one that averages them.

See it: subnetworks from masks

Each press of “sample” draws a new mask and shows the resulting thinned subnetwork — a different network each time. The counter shows how many distinct subnetworks are possible for the current neuron count. Drag the neuron count and watch the count of possible subnetworks explode exponentially.

Each Mask Is a Different Network

Sample masks to see different thinned subnetworks (dropped neurons grayed). The counter shows 2^n possible subnetworks — the size of the implicit ensemble.

Neurons per layer 6

Common misconception. “The subnetworks are independent models, so dropout is a true ensemble.” Not quite — they share weights heavily, so they're correlated, not independent. That's why the test-time full-network pass is only an approximation of the true ensemble average. But it's a remarkably good one, and it captures most of the regularization benefit at a fraction of the cost of a real ensemble.
Roughly how many distinct subnetworks does dropout implicitly train over a single layer of n neurons, and how does test time approximate averaging them?

Chapter 4: Spatial Dropout — When Standard Dropout Fails

Standard dropout was designed for fully-connected layers, where each neuron is its own independent feature. Apply it naively to a convolutional feature map and it barely works. Understanding why reveals a general principle: dropout only regularizes if dropping a unit actually removes information.

The spatial correlation problem

A convolutional feature map is a grid of activations, and crucially, neighboring cells are highly correlated — they look at overlapping patches of the image, so adjacent activations carry nearly the same information. Now apply standard dropout, which zeros individual cells at random. You zero one cell, but its neighbor — carrying almost identical information — survives. The network just reads the information from the neighbor. Dropping a single pixel removes almost nothing, because the same signal is redundantly present right next to it.

Dropout only works if dropping removes information. In a fully-connected layer, each neuron is roughly independent, so zeroing it genuinely removes its feature. In a conv map, information is smeared across neighboring cells, so zeroing one cell leaves the information intact in its neighbors. Standard dropout on conv maps is like trying to keep a secret by silencing one of two people who both know it.

The fix: drop entire channels

Spatial dropout (also called 2D dropout) drops whole feature-map channels at once, rather than scattered individual cells. A convolutional layer produces many channels — each one a complete feature detector (an “edge map,” a “texture map,” and so on) spread across the whole spatial grid. Spatial dropout zeros out an entire channel with probability p, removing that feature detector completely. Now there's no neighbor to leak through — the whole feature is gone, and the network must learn to cope without it. That genuinely regularizes.

Standard dropout
zeros random cells; neighbors leak the same info → weak effect on conv maps
vs
Spatial dropout
zeros whole channels; the feature is fully removed → real regularization

Concept + realization: the shape that's dropped

The difference is in which axis the mask operates on. A conv activation has shape channels-by-height-by-width. Standard dropout samples an independent mask over every single cell — the full channels-by-height-by-width grid. Spatial dropout samples one mask value per channel and broadcasts it across the entire height and width — so a dropped channel is zero everywhere, and a kept channel is untouched everywhere. Same drop-rate knob, completely different granularity.

python
# x shape: (batch, channels, height, width)
def spatial_dropout(x, p=0.1, training=True):
    if not training: return x
    keep = 1.0 - p
    # one mask value PER CHANNEL, broadcast over H and W
    mask = (torch.rand(x.shape[0], x.shape[1], 1, 1) < keep).float()
    return x * mask / keep        # whole channels live or die together

The key is the mask's shape: (batch, channels, 1, 1). Those two trailing 1s broadcast the same keep/drop decision across all spatial positions of a channel. Compare standard dropout, whose mask matches the full (batch, channels, height, width). One line of shape difference turns an ineffective regularizer into a strong one for conv nets.

See it: cells vs. channels

Four feature-map channels, each a grid. Toggle the mode. In standard mode, random cells are zeroed but the feature survives in neighboring cells (the pattern is still readable). In spatial mode, whole channels go dark — that feature is genuinely gone. Resample to see different draws.

Standard (cells) vs Spatial (channels) Dropout

Four conv feature-map channels. Standard dropout punches holes (neighbors leak); spatial dropout removes whole channels. Toggle and resample.

Common misconception. “Dropout is dropout — the same layer works everywhere.” The right granularity depends on the data's correlation structure. Independent features (fully-connected) → drop units. Spatially-correlated features (conv maps) → drop channels. Temporally-correlated features (sequences) → drop whole timesteps or use variational dropout with a shared mask across time. Match the drop to where the redundancy lives.
Why does standard (per-cell) dropout barely regularize a convolutional feature map?

Chapter 5: DropConnect — Dropping the Wires, Not the Neurons

Dropout zeros entire neurons — when a neuron is dropped, all of its outgoing connections vanish together. DropConnect asks: what if we drop individual weights (connections) instead? Zero out a random subset of the wires between layers, while the neurons themselves stay alive. It's a finer-grained sibling of dropout, and it's a strict generalization.

The difference in one picture

Picture the connections between two layers as a dense web of wires. Dropout removes a neuron by cutting all the wires attached to it at once — an all-or-nothing decision per neuron. DropConnect cuts each wire independently: a neuron might keep some of its connections and lose others. Because each weight is dropped on its own coin flip, DropConnect has many more possible masks than dropout — it's the more general scheme, with dropout as a special, coarser case.

Why “generalization.” Dropout's masks are constrained: a neuron's connections must all be present or all absent together. DropConnect lifts that constraint — any subset of weights can be dropped. So every dropout mask is achievable by DropConnect, but DropConnect can also produce masks dropout never could (a neuron with, say, three of its five wires cut). More masks means a larger implicit ensemble — and, in the original paper, slightly better results on some benchmarks.

Why dropout is usually preferred anyway

If DropConnect is more general, why is plain dropout the default everywhere? Two practical reasons. First, efficiency: dropping a neuron lets you skip its entire computation, while dropping scattered individual weights doesn't give you that shortcut — you still process the full weight matrix, just with holes in it. Second, the test-time approximation is messier for DropConnect — there's no clean single-pass trick as elegant as dropout's scaled full network. Dropout's gains are nearly as good and far cheaper, so it won. DropConnect remains a useful tool and a clarifying lens: dropout is just DropConnect with a coarse, neuron-level mask.

Concept + realization: where the mask lives

The mask attaches to a different object. Dropout's mask is a vector over neurons — one coin flip per unit. DropConnect's mask is a matrix the same shape as the weight matrix — one coin flip per connection. You multiply the weight matrix elementwise by that mask before the layer's matrix multiply, so dropped weights contribute nothing to any output. Same Bernoulli idea, applied to weights instead of activations.

See it: neurons vs. connections

Toggle between dropout and DropConnect and resample. In dropout mode, whole neurons go dark (all their wires vanish). In DropConnect mode, the neurons stay lit but individual wires are cut. Count how many distinct patterns each can make — DropConnect's number is vastly larger.

Dropout (neurons) vs DropConnect (weights)

Dropout cuts all wires of a dropped neuron. DropConnect cuts individual wires while neurons stay alive. Toggle and resample to feel the granularity difference.

Common misconception. “More general always means better, so DropConnect should replace dropout.” Generality isn't free. DropConnect's finer masks cost more (no computation skipped) and lack dropout's clean inference trick. In practice dropout captures most of the benefit at a fraction of the hassle — a reminder that the practical best method isn't always the most general one.
How does DropConnect differ from standard dropout?

Chapter 6: The Dropout-Rate Trainer — Find the Sweet Spot

Now feel the tradeoff yourself. This trains a small network live on a tiny, noisy dataset — the kind that's easy to overfit — at whatever drop rate you choose. Watch two numbers: training accuracy (how well it fits the data it sees) and test accuracy (how well it generalizes to fresh data). The gap between them is the overfitting, and dropout's whole job is to close it.

There is a sweet spot, and you'll find it by breaking things on both sides:

Live Dropout Trainer (watch the train/test gap)

A small net trains on a few noisy points at your chosen drop rate. Bars show training vs test accuracy — their gap is overfitting. Find the drop rate that maximizes test accuracy without underfitting.

Drop rate p 0.00

What to take away. Dropout doesn't raise training accuracy — it usually lowers it (each step trains a crippled subnetwork). Its gift is raising test accuracy by shrinking the gap. The best drop rate is the one where test accuracy peaks, which is almost never zero and almost never very high. Watch the boundary too: from jagged (overfit) to smooth (regularized) to vague (underfit).
Common misconception. “If a little dropout helps, more must help more.” The curve is a hump, not a ramp. Past the peak, you're deleting so much signal each step that the network can't learn the real pattern at all — underfitting. The art is finding the top of the hump, which depends on layer size, data, and where in the network you apply it.

No quiz — the trainer is the test. If you can predict, before training, whether raising the drop rate from 0.3 to 0.7 will help or hurt, you understand the tradeoff.

Chapter 7: Stochastic Depth — Dropping Whole Layers

So far we've dropped neurons, channels, and weights. Stochastic depth (and its transformer cousin, DropPath) goes bigger: it drops entire layers. During training, each residual block is randomly skipped — replaced by its identity shortcut — so the signal flows straight past it. You're literally training with a randomly shallower network on each step.

Why this is only possible with residuals

You can't just delete a layer from a normal network — the signal would hit a dead end. But a residual block computes “input plus some transformation of the input.” If you drop the transformation, you're left with just “input” — the identity shortcut carries the signal through untouched. So a dropped residual block isn't a hole; it's a clean passthrough. This is exactly why stochastic depth was born in very deep ResNets, and why it's everywhere in modern Vision Transformers and ConvNeXts — all residual architectures. (See the Skip Connections lesson for why residuals enable this.)

Two wins at once. Stochastic depth regularizes (like all dropout, it prevents co-adaptation — now between whole layers) and speeds up training, because a skipped layer's expensive forward and backward computation is simply not done that step. A 100-layer network with aggressive stochastic depth might run at the cost of an effective ~60 layers on average. You train a very deep network for the price of a shallower one, and it generalizes better too.

The linear decay survival rule

A clever detail: layers are not dropped equally. The standard schedule gives early layers a high survival probability (they learn fundamental low-level features everything depends on, so you rarely want to skip them) and lets the survival probability decrease linearly with depth, so the deepest layers are dropped most often. The first block might survive 100% of the time and the last only 50%. Early layers are load-bearing; later layers are refinements you can afford to skip.

Concept + realization: expected depth

At test time, like all dropout, every layer is present, and each block's contribution is scaled by its survival probability (the same expectation-matching trick from Chapter 2). During training, the expected number of active layers is just the sum of all the survival probabilities. With a linear schedule from 1.0 down to 0.5 over 50 blocks, the expected active depth is about 37 — so you get the regularization of a deep network and the average compute of a much shallower one.

python
def drop_path(x, residual_fn, survival_prob, training=True):
    if not training:
        return x + survival_prob * residual_fn(x)   # scale at test
    if torch.rand(1).item() < survival_prob:
        return x + residual_fn(x)                   # block ACTIVE: compute it
    else:
        return x                                  # block DROPPED: identity passthrough

Look at the dropped branch: it returns x unchanged — the residual shortcut. The expensive residual_fn is never even called that step, which is where the speedup comes from. Compare to neuron dropout, which still computes everything and then zeros it. Stochastic depth actually skips the work.

See it: a deep stack dropping blocks

A stack of residual blocks, earliest at the bottom. Press step to sample which blocks are active (lit, computed) versus dropped (dim, skipped via identity). Notice deeper blocks drop more often under the linear schedule. The readout shows the effective depth this pass. Crank the max drop rate and watch the network get shallower on average.

Stochastic Depth: A Randomly Shallower Network Each Step

Residual blocks (earliest at bottom). Lit = active (computed), dim = dropped (identity skip). Deeper blocks drop more (linear schedule). Step to resample.

Max drop rate (deepest layer) 0.50

Common misconception. “Dropping whole layers must wreck the network.” It would — in a plain feedforward net. The residual shortcut is what makes it safe: a skipped block just passes its input through. Without residual connections, stochastic depth is impossible. The technique is a direct beneficiary of the skip-connection revolution, which is why it appears in exactly the architectures that use residuals.
Why can stochastic depth drop an entire layer without breaking the network, and what extra benefit does it give beyond regularization?

Chapter 8: DropBlock, Placement & Scheduling

Spatial dropout (Chapter 4) dropped whole channels to beat spatial correlation. DropBlock takes a middle path: instead of zeroing scattered cells or entire channels, it zeros contiguous square regions within each feature map. This forces the network to lose a whole local patch of a feature — and since the information in that patch can't be recovered from immediate neighbors (they're gone too), it genuinely regularizes, while keeping more of the map than full channel dropping.

The correlation insight, refined. Random per-cell dropout fails on conv maps because a dropped cell's info survives in its neighbor. DropBlock removes a cell and its neighbors — a whole block — so there's no nearby copy to leak through. It's the spatial-correlation fix applied locally rather than to the whole channel: drop a chunk big enough that the feature can't be reconstructed from what's left.

Where to put dropout

Placement matters as much as the rate. Hard-won practice:

The BatchNorm tension

A practical gotcha worth knowing: dropout and batch normalization can fight each other. BatchNorm computes statistics (mean and variance) over the batch, but dropout randomly changes the variance of the activations between training and test — exactly the mismatch BatchNorm is sensitive to. Stacking dropout right before BatchNorm can hurt. The common resolution: modern conv architectures lean on BatchNorm (or stochastic depth) for regularization and use little or no standard dropout in conv blocks. It's a reminder that regularizers interact — you don't just pile them on.

Scheduling the drop rate

DropBlock's authors found it works best with a schedule: start training with a drop rate near zero and ramp it up over time. Early on, the fragile network needs all its capacity to find the basic structure; later, once it's learned something, you crank up the regularization to stop it from overfitting. This echoes curriculum ideas — ease the constraint early, tighten it late. A fixed rate from step one can stall a network that hasn't found its footing yet.

See it: DropBlock vs scattered dropout

A single feature map. Toggle between scattered per-cell dropout and DropBlock's contiguous squares, and adjust the block size. Notice how scattered holes leave the feature's shape readable, while a DropBlock square wipes out a recognizable region the neighbors can't fill in.

DropBlock: Contiguous Regions vs Scattered Cells

One feature map. Scattered dropout punches isolated holes; DropBlock removes whole square regions. Toggle and adjust block size; resample to see new draws.

Block size 3

Common misconception. “Pile on every regularizer — more is safer.” Regularizers interact, sometimes badly (dropout vs BatchNorm). The goal isn't maximum regularization; it's the right kind in the right place at the right time. Match the dropout variant to the layer type, schedule the rate, and don't double up regularizers that step on each other.
Why does DropBlock zero contiguous square regions instead of scattered individual cells?

Chapter 9: Connections & Cheat Sheet

You now understand the whole dropout family: why co-adaptation is the enemy, how the mask works, the all-important scaling that keeps train and test consistent, the ensemble interpretation, and the variants tailored to different structures — spatial dropout for channels, DropConnect for weights, stochastic depth for layers, DropBlock for regions. The unifying thread: deliberately remove information during training so the network can't rely on any single piece — and remove it at the granularity that actually destroys information, given how your data is correlated.

The variants, side by side

VariantWhat it dropsBest for
Standard dropoutindividual neuronsfully-connected layers (p≈0.5)
Spatial / 2D dropoutwhole channelsconv feature maps (beats correlation)
DropConnectindividual weightsfiner-grained; more general, costlier
Stochastic depth / DropPathwhole residual blocksvery deep nets, ViT, ConvNeXt (also faster)
DropBlockcontiguous regionsconv maps; with a ramped schedule

The cheat sheet

The mask:  multiply activations by Bernoulli(keep) zeros and ones
Drop rate p:  probability of silencing; keep = 1 − p
Inverted dropout:  at train, divide survivors by keep; at test, do nothing
Ensemble view:  trains 2^n thinned subnetworks; test = full net ≈ their average
Granularity rule:  drop at the level where information is NOT redundant
Stochastic depth:  needs residuals; skipped block = identity; also speeds training
Watch out:  dropout vs BatchNorm variance conflict; schedule the rate; place per layer type

A decision guide

Fully-connected layer overfitting?
Standard dropout, p around 0.5.
Convolutional feature maps?
Spatial dropout or DropBlock (small rate); standard per-cell is weak here.
Very deep residual net / Transformer?
Stochastic depth / DropPath — regularizes AND speeds training.
Using BatchNorm heavily in conv blocks?
Go light on standard dropout there; let BN/stochastic depth regularize.

Where this connects

The one thing to remember. Dropout's power comes from a paradox: cripple the network on purpose, randomly and constantly, and it learns to be robust — no neuron, channel, weight, or layer can become a single point of failure. The variants just change what you cripple, chosen so the crippling actually removes information given how your data is structured. Break it the right way during training, and it holds together beautifully at test time.
You're regularizing a very deep Vision Transformer that uses residual connections. Which combination is most appropriate?

“The best way to make a system robust is to keep breaking it.” — and a network that survives being randomly shattered ten thousand times has learned to depend on no one, and so generalizes to everyone.