/// Convert the label into an ideal activation, without taking ownership
Convert the label into an ideal activation, without taking ownership
Convert the label into an ideal activation without taking ownership
pub fn to_arr(&self) -> LayerActivations {
        let mut arr_rep = vec![0.; 10];
        match self {
            Label::Zero => arr_rep[0] = 1.,
            Label::One => arr_rep[1] = 1.,
            Label::Two => arr_rep[2] = 1.,
            Label::Three => arr_rep[3] = 1.,
            Label::Four => arr_rep[4] = 1.,
            Label::Five => arr_rep[5] = 1.,
            Label::Six => arr_rep[6] = 1.,
            Label::Seven => arr_rep[7] = 1.,
            Label::Eight => arr_rep[8] = 1.,
            Label::Nine => arr_rep[9] = 1.,
        }
        Array::from_vec(arr_rep).into_shape((10, 1)).unwrap()
    }
pub fn to_arr ( & self ) -> LayerActivations { let mut arr_rep = vec ! [ 0. 10 ] ; match self { Label :: Zero => arr_rep [ 0 ] = 1. , Label :: One => arr_rep [ 1 ] = 1. , Label :: Two => arr_rep [ 2 ] = 1. , Label :: Three => arr_rep [ 3 ] = 1. , Label :: Four => arr_rep [ 4 ] = 1. , Label :: Five => arr_rep [ 5 ] = 1. , Label :: Six => arr_rep [ 6 ] = 1. , Label :: Seven => arr_rep [ 7 ] = 1. , Label :: Eight => arr_rep [ 8 ] = 1. , Label :: Nine => arr_rep [ 9 ] = 1. , } Array :: from_vec ( arr_rep ) . into_shape ( ( 10 , 1 ) ) . unwrap ( ) }
Convert the label into an ideal activation, without taking ownership
Convert the label into an ideal activation without taking ownership
&self