pub struct TrainableNeuron { /* private fields */ }Expand description
Trainable neural network
Implementations§
Source§impl TrainableNeuron
impl TrainableNeuron
pub fn new(layer_sizes: Vec<usize>) -> Self
pub fn forward(&mut self, x: f32) -> f32
pub fn backward(&mut self, target: f32) -> f32
pub fn zero_grad(&mut self)
pub fn update_parameters(&mut self, learning_rate: f32)
pub fn parameters(&self) -> &ParameterStore
pub fn parameters_mut(&mut self) -> &mut ParameterStore
Sourcepub fn save_to_file(&self, path: &Path) -> Result<(), Box<dyn Error>>
pub fn save_to_file(&self, path: &Path) -> Result<(), Box<dyn Error>>
Save neural network weights to file
Auto Trait Implementations§
impl Freeze for TrainableNeuron
impl RefUnwindSafe for TrainableNeuron
impl Send for TrainableNeuron
impl Sync for TrainableNeuron
impl Unpin for TrainableNeuron
impl UnwindSafe for TrainableNeuron
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