[−][src]Struct slow_nn::Network
Examples
let mut net = network::Network::dense(bias, num_inputs, num_outputs, &num_hiddens); let pred = net.predict(&input, activation);
Methods
impl Network
[src]
pub fn from_conns(
bias: f64,
inputs: usize,
outputs: usize,
hidden: usize,
conns: &[Connection]
) -> Self
[src]
bias: f64,
inputs: usize,
outputs: usize,
hidden: usize,
conns: &[Connection]
) -> Self
Creates a network from a slice of Connections
pub fn dense(bias: f64, inputs: usize, outputs: usize, layers: &[usize]) -> Self
[src]
Creates a fully connected network with random weights
pub fn predict(&self, input: &[f64], activation: fn(_: f64) -> f64) -> Vec<f64>
[src]
Does a forward pass
pub fn train(
&mut self,
input: &[f64],
expected: &[f64],
activation: fn(_: f64) -> f64,
deactivation: fn(_: f64) -> f64,
loss: fn(_: f64, _: f64) -> f64,
dloss: fn(_: f64, _: f64) -> f64,
lr: f64
) -> f64
[src]
&mut self,
input: &[f64],
expected: &[f64],
activation: fn(_: f64) -> f64,
deactivation: fn(_: f64) -> f64,
loss: fn(_: f64, _: f64) -> f64,
dloss: fn(_: f64, _: f64) -> f64,
lr: f64
) -> f64
Does both forward and backward pass and updates the weights
Auto Trait Implementations
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnwindSafe for Network
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,