[][src]Struct slow_nn::Network

pub struct Network { /* fields omitted */ }

Examples

let mut net = network::Network::dense(bias, num_inputs, num_outputs, &num_hiddens);
let pred = net.predict(&input, activation);

Methods

impl Network[src]

pub fn from_conns(
    bias: f64,
    inputs: usize,
    outputs: usize,
    hidden: usize,
    conns: &[Connection]
) -> Self
[src]

Creates a network from a slice of Connections

pub fn dense(bias: f64, inputs: usize, outputs: usize, layers: &[usize]) -> Self[src]

Creates a fully connected network with random weights

pub fn predict(&self, input: &[f64], activation: fn(_: f64) -> f64) -> Vec<f64>[src]

Does a forward pass

pub fn train(
    &mut self,
    input: &[f64],
    expected: &[f64],
    activation: fn(_: f64) -> f64,
    deactivation: fn(_: f64) -> f64,
    loss: fn(_: f64, _: f64) -> f64,
    dloss: fn(_: f64, _: f64) -> f64,
    lr: f64
) -> f64
[src]

Does both forward and backward pass and updates the weights

Auto Trait Implementations

impl RefUnwindSafe for Network

impl Send for Network

impl Sync for Network

impl Unpin for Network

impl UnwindSafe for Network

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,