pub fn clip_gradients(gradient: &mut Array1<f64>, maxnorm: f64)
Clip gradients to prevent exploding gradients