pub fn normalize_axis<T, const I: isize>(t: T, epsilon: T::Dtype) -> T where
    T: Reduce1<I>,
    T::Array: HasAxis<I>, 
Expand description

Normalizes t to have mean 0.0 and stddev 1.0 along the I dimension of T. epsilon is passed to std_axis(). Computes (t - t.mean(I)) / t.std(I, epsilon).

Related functions: mean_axis(), std_axis(), var_axis()

Examples

let a = Tensor1D::new([-2.0, -1.0, 0.0, 5.0, 2.0]);
let r = a.normalize_axis::<-1>(1e-5);
assert!(r.clone().mean_axis::<-1>().data().abs() < 1e-6);
assert!((r.clone().std_axis::<-1>(0.0).data() - 1.0).abs() < 1e-6);