pub struct NeuralNetwork { /* private fields */ }Expand description
Simple feedforward neural network
Implementations§
Source§impl NeuralNetwork
impl NeuralNetwork
Sourcepub fn new(layer_sizes: &[usize], learning_rate: f64) -> Self
pub fn new(layer_sizes: &[usize], learning_rate: f64) -> Self
Create a new neural network with specified layer sizes
Sourcepub fn train(&self, inputs: &[f64], targets: &[f64]) -> f64
pub fn train(&self, inputs: &[f64], targets: &[f64]) -> f64
Train the network with a single sample (online learning)
Sourcepub fn stats(&self) -> NetworkStats
pub fn stats(&self) -> NetworkStats
Get network statistics
Trait Implementations§
Source§impl Clone for NeuralNetwork
impl Clone for NeuralNetwork
Source§fn clone(&self) -> NeuralNetwork
fn clone(&self) -> NeuralNetwork
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NeuralNetwork
impl RefUnwindSafe for NeuralNetwork
impl Send for NeuralNetwork
impl Sync for NeuralNetwork
impl Unpin for NeuralNetwork
impl UnwindSafe for NeuralNetwork
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)