liveBook · Manning

Vanishing gradient problem

As explained in Graph Neural Networks in Action

An optimization problem in which gradients become progressively smaller as they are propagated through many computational steps, hindering learning of long-range dependencies.

The vanishing gradient problem occurs when gradients used by gradient descent approach zero as they pass through many recurrent steps or layers. Training then struggles to preserve the influence of earlier information, limiting an RNN’s effective memory for sequential prediction. section 6.2.2 section 6.5.1

Gated recurrent architectures address the problem through controlled memory updates:

  • Use LSTM networks to introduce more complex dependencies than a vanilla RNN; their role is described, but their internals remain outside the treatment. section 6.2.2
  • Use GRU update gates to control how much past information remains and reset gates to control how much is discarded. section 6.5.1
  • Represent the GRU’s candidate activation as a proposed new state and its hidden state as the resulting representation. section 6.5.1

PyTorch GRU for pose estimation

A practical replacement for a recurrent baseline defines nn.GRU(input_size, hidden_size, num_layers, batch_first=True), initializes a zero hidden state on the input device, runs the sequence, and maps the final selected outputs through a linear layer. The same workflow supports predicting sensor trajectories over time. section 6.5.1 section 6.2.2

Figure 6.18 Design of the GRU layer, where rt represents the reset gate, zt is the update gate, ~ht is the candidate function, and ht is the final actual hidden state
figure

Inspect the GRU diagram to connect reset gates, update gates, candidate activation, and the final hidden state. section 6.5.1

How Graph Neural Networks in Action covers it

How deep it goes
Defines gradient decay and explains GRU gate roles, but defers the underlying causes and LSTM internals.
Examples
Uses sensor-trajectory prediction, pose-estimation RNN and GRU definitions, and GRU gate diagrams as concrete teaching artifacts.
What you can do after
Build it from scratch using PyTorch GRU layers with initialized hidden states and linear output projections for sequence prediction.
How it connects
Connects gradient descent with recurrent neural networks, LSTM networks, GRU networks, hidden states, and sequential data.

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 Graph Neural Networks in Action. The section links point to the parts of the book it draws on.