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

pub struct Neat {
    pub layers: Vec<LayerWrap>,
    pub input_size: u32,
    pub optimizer: Optimizer,

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'


layers: Vec<LayerWrap>input_size: u32optimizer: Optimizer


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 optimizer(self, opt: Optimizer) -> Self[src]

add an optimizer to the network

pub fn reset(&mut self)[src]

reset the layers on the network

pub fn train(
    &mut self,
    inputs: &Vec<Vec<f32>>,
    targets: &Vec<Vec<f32>>,
    iters: usize,
    rate: f32,
    update_window: usize
) -> Result<(), Box<dyn Error>>

train the network

pub fn backward(
    &mut self,
    net_outs: &Vec<Vec<f32>>,
    net_targets: &Vec<Vec<f32>>,
    rate: f32

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

impl<T> Any for T where
    T: Any + Serialize + Deserialize

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T> Deserialize for T where
    T: DeserializeOwned

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized

impl<T> Serialize for T where
    T: Serialize + ?Sized

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> Type for T[src]

type Meta = Concrete

Type of metadata for type.

impl<T> Type for T where
    T: ?Sized

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