[][src]Trait pyrus_nn::layers::Layer

pub trait Layer: Serialize + Deserialize {
    fn new(n_input: usize, n_output: usize, activation: Activation) -> Self
    where
        Self: Sized
;
fn forward(&mut self, x: Array2<f32>) -> Array2<f32>;
fn n_input(&self) -> usize;
fn n_output(&self) -> usize;
fn output(&self) -> Array2<f32>;
fn input(&self) -> Array2<f32>;
fn weights(&self) -> Array2<f32>;
fn set_weights(&mut self, weights: Array2<f32>);
fn backward(&mut self, error: Array2<f32>, lr: f32) -> Array2<f32>; }

Required methods

fn new(n_input: usize, n_output: usize, activation: Activation) -> Self where
    Self: Sized

fn forward(&mut self, x: Array2<f32>) -> Array2<f32>

fn n_input(&self) -> usize

fn n_output(&self) -> usize

fn output(&self) -> Array2<f32>

fn input(&self) -> Array2<f32>

fn weights(&self) -> Array2<f32>

fn set_weights(&mut self, weights: Array2<f32>)

fn backward(&mut self, error: Array2<f32>, lr: f32) -> Array2<f32>

Loading content...

Trait Implementations

impl<'typetag> Serialize for dyn Layer + 'typetag[src]

impl<'typetag> Serialize for dyn Layer + Send + 'typetag[src]

impl<'typetag> Serialize for dyn Layer + Sync + 'typetag[src]

impl<'typetag> Serialize for dyn Layer + Send + Sync + 'typetag[src]

impl Strictest for dyn Layer[src]

type Object = dyn Layer

Implementors

impl Layer for Dense[src]

Loading content...