pub struct DenseLayer<const IN: usize, const OUT: usize> { /* private fields */ }Implementations§
Source§impl<const IN: usize, const OUT: usize> DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> DenseLayer<IN, OUT>
pub fn init() -> Self
pub fn seeded(seed: u64) -> Self
pub fn with_initializer<I: Initializer>(initializer: I) -> Self
pub fn with_initializer_and_seed<I: Initializer>( initializer: I, seed: u64, ) -> Self
pub fn with_initializer_and_rng<I: Initializer, R: Rng + ?Sized>( initializer: I, rng: &mut R, ) -> Self
pub fn forward(&self, input: &[Float; IN], output: &mut [Float; OUT])
pub fn backward( &mut self, input: &[Float; IN], _output: &[Float; OUT], output_grad: &[Float; OUT], input_grad: &mut [Float; IN], )
Trait Implementations§
Source§impl<const IN: usize, const OUT: usize> Layer<IN, OUT> for DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> Layer<IN, OUT> for DenseLayer<IN, OUT>
fn forward(&self, input: &[Float; IN], output: &mut [Float; OUT])
fn backward( &mut self, input: &[Float; IN], output: &[Float; OUT], output_grad: &[Float; OUT], input_grad: &mut [Float; IN], )
fn zero_grad(&mut self)
fn apply_gradients( &mut self, optimizer: &mut dyn Optimizer, slot: &mut usize, scale: Float, )
Auto Trait Implementations§
impl<const IN: usize, const OUT: usize> Freeze for DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> RefUnwindSafe for DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> Send for DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> Sync for DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> Unpin for DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> UnsafeUnpin for DenseLayer<IN, OUT>
impl<const IN: usize, const OUT: usize> UnwindSafe for DenseLayer<IN, OUT>
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