[−][src]Struct radiate::models::neat::layers::lstm::LSTM
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: u32
memory_size: u32
output_size: u32
activation: Activation
memory: Vec<f32>
states: LSTMState
g_gate: Arc<RwLock<Dense>>
i_gate: Arc<RwLock<Dense>>
f_gate: Arc<RwLock<Dense>>
o_gate: Arc<RwLock<Dense>>
v_gate: Arc<RwLock<Dense>>
Implementations
impl LSTM
[src]
pub fn new(
input_size: u32,
memory_size: u32,
output_size: u32,
activation: Activation
) -> Self
[src]
input_size: u32,
memory_size: u32,
output_size: u32,
activation: Activation
) -> Self
pub fn step_forward_async(&mut self, inputs: &[f32]) -> Option<Vec<f32>>
[src]
Feed forward with each forward propagation being executed in a separate thread to speed up the forward pass if the network is NOT being evolved. If it is, there are already so many threads working to optimize the entire population that extra threading is unnecessary and might actually slow it down
pub fn step_forward(&mut self, inputs: &[f32]) -> Option<Vec<f32>>
[src]
step forward synchronously
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 each weight in each gated network. If update is true, the gates will take the accumulated gradient steps, and add them to their respective 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 (*self.environment.read().unwrap()).clone();
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for LSTM
[src]
impl<'de> Deserialize<'de> for LSTM
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for LSTM
[src]
implement display for the LSTM layer of the network
impl Genome<LSTM, NeatEnvironment> for LSTM where
LSTM: Layer,
[src]
LSTM: Layer,
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]
child: &LSTM,
parent_two: &LSTM,
env: Arc<RwLock<NeatEnvironment>>,
crossover_rate: f32
) -> Option<LSTM>
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
fn base(_: &mut E) -> T where
T: Sized,
[src]
T: Sized,
impl Layer for LSTM
[src]
fn forward(&mut self, inputs: &Vec<f32>) -> Option<Vec<f32>>
[src]
forward propagate inputs, if the model is being evolved don't spawn extra threads because it slows down the process by about double the original time. If the model is being trained traditionally, step forward asynchronously by spawning a thread for each individual gate which results in speeds about double as a synchronous thread.
fn backward(
&mut self,
errors: &Vec<f32>,
learning_rate: f32
) -> Option<Vec<f32>>
[src]
&mut self,
errors: &Vec<f32>,
learning_rate: f32
) -> Option<Vec<f32>>
apply backpropagation through time asynchronously because this is not done during evolution
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 gate.write().unwrap()s in the layer
fn remove_tracer(&mut self)
[src]
remove the tracers from all the gate.write().unwrap()s in the layer
fn as_ref_any(&self) -> &dyn Any where
Self: Sized + 'static,
[src]
Self: Sized + 'static,
fn as_mut_any(&mut self) -> &mut dyn Any where
Self: Sized + 'static,
[src]
Self: Sized + 'static,
fn shape(&self) -> (usize, usize)
[src]
impl Serialize for LSTM
[src]
Auto Trait Implementations
impl RefUnwindSafe for LSTM
impl Send for LSTM
impl Sync for LSTM
impl Unpin for LSTM
impl UnwindSafe for LSTM
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<L> LayerClone for L where
L: 'static + Layer + Clone,
[src]
L: 'static + Layer + Clone,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,