[][src]Struct tsuga::fc_network::FullyConnectedNetwork

pub struct FullyConnectedNetwork {
    pub w: Vec<Array2<f32>>,
    // some fields omitted
}

A fully-connected neural network

Fields

w: Vec<Array2<f32>>

Implementations

impl FullyConnectedNetwork[src]

pub fn print_shape(&self)[src]

Prints the primary shape parameters of the fully-connected network. This is useful for debugging

pub fn learnrate(self, learnrate: f32) -> Self[src]

A hyperparameter of defining the learning rate of the network

pub fn iterations(self, iterations: usize) -> Self[src]

A hyperparameter number of training iterations for the network (this combined with the batch_size parameter can be used to set a particular number of epochs, in which every training record is seen a certain number of times)

pub fn min_iterations(self, min_iterations: usize) -> Self[src]

A hyperparameter setting the minimum number of iterations the network must train for before returning (can be used to override the error threshold)

pub fn error_threshold(self, error_threshold: f32) -> Self[src]

A hyperparameter that will exit the

pub fn batch_size(self, batch_size: usize) -> Self[src]

A hyperparameter defining the size of the training batches (can be used with iterations to define the number of epochs)

pub fn validation_pct(self, validation_pct: f32) -> Self[src]

A hyperparameter defining the percentage of the training data to hold back as a validation set

pub fn build(self) -> FullyConnectedNetwork[src]

Returns a struct with the completed network architecture

pub fn default(input: Array2<f32>, output: Array2<f32>) -> Self[src]

Builds a basic two-layer network, with the default values for all hyperparameters

pub fn add_layers(self, layers_cfg: Vec<FCLayer>) -> Self[src]

Takes a Vec configuration and modifies the network architecture to include properly-sized layers with activiation functions

pub fn train(&mut self) -> Result<(), Box<dyn Error>>[src]

Begins the training process of the network, using the hyperparameters defined during the network's construction and supplied layer configuration data. A progress-bar and error data is printed to the command-line during this process, and can be exited at any time by pressing q or Esc.

pub fn evaluate(self, input: Array2<f32>) -> Array2<f32>[src]

Evaluates the network by running a forward pass on a supplied input using the (trained) network weights

Trait Implementations

impl Clone for FullyConnectedNetwork[src]

impl Debug for FullyConnectedNetwork[src]

Auto Trait Implementations

Blanket Implementations

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

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme, 

type Err = NoError

The error type produced by a failed conversion.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme, 

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

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

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

impl<T, Dst> ConvAsUtil<Dst> for T

impl<T> ConvUtil for T

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

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

impl<T> SetParameter for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<Src> TryFrom<Src> for Src

type Err = NoError

The error type produced by a failed conversion.

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<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.

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>, 

impl<Src> ValueFrom<Src> for Src

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.