pub trait NetLayer: Debug {
    fn forward(
        &self,
        input: &Matrix<f64>,
        params: MatrixSlice<'_, f64>
    ) -> LearningResult<Matrix<f64>>; fn back_input(
        &self,
        out_grad: &Matrix<f64>,
        input: &Matrix<f64>,
        output: &Matrix<f64>,
        params: MatrixSlice<'_, f64>
    ) -> Matrix<f64>; fn back_params(
        &self,
        out_grad: &Matrix<f64>,
        input: &Matrix<f64>,
        output: &Matrix<f64>,
        params: MatrixSlice<'_, f64>
    ) -> Matrix<f64>; fn default_params(&self) -> Vec<f64>; fn param_shape(&self) -> (usize, usize); fn num_params(&self) -> usize { ... } }
Expand description

Trait for neural net layers

Required Methods

The result of propogating data forward through this layer

The gradient of the output of this layer with respect to its input

The gradient of the output of this layer with respect to its parameters

The default value of the parameters of this layer before training

The shape of the parameters used by this layer

Provided Methods

The number of parameters used by this layer

Implementors