Skip to main content

Layer

Trait Layer 

Source
pub trait Layer {
    type Input: Dimension;
    type Output: Dimension;

    // Required methods
    fn forward(
        &mut self,
        input: &ArrayBase<OwnedRepr<f32>, Self::Input>,
    ) -> ArrayBase<OwnedRepr<f32>, Self::Output>;
    fn backward(
        &mut self,
        grad_output: &ArrayBase<OwnedRepr<f32>, Self::Output>,
        learning_rate: f32,
    ) -> ArrayBase<OwnedRepr<f32>, Self::Input>;
}

Required Associated Types§

Required Methods§

Source

fn forward( &mut self, input: &ArrayBase<OwnedRepr<f32>, Self::Input>, ) -> ArrayBase<OwnedRepr<f32>, Self::Output>

Source

fn backward( &mut self, grad_output: &ArrayBase<OwnedRepr<f32>, Self::Output>, learning_rate: f32, ) -> ArrayBase<OwnedRepr<f32>, Self::Input>

Implementors§