pub struct NeuralNetwork<T>{ /* private fields */ }
Implementations§
Source§impl<T> NeuralNetwork<T>
impl<T> NeuralNetwork<T>
Sourcepub unsafe fn new(topology: &Topology<T>) -> NeuralNetwork<T>
pub unsafe fn new(topology: &Topology<T>) -> NeuralNetwork<T>
Instantiates a new Neural Network from a Topology
§Safety
If the Topology is ill-formed, it will result in pointer overflow. Topologies generated by this crate are guaranteed to be safe.
Sourcepub fn compute(&mut self, inputs: &[T]) -> Vec<T>
pub fn compute(&mut self, inputs: &[T]) -> Vec<T>
Computes the Neural Network based on the inputs and returns the output into a Vec
Sourcepub unsafe fn compute_buffer(&mut self, inputs: &[T], output_buffer: &mut [T])
pub unsafe fn compute_buffer(&mut self, inputs: &[T], output_buffer: &mut [T])
Computes the output into a buffer to prevent allocation
§Safety
The output buffer must be of the same size as the output layer
pub fn reset_state(&mut self)
pub fn from_string(serialized: &str) -> NeuralNetwork<T>
Trait Implementations§
Source§impl<T> Clone for NeuralNetwork<T>
impl<T> Clone for NeuralNetwork<T>
Source§fn clone(&self) -> NeuralNetwork<T>
fn clone(&self) -> NeuralNetwork<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Debug for NeuralNetwork<T>
impl<T> Debug for NeuralNetwork<T>
Source§impl<T> PartialEq for NeuralNetwork<T>
impl<T> PartialEq for NeuralNetwork<T>
impl<T> Send for NeuralNetwork<T>
impl<T> Sync for NeuralNetwork<T>
Auto Trait Implementations§
impl<T> Freeze for NeuralNetwork<T>
impl<T> RefUnwindSafe for NeuralNetwork<T>where
T: RefUnwindSafe,
impl<T> Unpin for NeuralNetwork<T>where
T: Unpin,
impl<T> UnwindSafe for NeuralNetwork<T>where
T: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more