[][src]Struct radiate::models::neat::neat::Neat

pub struct Neat {
    pub layers: Vec<LayerWrap>,
    pub input_size: u32,
    pub batch_size: usize,
}

Neat is a neural network consisting of layers the layers can be stacked together then the feed forward and backprop functions will take care of 'connecting them'

Fields

layers: Vec<LayerWrap>input_size: u32batch_size: usize

Implementations

impl Neat[src]

pub fn new() -> Self[src]

pub fn input_size(self, input_size: u32) -> Self[src]

set the input size for the network

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

set the batch size for the network

pub fn reset(&mut self)[src]

reset the layers on the network

pub fn train<F>(
    &mut self,
    inputs: &[Vec<f32>],
    targets: &[Vec<f32>],
    rate: f32,
    loss_fn: Loss,
    run: F
) -> Result<(), Box<dyn Error>> where
    F: Fn(usize, f32) -> bool
[src]

train the network

pub fn backward(
    &mut self,
    net_outs: &[Vec<f32>],
    net_targets: &[Vec<f32>],
    rate: f32,
    loss_fn: &Loss
) -> f32
[src]

backpropagate the network, will move through time if needed

pub fn forward(&mut self, data: &Vec<f32>) -> Option<Vec<f32>>[src]

feed forward a vec of data through the neat network

pub fn dense_pool(self, size: u32, activation: Activation) -> Self[src]

create and append a new dense pool layer onto the neat network

pub fn dense(self, size: u32, activation: Activation) -> Self[src]

create an append a simple dense layer onto the network

pub fn lstm(self, size: u32, output_size: u32, act: Activation) -> Self[src]

create a new lstm layer and add it to the network

pub fn gru(self, size: u32, output_size: u32, act: Activation) -> Self[src]

pub fn save(&self, file_path: &str) -> Result<(), Box<dyn Error>>[src]

dumy model saver file to export the model to json

pub fn load(file_path: &str) -> Result<Neat, Box<dyn Error>>[src]

load in a saved neat model from a file path

Trait Implementations

impl Clone for Neat[src]

Implement clone for the neat neural network in order to facilitate proper crossover and mutation for the network

impl Debug for Neat[src]

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

impl Genome<Neat, NeatEnvironment> for Neat[src]

implement genome for a neat network

impl PartialEq<Neat> for Neat[src]

Implement partialeq for neat because if neat itself is to be used as a problem, it must be able to compare one to another

impl Serialize for Neat[src]

Auto Trait Implementations

impl !RefUnwindSafe for Neat

impl Send for Neat

impl Sync for Neat

impl Unpin for Neat

impl !UnwindSafe for Neat

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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

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

type Owned = T

The resulting type after obtaining ownership.

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