pub fn mean_loss<T>(a: &Array2<T>, b: &Array2<T>) -> f64 
where T: std::ops::Sub<Output = T> + Copy,
f64: std::convert::From<T>,
{
    a.iter().zip(b.iter()).fold(0.,|acc, (x,y)|{
        let diff = f64::from(*x - *y);
        acc + f64::powi(diff,2)
    }) / a.len() as f64
}
/// Calculates the mean square differnce between two arrays
Calculates the mean square differnce between two arrays
Calculates the mean square differnce between two arrays
pub fn mean_loss<T>(a: &Array2<T>, b: &Array2<T>) -> f64 
where T: std::ops::Sub<Output = T> + Copy,
f64: std::convert::From<T>,
{
    a.iter().zip(b.iter()).fold(0.,|acc, (x,y)|{
        let diff = f64::from(*x - *y);
        acc + f64::powi(diff,2)
    }) / a.len() as f64
}
pub fn mean_loss < T > ( a : & Array2 < T > , b : & Array2 < T > ) -> f64 where T : std :: ops :: Sub < Output = T > + Copy , f64 : std :: convert :: From < T > , { a . iter ( ) . zip ( b . iter ( ) ) . fold ( 0. , | acc , ( x , y ) | { let diff = f64 :: from ( * x - * y ) ; acc + f64 :: powi ( diff , 2 ) } ) / a . len ( ) as f64 }
Calculates the mean square differnce between two arrays
Calculates the mean square differnce between two arrays
a
&Array2<T>
b
&Array2<T>