Pascanu et al. (2013) observed that recurrent gradients can explode. Clipping the gradient norm to a threshold bounds the step while keeping its direction.
Implement clip_by_norm(g, threshold), rescaling the gradient only when it is too large.
If the norm exceeds the threshold, multiply the gradient by threshold over the norm.
No results yet
Run your code to check it against the examples, or submit to run every test.