Trait DeepNeuralNetwork

Source
pub trait DeepNeuralNetwork<S, T>: Forward<S, Output = T> {
    type Input: Forward<S, Output = T>;
    type Hidden: Forward<T, Output = T>;
    type Out: Forward<T, Output = T>;

    const HIDDEN: Option<usize> = None;

    // Required methods
    fn input(&self) -> &Self::Input;
    fn hidden(&self) -> &[Self::Hidden];
    fn output(&self) -> &Self::Out;

    // Provided methods
    fn nlayers(&self) -> usize { ... }
    fn nhidden(&self) -> usize { ... }
}
Expand description

This trait describes any neural networks or models that adhears to the deep netural network architecture. This design considers a single input and output layer, while allowing for any number of hidden layers to be persisted.

The HIDDEN constant is used to specify the number of hidden layers and is used to compute the total number of layers (HIDDEN + 2)

Provided Associated Constants§

Source

const HIDDEN: Option<usize> = None

Required Associated Types§

Source

type Input: Forward<S, Output = T>

Source

type Hidden: Forward<T, Output = T>

Source

type Out: Forward<T, Output = T>

Required Methods§

Source

fn input(&self) -> &Self::Input

Source

fn hidden(&self) -> &[Self::Hidden]

Source

fn output(&self) -> &Self::Out

Provided Methods§

Source

fn nlayers(&self) -> usize

Source

fn nhidden(&self) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§