liveBook · Manning

Gradient clipping

Gradient clipping is an optimization technique that limits gradient values or their norm before parameter updates to reduce excessively large or unstable updates.

How 2 Manning books explain it

Inside Deep Learning: Math, Algorithms, Models

A training stabilization method that caps gradient values to a chosen threshold to prevent excessively large updates.

How it is used
Stabilizes neural-network training when exploding gradients cause unreasonable updates or prevent convergence.
How deep it goes
Defines elementwise thresholding and demonstrates PyTorch hooks and clamp, but does not develop alternative clipping algorithms.
Examples
Uses a vector threshold example, parameter hooks, FashionMNIST comparisons, and an autoregressive character GRU.
What you can do after
Apply it via PyTorch parameter hooks and torch.clamp, then compare training results empirically.

Read how Inside Deep Learning: Math, Algorithms, Models explains gradient clipping →

Machine Learning System Design

Gradient clipping is a training technique that bounds gradient values or their norm before parameter updates.

How it is used
Uses gradient clipping to stabilize training when loss explodes or trends toward NaN.
How deep it goes
Defines clipping as an exploding-gradient remedy but stops short of implementation details or parameter choices.
Examples
Uses exploding or NaN loss as the diagnostic case, alongside oscillation and small-batch overfitting checks.
What you can do after
Diagnose/debug with it by recognizing exploding-gradient symptoms and comparing clipping with learning-rate or initialization changes.

Read how Machine Learning System Design explains gradient clipping →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.