7 routes42 sections324 units

Unit 3.2 · about 4 h

186 / 324

Dead, saturated and exploding units, and residual paths

Most failed runs show one of four signatures. Reading the signature decides whether to change the activation, the scale, the depth structure or the evaluation mode.

  • explain
  • measure

You can now

  • Distinguish dead, saturated, vanishing and exploding regimes from activation histograms and gradient norms.
  • Explain how residual identity paths change the gradient product and which failure they leave in place.
  • Predict train-time versus test-time behavior differences caused by batch statistics.

Covers

  • Dead, saturated, vanishing and exploding units
  • Residual paths and gradient flow

Study, in this order

3 steps

  1. Vanishing and exploding gradients (problem setup)
    Understanding Deep Learning - fitting, gradients and regularization

    Chapter 7, Section 7.5 opening (pp. 107 to 108): small versus large init variance and the vanishing and exploding gradient problem

  2. Vanishing and exploding gradients, activations
    D2L - optimization and regularization slice

    Vanishing and Exploding Gradients: the matrix-product gradient form, sigmoid tails versus ReLU, and Breaking the Symmetry

  3. Residual blocks and batch normalization
    Understanding Deep Learning - fitting, gradients and regularization

    Chapter 11, Sections 11.2 through 11.4 (pp. 189 to 194): residual connections and gradient paths, exploding variance in residual nets, and batch normalization training statistics

    Depth · Stop at Section 11.4. Skip the architecture catalog in 11.5 and later.

Focus on

  • Sigmoid derivatives peak at 0.25 and decay to zero at both tails; tanh peaks at 1 but still decays. Products of many such terms vanish, while ReLU passes 1 on its active side and 0 elsewhere.
  • A residual block outputs \(x + f(x)\), so its gradient is \(I\) plus residual terms. The identity term gives every layer a direct path, but He init still doubles per-block variance, which is why these nets pair residuals with normalization.
  • Dead ReLU units output zero and pass zero gradient for all negative inputs. A large negative bias update can silence a unit for the rest of training.
  • Batch normalization uses batch statistics during training and frozen statistics at test time. A train and eval gap with normalization present points at state handling before architecture.

Reproduce closed-book

Closed-book, write a two-block residual unrolling \(x_2 = x_0 + f_1(x_0) + f_2(x_0 + f_1(x_0))\) and its gradient with respect to \(x_0\), and circle the identity term that survives even if both residual Jacobians vanish.

Traps

  • Calling any flat loss a vanishing-gradient problem. Dead units, saturated outputs, too-small learning rates and broken objectives all flatten curves; check gradient norms before renaming the failure.
  • Believing residuals remove all scale problems. UDL Section 11.3 shows per-block variance still doubles under He init; residuals fix paths while normalization fixes scale.
  • Testing with training-mode normalization or dropout and reporting the gap as overfitting. Set eval mode first, then compare.

Practice

D2L LeNet with Batch Normalization: learning-rate robustness

LeNet with Batch Normalization; Exercises: the learning-rate comparison and failure-point questions

Self-test

  1. In a 10-layer sigmoid MLP, gradient norms shrink by about 0.2 per layer. Where does a factor near 0.2 come from, and what does it do over 10 layers?

  2. Half the ReLUs in a layer output zero on every training example and their weights never change. Dead or saturated, and why stuck?

  3. Why does \(x + f(x)\) train deeper than \(f(x)\) alone, in one gradient sentence?

  4. Training accuracy is 95 percent and evaluation accuracy 70 percent, with batch normalization and dropout. Name the first two checks.

Completion criterion

Stop when

You classify a dead, a saturated and an exploding layer from histograms and gradient norms alone, and you write the residual gradient with its identity term without notes.

Mark passed, then open 3.3 Only mark this when you can do it without notes.

Leads to

Comes after

Resources for this unit

  • Understanding Deep Learning - fitting, gradients and regularization
    Simon J. D. Princeprimarytheory
    Use Chapters 6-9 and targeted parts of Chapter 20 for optimization, initialization, measurement, regularization and why training works. Re-derive the update rules you keep in the trainer.
  • D2L - optimization and regularization slice
    D2L authorsrequiredimplementation
    Use MLP implementation, dropout, deep generalization, numerical stability, optimization introduction, SGD, minibatch SGD, momentum, AdaGrad, RMSProp, Adam and learning-rate scheduler. Implement momentum, AdamW, initialization, dropout, one normalization, clipping and one schedule.

Also in this section

Quick find

Search Michi

Type to search every route, section, unit, topic and resource.

Enter opens the first result Esc closes

Reference

Keyboard shortcuts

n
Continue to the first unit not passed
j / k
Next / previous unit
1 2 3
Toggle learned, practised, passed
/
Open search
?
Show this help
Esc
Close open panels