[][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

Methods

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<Vec<f32>>,
    targets: &Vec<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<Vec<f32>>,
    net_targets: &Vec<Vec<f32>>,
    rate: f32,
    loss_fn: &Loss
) -> f32
[src]

backpropagate the network, will move throgh 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 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]

iplement 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 Send for Neat[src]

These must be implemneted for the network or any type to be used within seperate threads. Because implementing the functions themselves is dangerious and unsafe and i'm not smart enough to do that from scratch, these "implmenetaions" will get rid of the error and realistically they don't need to be implemneted for the program to work

impl Serialize for Neat[src]

impl Sync for Neat[src]

Auto Trait Implementations

impl !RefUnwindSafe for Neat

impl Unpin for Neat

impl !UnwindSafe for Neat

Blanket Implementations

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

impl<T> Any for T where
    T: Any + Serialize + Deserialize
[src]

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

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

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

impl<T> Type for T[src]

type Meta = Concrete

Type of metadata for type.

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