pub fn sigmoid_prime<T>(arr: &Array2<T>) -> Array2<f64>
where
T: Copy + std::ops::Mul,
f64: std::convert::From<T>,
{
    let mut new = Vec::new();
    for each in arr.iter() {
        new.push(f64::from(*each) * (1. - f64::from(*each)));
    }
    let shape = arr.shape();
    let dim: [usize; 2] = [shape[0],shape[1]];
    Array::from_shape_vec(dim, new).unwrap()
}
/// Loops through the Array and calculates sigmoid prime of each value.
///
/// _Note: Since taking the sigmoid of each value in the matrix requires it to be converted
/// to floating point and From f64 trait is not implemented for i32/64
/// nor for u32/64/size, this function returns f64 Array_
Loops through the Array and calculates sigmoid prime of each value.
_Note: Since taking the sigmoid of each value in the matrix requires it to be converted
to floating point and From f64 trait is not implemented for i32/64
nor for u32/64/size, this function returns f64 Array_
Loops through the Array and calculates sigmoid prime of each value . _Note : Since taking the sigmoid of each value in the matrix requires it to be converted to floating point and From f64 trait is not implemented for i32 / 64 nor for u32 / 64 / size this function returns f64 Array_
pub fn sigmoid_prime<T>(arr: &Array2<T>) -> Array2<f64>
where
T: Copy + std::ops::Mul,
f64: std::convert::From<T>,
{
    let mut new = Vec::new();
    for each in arr.iter() {
        new.push(f64::from(*each) * (1. - f64::from(*each)));
    }
    let shape = arr.shape();
    let dim: [usize; 2] = [shape[0],shape[1]];
    Array::from_shape_vec(dim, new).unwrap()
}
pub fn sigmoid_prime < T > ( arr : & Array2 < T > ) -> Array2 < f64 > where T : Copy + std :: ops :: Mul , f64 : std :: convert :: From < T > , { let mut new = Vec :: new ( ) ; for each in arr . iter ( ) { new . push ( f64 :: from ( * each ) * ( 1. - f64 :: from ( * each ) ) ) ; } let shape = arr . shape ( ) ; let dim : [ usize ; 2 ] = [ shape [ 0 ] , shape [ 1 ] ] ; Array :: from_shape_vec ( dim , new ) . unwrap ( ) }
Loops through the Array and calculates sigmoid prime of each value.
Loops through the Array and calculates sigmoid prime of each value .
arr
&Array2<T>