Unit 2 of 8 · about 4 hours · explain, measure

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.

You'll be able to

  • 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 unitsResidual paths and gradient flow
1

Read

In this order, only the parts listed

0 of 3 done

  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, activationsD2L - 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 normalizationUnderstanding 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

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

2

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 , so its gradient is 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.
Common mistakes · 3
  • 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.
3

Try it yourself

Closed-book, before checking anything

Closed-book, write a two-block residual unrolling and its gradient with respect to , and circle the identity term that survives even if both residual Jacobians vanish.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 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?Answer

    Each layer multiplies the gradient by its weights and by a sigmoid derivative of at most 0.25. Ten factors near 0.2 give about , roughly 1e-7, so early layers barely learn.

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

    Dead. Their pre-activations are negative on every example, so the ReLU derivative is zero and no gradient reaches their incoming weights or bias. They recover only if earlier layers happen to shift their inputs.

  3. 3.Why does train deeper than alone, in one gradient sentence?Answer

    Its Jacobian is plus , so the gradient contains an identity term that reaches early layers directly instead of only through products of small or unstable Jacobians.

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

    First, confirm evaluation runs in eval mode (model.eval(): no dropout, running statistics). Second, measure training accuracy the same way, in eval mode on a training subset, because the logged training number came from train mode. Only a gap that survives both is overfitting.

5

Practice

You're done 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.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 10 more in the section
  • Understanding Deep Learning - fitting, gradients and regularizationSimon J. D. Prince · primary

    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 sliceD2L authors · required

    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