[][src]Struct maver::NeuralNetwork

pub struct NeuralNetwork {
    pub layers: Vec<Vec<Perceptron>>,
    // some fields omitted
}

Fields

layers: Vec<Vec<Perceptron>>

Methods

impl NeuralNetwork[src]

pub fn new(
    layer_sizes: Vec<usize>,
    activation: Activation,
    output_act: Activation
) -> NeuralNetwork
[src]

Create new neural network layer_sizes: neural network layout. activation: activation function for hidden perceptrons output_act: activation function for output perceptrons

pub fn forward_prop(&mut self, row: &[f64]) -> Vec<f64>[src]

Get neural network output

pub fn forward_set(&mut self, row: &Vec<f64>) -> Vec<f64>[src]

Set & get neural network output (used for backpropagation)

pub fn train(
    &mut self,
    epochs: usize,
    shuffle: bool,
    data: Vec<(Vec<f64>, Vec<f64>)>,
    lrate: Option<f64>
)
[src]

Train neural network epochs: how many times we will iterate shuffle: shuffle train data data: vector of training data: Vec<(input,expected output)> lrate: learning rate if none = 0.1

pub fn backpropagate(
    &mut self,
    input: &Vec<f64>,
    expected: &Vec<f64>,
    lrate: Option<f64>
)
[src]

Backpropagation algorithm implementation input: input data expected: expected output lrate: learning rate if none = 0.1

pub fn save_to_file(&self, file_path: &str) -> Result<()>[src]

Trait Implementations

impl Clone for NeuralNetwork[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for NeuralNetwork[src]

impl Serialize for NeuralNetwork[src]

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

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,