pub struct NN { /* private fields */ }
Expand description
Neural network
Implementations§
Source§impl NN
impl NN
Sourcepub fn new(layers_sizes: &[u32]) -> NN
pub fn new(layers_sizes: &[u32]) -> NN
Each number in the layers_sizes
parameter specifies a
layer in the network. The number itself is the number of nodes in that
layer. The first number is the input layer, the last
number is the output layer, and all numbers between the first and
last are hidden layers. There must be at least two layers in the network.
Sourcepub fn run(&self, inputs: &[f64]) -> Vec<f64>
pub fn run(&self, inputs: &[f64]) -> Vec<f64>
Runs the network on an input and returns a vector of the results.
The number of f64
s in the input must be the same
as the number of input nodes in the network. The length of the results
vector will be the number of nodes in the output layer of the network.
Sourcepub fn train<'b>(
&'b mut self,
examples: &'b [(Vec<f64>, Vec<f64>)],
) -> Trainer<'_, '_>
pub fn train<'b>( &'b mut self, examples: &'b [(Vec<f64>, Vec<f64>)], ) -> Trainer<'_, '_>
Takes in vector of examples and returns a Trainer
struct that is used
to specify options that dictate how the training should proceed.
No actual training will occur until the go()
method on the
Trainer
struct is called.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NN
impl RefUnwindSafe for NN
impl Send for NN
impl Sync for NN
impl Unpin for NN
impl UnwindSafe for NN
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)