[−][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
Implementations
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<f32>],
targets: &[Vec<f32>],
rate: f32,
loss_fn: Loss,
run: F
) -> Result<(), Box<dyn Error>> where
F: Fn(usize, f32) -> bool,
[src]
&mut self,
inputs: &[Vec<f32>],
targets: &[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<f32>],
net_targets: &[Vec<f32>],
rate: f32,
loss_fn: &Loss
) -> f32
[src]
&mut self,
net_outs: &[Vec<f32>],
net_targets: &[Vec<f32>],
rate: f32,
loss_fn: &Loss
) -> f32
backpropagate the network, will move through 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 gru(self, size: u32, output_size: u32, act: Activation) -> Self
[src]
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]
implement 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 Serialize for Neat
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Neat
impl Send for Neat
impl Sync for Neat
impl Unpin for Neat
impl !UnwindSafe for Neat
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<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, 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>,