It caps the gradient magnitude, either by value or (more commonly) by rescaling the global gradient norm to a maximum such as 1.0.
It prevents exploding gradients and sudden loss spikes, especially in RNNs, transformers, and training with large learning rates.
Log the gradient norm so you can see how often clipping is triggered.
Loading…