pub struct Layer {
pub weights: Vec<Vec<f64>>,
pub biases: Vec<f64>,
pub activation: Activation,
}Fields§
§weights: Vec<Vec<f64>>§biases: Vec<f64>§activation: ActivationImplementations§
Source§impl Layer
impl Layer
pub fn new(n_in: usize, n_out: usize, activation: Activation) -> Self
pub fn from_weights( weights: Vec<Vec<f64>>, biases: Vec<f64>, activation: Activation, ) -> Self
pub fn forward(&self, input: &[f64]) -> Vec<f64>
pub fn forward_with_cache(&self, input: &[f64]) -> (Vec<f64>, Vec<f64>)
pub fn n_params(&self) -> usize
pub fn n_inputs(&self) -> usize
pub fn n_outputs(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Layer
impl RefUnwindSafe for Layer
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnsafeUnpin for Layer
impl UnwindSafe for Layer
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