pub trait FeedForward1d {
    fn pass(&self, input_array: Array1<f64>) -> Array1<f64>;
}

Required Methods§

source

fn pass(&self, input_array: Array1<f64>) -> Array1<f64>

Feeds forward the 1d array through the layer.

Arguments
  • input_array: Has to be the same size as the input size of the layer else will panic

returns: Array1<f64>

Examples
use ducky_learn::layers::*;
use ndarray::{arr1, arr2};

let layer = Dense1d::from(
                |x| x, // Activation function that is does nothing
                arr2(&[[1., 1.], [1., 1.]]), // 2x2 array
                arr1(&[1., 1.]) // len 2
            );

let output = layer.pass(arr1(&[1., 1.]));

Implementors§