Struct juggernaut::nn::NeuralNetwork [] [src]

pub struct NeuralNetwork { /* fields omitted */ }

Represents a Neural Network with layers, inputs and outputs

Methods

impl NeuralNetwork
[src]

[src]

[src]

To set shuffle data flag Enabling this option shuffles data before each iteration

[src]

To set a cost function for the network

[src]

To add a callback function and receive the errors of the network during training process Please note that there is another function that basically calcualtes the error value

[src]

To add a callback function to get called after each epoch

[src]

To add a new layer to the network

Example:

use juggernaut::sample::Sample;
use juggernaut::nl::NeuralLayer;
use juggernaut::nn::NeuralNetwork;
use juggernaut::activation::Activation;
use juggernaut::activation::Sigmoid;

let mut test = NeuralNetwork::new();

// 1st layer = 4 neurons - 2 inputs
let nl1 = NeuralLayer::new(4, 2, Sigmoid::new());

test.add_layer(nl1);

[src]

To get the layers of the network

[src]

This is the forward method of the network which calculates the random weights and multiplies the inputs of given samples to the weights matrix. Thinks.

[src]

Use this function to evaluate a trained neural network

This function simply passes the given sample to the forward function and returns the output of last layer

[src]

To train the network. It calls the forward pass and updates the weights using backpropagation