Skip to content

Training, adaptation, compression, and systems techniques · Training, fine-tuning, adaptation, compression, and systems techniques · TRN010 · Training method

Dropout

Randomly removes activations during training to regularize a network.

Runs in CodeSplash Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

Do it in CodeSplash Run it on your own data, in Python or R.

Availability
Runs in CodeSplash
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through discover.graph_embed, learn.cnn, learn.ft_transformer, learn.gnn, learn.set_model, learn.tabm, learn.torch_mlp. The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Randomly removes activations during training to regularize a network.

Question / hypotheses

Does this intervention improve the intended quality, adaptation, resource, or reliability objective under a controlled comparison? It defines a method, not an intrinsic null-hypothesis test.

Architecture / computational structure

A Bernoulli mask multiplies activations; inverted-dropout scaling keeps the expected activation unchanged.

Assumptions

Training/evaluation modes must be correct. Mask sharing across time, channels, or samples defines different dropout variants; too much dropout can underfit.

Formula / computational definition

h~=m⊙h/(1−p),mj∼Bernoulli(1−p).\tilde h=m\odot h/(1-p),\quad m_j\sim Bernoulli(1-p).

Parameters and notation

No extra learned weights. Hyperparameters: drop probability p, mask granularity, insertion sites, and inference policy. A fixed deterministic evaluation normally disables dropout.

Fitting, fine-tuning, and adaptation

Fine-tuning may require less dropout than training from scratch, especially with small adapters. Tune it jointly with weight decay and data size rather than copying a universal setting.

How to use and calibrate

Track train/validation gap and seed sensitivity. Example: regularize a classifier head over frozen embeddings.

Example application

regularize a classifier head over frozen embeddings.

Interpretation / pitfalls

Watch out

Turning dropout on at inference changes the procedure; Monte Carlo dropout uncertainty needs its own interpretation and validation. Mask multiplication without compensating scaling changes expected activations.

Python and R code examples

Scope: numerical mechanism demonstration. Validation: Python executed successfully on the supplied synthetic inputs; R reviewed but not executed (Rscript unavailable).

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — numerical mechanism demonstration. · needs numpy

import numpy as np
h=np.array([1.,2.,3.,4.]); p=.5; mask=np.array([1,0,1,0])
print(mask*h/(1-p))
R

Component demo, not a trained model — numerical mechanism demonstration.

h <- c(1,2,3,4); p <- .5; mask <- c(1,0,1,0)
print(mask*h/(1-p))

Sources

From the CodeSplash reference, entry TRN010.