pub struct Model<'a> {
pub act_mode: &'a Act,
pub training_data_set: &'a [(Vec<f64>, Vec<f64>)],
pub layers: Vec<Layer>,
}
Fields§
§act_mode: &'a Act
§training_data_set: &'a [(Vec<f64>, Vec<f64>)]
§layers: Vec<Layer>
Implementations§
Source§impl<'a> Model<'a>
impl<'a> Model<'a>
pub fn apply_diff(&mut self, gradient: &Self, learning_rate: f64)
pub fn build( act_mode: &'a Act, training_data_set: &'a [(Vec<f64>, Vec<f64>)], n_neuron_per_layer: &[usize], ) -> Self
pub fn build_with_zeros( act_mode: &'a Act, training_data_set: &'a [(Vec<f64>, Vec<f64>)], n_neuron_per_layer: &[usize], ) -> Self
pub fn cost(&self) -> f64
pub fn finite_diff(&mut self, eps: f64) -> Self
pub fn forward(&self, inputs: &[f64]) -> Vec<f64>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Model<'a>
impl<'a> RefUnwindSafe for Model<'a>
impl<'a> Send for Model<'a>
impl<'a> Sync for Model<'a>
impl<'a> Unpin for Model<'a>
impl<'a> UnwindSafe for Model<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more