[−][src]Struct radiate::models::neat::neat::Neat
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: u32
batch_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]
&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,
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]
&mut self,
net_outs: &Vec<Vec<f32>>,
net_targets: &Vec<Vec<f32>>,
rate: f32,
loss_fn: &Loss
) -> 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
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Neat
[src]
impl<'de> Deserialize<'de> for Neat
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Genome<Neat, NeatEnvironment> for Neat
[src]
iplement genome for a neat network
fn crossover(
one: &Neat,
two: &Neat,
env: &Arc<RwLock<NeatEnvironment>>,
crossover_rate: f32
) -> Option<Neat>
[src]
one: &Neat,
two: &Neat,
env: &Arc<RwLock<NeatEnvironment>>,
crossover_rate: f32
) -> Option<Neat>
fn base(env: &mut NeatEnvironment) -> Neat
[src]
fn distance(one: &Neat, two: &Neat, env: &Arc<RwLock<NeatEnvironment>>) -> f32
[src]
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]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Sync for Neat
[src]
Auto Trait Implementations
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: 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<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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.
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>,