Overview
Gradient Clipping rescales or caps gradients before an optimizer applies them, commonly preventing exploding gradients in neural networks.
Limits gradient size so optimization updates do not become unstable.
Compact metadata for implementation and discovery.
Gradient Clipping rescales or caps gradients before an optimizer applies them, commonly preventing exploding gradients in neural networks.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n)
Space
O(1) extra
g_clipped = g * min(1, threshold / norm(g))Rescales the gradient only when it exceeds the threshold.
Show a large gradient vector shortened to fit inside a norm circle.
Clipping controls update magnitude but does not fix a badly chosen objective or learning rate by itself.
What each reference supports for this entry.
Reference for exploding gradients and gradient clipping in recurrent network training.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Gradient clipping can be applied before adaptive optimizer updates.
Gradient clipping is commonly applied to backpropagated gradients in deep networks.
Recurrent networks often use clipping to control exploding gradients.