Struct zenu_layer::layers::linear::Linear
source · pub struct Linear<T: Num> { /* private fields */ }Expand description
A linear layer in a neural network.
Implementations§
Trait Implementations§
source§impl<T: Num> Layer<T> for Linear<T>
impl<T: Num> Layer<T> for Linear<T>
source§fn init_parameters(&mut self, seed: Option<u64>)where
StandardNormal: Distribution<T>,
fn init_parameters(&mut self, seed: Option<u64>)where
StandardNormal: Distribution<T>,
Initializes the layer parameters (weight and bias) randomly or with a specified seed.
§Arguments
seed- An optional seed value for reproducible parameter initialization.
source§fn parameters(&self) -> Vec<Variable<T>>
fn parameters(&self) -> Vec<Variable<T>>
Returns a vector of the layer parameters as Variables.
§Returns
A vector containing the weight and bias variables of the layer.
source§fn load_parameters(&mut self, parameters: &[Variable<T>])
fn load_parameters(&mut self, parameters: &[Variable<T>])
source§fn shape_check(&self, input: &Variable<T>)
fn shape_check(&self, input: &Variable<T>)
fn clear_gradients(&self)
Auto Trait Implementations§
impl<T> Freeze for Linear<T>
impl<T> !RefUnwindSafe for Linear<T>
impl<T> !Send for Linear<T>
impl<T> !Sync for Linear<T>
impl<T> Unpin for Linear<T>
impl<T> !UnwindSafe for Linear<T>
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