liveBook · Manning

Vanishing gradient problem

As explained in Deep Learning with PyTorch, Second Edition

The difficulty in training deep networks when gradients become too small as they propagate backward through many layers.

The vanishing gradient problem occurs when gradients become too small as they move backward through many layers, making deep networks difficult to train. Skip connections address it by creating a shorter path from deeper parameters to the loss. section 8.5.3

Skip connections help because they:

  • Add a block’s input to its output, forming an identity mapping alongside the ordinary feed-forward path. section 8.5.3
  • Give gradients a direct route to deeper parameters, reducing dependence on a long chain of multiplied operations. section 8.5.3
  • Support convergence and make very deep residual networks easier to train, including architectures exceeding 100 layers. section 8.5.3

From NetDepth to NetRes

A plain three-convolution model applies each layer in sequence. NetRes saves the output after the second convolution and adds it to the third layer’s activated output. Repeating this pattern produces residual blocks; a PyTorch example assembles 100 ResBlock instances into a deeper network.

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Explains the backward-pass shortcut mechanism and demonstrates it in residual blocks, without developing formal gradient equations.
Examples
Uses NetDepth, NetRes, ResBlock, and a 100-block NetResDeep implementation as concrete PyTorch examples.
What it assumes
Assumes familiarity with convolutional layers and backpropagation while demonstrating the residual implementation concretely.
What you can do after
Apply it via PyTorch by adding identity mappings and composing residual blocks in deeper convolutional models.
How it connects
Connects vanishing gradients with backpropagation, skip connections, residual networks, ReLU, and batch normalization.

Also explained in

Compare how 14 books explain vanishing gradient problem →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.