[][src]Struct pyrus_nn::network::Sequential

pub struct Sequential {
    pub lr: f32,
    pub n_epoch: usize,
    pub batch_size: usize,
    pub cost: CostFunc,
    pub verbose: bool,
    // some fields omitted
}

Fields

lr: f32n_epoch: usizebatch_size: usizecost: CostFuncverbose: bool

Methods

impl Sequential[src]

pub fn new(lr: f32, n_epoch: usize, batch_size: usize, cost: CostFunc) -> Self[src]

Create a new Sequential network, with perhaps sensible defaults.

pub fn add(&mut self, layer: impl Layer + 'static) -> Result<(), &'static str>[src]

Add a layer to the network

pub fn len(&self) -> usize[src]

Determine how many layers on held in the network

pub fn predict(&mut self, x: ArrayView2<f32>) -> Array2<f32>[src]

Use the network to predict the outcome of x

pub fn forward(&mut self, x: ArrayView2<f32>) -> Array2<f32>[src]

Apply the network against an input

pub fn backward(&mut self, output: ArrayView2<f32>, expected: ArrayView2<f32>)[src]

Run back propagation on output vs expected

pub fn fit(&mut self, x: ArrayView2<f32>, y: ArrayView2<f32>)[src]

Train the network according to the parameters set given training and target data

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Box<dyn Layer>>[src]

Mutably iterate over the layers in the network.

pub fn iter(&self) -> impl Iterator<Item = &Box<dyn Layer>>[src]

Iterate over the layers in the network.

Trait Implementations

impl Default for Sequential[src]

impl Serialize for Sequential[src]

impl<'de> Deserialize<'de> for Sequential[src]

Auto Trait Implementations

impl !Send for Sequential

impl !Sync for Sequential

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]