[][src]Struct radiate::models::neat::layers::lstm::LSTM

pub struct LSTM {
    pub input_size: u32,
    pub memory_size: u32,
    pub output_size: u32,
    pub activation: Activation,
    pub memory: Vec<f32>,
    pub hidden: Vec<f32>,
    pub states: LSTMState,
    pub g_gate: Dense,
    pub i_gate: Dense,
    pub f_gate: Dense,
    pub o_gate: Dense,
    pub v_gate: Dense,
}

LSTM is a long-short term memory cell represented by a collection of Dense layers and two distinct memory vectors which get updated and travel 'through time'

Fields

input_size: u32memory_size: u32output_size: u32activation: Activationmemory: Vec<f32>hidden: Vec<f32>states: LSTMStateg_gate: Densei_gate: Densef_gate: Denseo_gate: Densev_gate: Dense

Methods

impl LSTM[src]

pub fn new(
    input_size: u32,
    memory_size: u32,
    output_size: u32,
    activation: Activation
) -> Self
[src]

pub fn step_back(&mut self, errors: &Vec<f32>, l_rate: f32) -> Option<Vec<f32>>[src]

Preform one step backwards for the layer. Set the tracer historical meta data to look at the current index, and use that data to compute the gradient steps for eachweight in each gated network. If update is true, the gates will take the accumulated gradient steps, and add them to their respecive weight values

Trait Implementations

impl Clone for LSTM[src]

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

impl Debug for LSTM[src]

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

impl Display for LSTM[src]

implement display for the LSTM layer of the network

impl Genome<LSTM, NeatEnvironment> for LSTM where
    LSTM: Layer
[src]

in order for the lstm layer to be evolved along with the rest of the network, Genome must be implemented so that the layer can be crossed over and measured along with other lstm layers

fn crossover(
    child: &LSTM,
    parent_two: &LSTM,
    env: &Arc<RwLock<NeatEnvironment>>,
    crossover_rate: f32
) -> Option<LSTM>
[src]

implement how to crossover two LSTM layers

fn distance(one: &LSTM, two: &LSTM, env: &Arc<RwLock<NeatEnvironment>>) -> f32[src]

get the distance between two LSTM layers of the network

impl Layer for LSTM[src]

fn backward(
    &mut self,
    errors: &Vec<f32>,
    learning_rate: f32
) -> Option<Vec<f32>>
[src]

apply backpropagation through time

fn reset(&mut self)[src]

reset the lstm network by clearing the tracer and the states as well as the memory and hidden state

fn add_tracer(&mut self)[src]

add tracers to all the gates in the layer

fn remove_tracer(&mut self)[src]

remove the tracers from all the gates in the layer

impl Send for LSTM[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 LSTM[src]

impl Sync for LSTM[src]

Auto Trait Implementations

impl RefUnwindSafe for LSTM

impl Unpin for LSTM

impl UnwindSafe for LSTM

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> Display for T where
    T: Display + Serialize + Deserialize + ?Sized
[src]

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

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

impl<L> LayerClone for L where
    L: 'static + Layer + Clone
[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> ToString for T where
    T: Display + ?Sized
[src]

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

type Meta = Concrete

Type of metadata for type.

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

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