[][src]Struct think_cap::NN

pub struct NN { /* fields omitted */ }

Neural network

Methods

impl NN
[src]

pub fn new(layers_sizes: &[u32]) -> NN
[src]

Each number in the layers_sizes parameter specifies a layer in the network. The number itself is the number of nodes in that layer. The first number is the input layer, the last number is the output layer, and all numbers between the first and last are hidden layers. There must be at least two layers in the network.

pub fn run(&self, inputs: &[f64]) -> Vec<f64>
[src]

Runs the network on an input and returns a vector of the results. The number of f64s in the input must be the same as the number of input nodes in the network. The length of the results vector will be the number of nodes in the output layer of the network.

pub fn train<'b>(&'b mut self, examples: &'b [(Vec<f64>, Vec<f64>)]) -> Trainer
[src]

Takes in vector of examples and returns a Trainer struct that is used to specify options that dictate how the training should proceed. No actual training will occur until the go() method on the Trainer struct is called.

pub fn to_json(&self) -> String
[src]

Encodes the network as a JSON string.

pub fn from_json(encoded: &str) -> NN
[src]

Builds a new network from a JSON string.

Trait Implementations

impl Clone for NN
[src]

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

Performs copy-assignment from source. Read more

impl Debug for NN
[src]

impl Encodable for NN
[src]

impl Decodable for NN
[src]

Auto Trait Implementations

impl Send for NN

impl Sync for NN

Blanket Implementations

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

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

type Owned = T

impl<T> From for T
[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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