pub fn new(input_size: usize, output_size: usize, hidden_sizes: Vec<usize>) -> Self {
        assert!(hidden_sizes.len() >= 1, "Can't have a network without a hidden layer!");

        let mut biases = Vec::new();
        let mut weights = vec![Array::random((input_size, hidden_sizes[0]), Uniform::new(0.,1.))];

        for i in 0..hidden_sizes.len() {
            biases.push(Array::random(hidden_sizes[i], Uniform::new(0.,1.)));
            let cols = if i == hidden_sizes.len() - 1 {
                output_size
            } else {
                hidden_sizes[i + 1]
            };
            weights.push(Array::random((hidden_sizes[i], cols), Uniform::new(0.,1.)));
        }

        Self {
            hidden_sizes,
            biases,
            weights,
        }
    }
/// creates a new neural network with given input, output, and hidden sizes
creates a new neural network with given input, output, and hidden sizes
creates a new neural network with given input output and hidden sizes
pub fn new(input_size: usize, output_size: usize, hidden_sizes: Vec<usize>) -> Self {
        assert!(hidden_sizes.len() >= 1, "Can't have a network without a hidden layer!");
        let mut biases = Vec::new();
        let mut weights = vec![Array::random((input_size, hidden_sizes[0]), Uniform::new(0.,1.))];
        for i in 0..hidden_sizes.len() {
            biases.push(Array::random(hidden_sizes[i], Uniform::new(0.,1.)));
            let cols = if i == hidden_sizes.len() - 1 {
                output_size
            } else {
                hidden_sizes[i + 1]
            };
            weights.push(Array::random((hidden_sizes[i], cols), Uniform::new(0.,1.)));
        }
        Self {
            hidden_sizes,
            biases,
            weights,
        }
    }
pub fn new ( input_size : usize , output_size : usize , hidden_sizes : Vec < usize > ) -> Self { assert ! ( hidden_sizes len ( ) 1 " " ) ; let mut biases = Vec :: new ( ) ; let mut weights = vec ! [ Array random ( ( input_size hidden_sizes [ 0 ] ) Uniform new ( 0. 1. ) ) ] ; for i in 0 .. hidden_sizes . len ( ) { biases . push ( Array :: random ( hidden_sizes [ i ] , Uniform :: new ( 0. , 1. ) ) ) ; let cols = if i == hidden_sizes . len ( ) - 1 { output_size } else { hidden_sizes [ i + 1 ] } ; weights . push ( Array :: random ( ( hidden_sizes [ i ] , cols ) , Uniform :: new ( 0. , 1. ) ) ) ; } Self { hidden_sizes , biases , weights , } }
creates a new neural network with given input, output, and hidden sizes
creates a new neural network with given input output and hidden sizes
input_size
usize
output_size
usize
hidden_sizes
Vec<usize>