Foundations to Frontier
Tests
E. Deep Learning › E4 Regularization Techniques (one page each)

DropConnect

DropConnect drops individual weights instead of whole units: every connection is kept with probability 1 − p, with a fresh mask for each example. It generalises dropout, which is the special case where all of a unit's outgoing weights are dropped together. This page covers the update, how its noise compares with dropout's, the moment-matching inference rule of its original paper, its cost, and where its idea survives today. In the exercises you show that dropout and DropConnect add the same noise variance to each output but dropout's noise is correlated across outputs while DropConnect's is not, then compare the two on a small network and find that DropConnect helped less than dropout at the same rate and was several times slower to train.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Drop connections, not units

Dropout switches off whole units, cutting every connection leaving them at once. DropConnect instead cuts individual connections at random, a different set for every training example. A unit might lose its link to one neighbour but keep its links to others. It is a finer-grained kind of noise.

Regularisation lab: a small network on 40 noisy points
test cross-entropy during training
lowest test loss 0.186 at epoch 850
train accuracy 0.925 · test accuracy 0.908 · final test cross-entropy 0.223
With no regularisation the network fits all 40 noisy training points with a contorted boundary, and its test loss rises after an early minimum (the dot): overfitting. Each regulariser trades some training fit for a smoother boundary. Early stopping keeps the weights from the dot (here the test loss stands in for a validation set, which makes it look slightly better than it would in practice). Try the strength slider: too little does nothing, too much underfits. Results vary with the data, so press "new data" before trusting a comparison.
Why engineers care

DropConnect itself is rarely used in modern networks, but its idea of randomly masking weights rather than activations recurs: DropBlock and stochastic depth mask larger structures, and weight-dropped LSTMs (AWD-LSTM) apply DropConnect to recurrent weights, where dropping activations would disturb the memory.

📝 Quick check (Level 0)
0/3 answered
  1. 1. DropConnect drops…
  2. 2. Dropout is the special case of DropConnect where…
  3. 3. A well-known modern use of DropConnect is on…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Layer: z = x(M ⊙ W)/(1 − p), Mᵢⱼ ~ Bernoulli(1 − p), with a new M for every example.
  • Example: x = (1, 2), W all ones, M = [[1, 0], [0, 1]], p = 0.5: z = (1 × 2, 2 × 2) = (2, 4).
  • Mean: E[z] = xW, as for dropout.
  • Variance of each output: Var zⱼ = (p/(1 − p))Σᵢ xᵢ²Wᵢⱼ². It is the same as for dropping inputs. Example: x = (1, 2), W = (1, 1)ᵀ, p = 0.5 gives 1 + 4 = 5.
  • Difference: with dropout, a dropped input removes a term from every output, so the outputs’ noise is correlated; with DropConnect each weight’s mask is independent, so it is not.
  • Cost: per layer and step, dropout draws batch × n_in random numbers; DropConnect draws batch × n_in × n_out: 1920 against 61 440 for a 32 × 32 layer and a batch of 60.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Per-output noise variance of DropConnect compared with input dropout:
  2. 2. DropConnect's noise across outputs is…
  3. 3. Random draws for a 32 × 32 layer, batch 60, DropConnect:

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

DropConnect in code

Exercise 1. Over 20 000 masks on a 16 → 6 layer, both methods kept the mean, and both gave each output variance within 1.5% of (p/(1 − p))Σxᵢ²Wᵢⱼ². The mean correlation between different outputs’ noise was 0.707 for dropout and 0.000 for DropConnect.

Practice.

  • Inference. Wan et al. approximated each pre-activation as a Gaussian with the exact mean and variance, passed samples through the activation, and averaged. The simpler weight-scaling rule (use all weights) is also common.
  • Per-example masks are expensive; implementations often share a mask across a mini-batch (as AWD-LSTM does per sequence), which reduces the regularisation.
  • For recurrent networks, apply DropConnect to the hidden-to-hidden weights with one mask per sequence.
# AWD-LSTM style: one weight mask per forward pass on the recurrent matrix
W_hh_dropped = torch.nn.functional.dropout(W_hh, p=0.5, training=self.training)
🐍 Exercise 1: two kinds of noise
Implement dropout and DropConnect for one linear layer and compare the mean, variance and cross-output correlation of their noise.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Wan et al.'s inference rule approximates pre-activations as…
  2. 2. Sharing one mask per mini-batch…
  3. 3. In exercise 1, dropout's cross-output noise correlation was about…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Generalisation of dropout. Dropout on unit i is DropConnect with a mask that is constant along row i of the next weight matrix. DropConnect draws the row’s entries independently. Its family of sub-networks is therefore much larger: 2^(n_in × n_out) masks instead of 2^(n_in).

Same marginal noise, different joint noise. Exercise 1 shows the per-output variances agree. The difference is in correlations. Correlated noise moves all of the next layer’s units together and behaves like a larger perturbation of the layer’s output vector, which may explain why dropout regularised more strongly in exercise 2.

Bounds. Wan et al. (2013) gave a Rademacher-complexity bound for DropConnect networks that shrinks with the drop rate.

Results then and now. DropConnect reported small gains over dropout on MNIST, CIFAR-10 and SVHN in 2013, with ensembles of several networks. It did not become standard, mainly because of its cost and the arrival of batch normalisation and augmentation-heavy training.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Number of DropConnect masks for an n_in × n_out layer:
  2. 2. Dropout's noise differs from DropConnect's in its…
  3. 3. DropConnect did not become standard mainly because of…

Level 4: Expert

★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.

DropConnect versus dropout

History.

  • L. Wan, M. Zeiler, S. Zhang, Y. LeCun and R. Fergus (2013) introduced DropConnect.
  • S. Merity, N. Keskar and R. Socher (2018) used it on LSTM recurrent weights (AWD-LSTM).
  • G. Ghiasi, T.-Y. Lin and Q. Le (2018) introduced DropBlock; G. Huang et al. (2016) stochastic depth: both mask larger structures.

Exercise 2. A 2–32–32–2 ReLU network on 60 noisy two-moons points, with noise (p = 0.5) applied only to the hidden-to-hidden layer: dropout on the first hidden layer’s units, or DropConnect with a fresh weight mask for every example. Trained with Adam for 1000 full-batch steps; tested on 2000 points (Monte Carlo averages on the first 1000). Means of three seeds:

method test acc test CE (deterministic) MC acc MC CE
none 0.870 1.497 — —
dropout 0.876 1.183 0.882 0.566
DropConnect 0.880 1.363 0.881 1.005
  • Neither method changed test accuracy much (0.87–0.88).
  • Both lowered the test cross-entropy, dropout more. Dropout’s correlated noise appears to regularise more strongly at the same p.
  • DropConnect was several times slower to train because of its per-example weight masks.
  • Lesson: dropout is the better default; consider DropConnect where activations must not be disturbed, as on recurrent weights.
🐍 Exercise 2 (research): DropConnect versus dropout
Train a small network with no noise, dropout and DropConnect on one layer and compare accuracy and cross-entropy, deterministic and Monte Carlo.

DropConnect in AI, robotics and aerospace

  • Recurrent models of time series, such as sensor streams and telemetry, have used weight-dropped LSTMs.
  • Bayesian approximations: random weight masks, like dropout masks, give a cheap ensemble for uncertainty.
  • Fault tolerance: training with random connection failures is studied as a way to make networks robust to faulty hardware, a concern for radiation-exposed spacecraft electronics.

References

  1. L. Wan, M. Zeiler, S. Zhang, Y. LeCun, R. Fergus (2013). “Regularization of neural networks using DropConnect.” Proc. ICML.
  2. S. Merity, N. S. Keskar, R. Socher (2018). “Regularizing and optimizing LSTM language models.” Proc. ICLR.
  3. N. Srivastava et al. (2014). “Dropout: a simple way to prevent neural networks from overfitting.” JMLR 15.