Clip the whole gradient once
numeric▲△△A two-parameter gradient is . Use global norm threshold and plain gradient-descent step size . Find the clipped gradient and update norm. Compare clipping each coordinate to the interval .
Hint
The original Euclidean norm is ten. Global clipping uses one scale factor for both entries.
Solution
Equation (I.9.7) scales both coordinates by . The clipped gradient is , with norm five. The update is , with norm .
Coordinate clipping instead gives , whose norm is . It changes direction and exceeds the proposed global threshold. It is a valid different rule, not an implementation of global norm clipping.
When the original norm is already below five, the global rule leaves it unchanged. A zero vector also stays zero; handle that case without dividing by zero. Neither rule repairs a non-finite gradient.