[][src]Trait mli::Forward

pub trait Forward {
    type Input;
    type Internal;
    type Output;
    fn forward(&self, input: &Self::Input) -> (Self::Internal, Self::Output);

    fn run(&self, input: &Self::Input) -> Self::Output { ... }
}

This trait is for algorithms that have an input and produce an output.

Associated Types

type Input

type Internal

type Output

Loading content...

Required methods

fn forward(&self, input: &Self::Input) -> (Self::Internal, Self::Output)

forward produces:

  • All intermediary values produced, which can be reused in the back propogation step
  • The output f given an input
Loading content...

Provided methods

fn run(&self, input: &Self::Input) -> Self::Output

run only produces the output from the input. The default implementation uses forward. You can make a custom implementation of this to avoid the overhead of producing and returning the internal variables.

Loading content...

Implementors

impl<'a, T> Forward for &'a T where
    T: Forward
[src]

type Input = T::Input

type Internal = T::Internal

type Output = T::Output

impl<'a, T> Forward for &'a mut T where
    T: Forward
[src]

type Input = T::Input

type Internal = T::Internal

type Output = T::Output

impl<T, U> Forward for Chain<T, U> where
    T: Forward,
    U: Forward<Input = T::Output>, 
[src]

type Input = T::Input

type Internal = (T::Internal, T::Output, U::Internal)

type Output = U::Output

Loading content...