pub enum WeightInit {
Zero,
Random,
Xavier,
He,
Uniform {
low: f64,
high: f64,
},
Normal {
mean: f64,
std: f64,
},
}Expand description
Weight initialization strategies
Variants§
Zero
Initialize all weights to zero (not recommended for most layers)
Random
Uniform random initialization in (-1, 1) without any scaling
Xavier
Xavier/Glorot initialization: scales by sqrt(2 / (fan_in + fan_out))
He
He/Kaiming initialization: scales by sqrt(2 / fan_in), suited for ReLU activations
Uniform
Uniform distribution over [low, high)
Fields
Normal
Gaussian distribution with specified mean and standard deviation
Trait Implementations§
Source§impl Clone for WeightInit
impl Clone for WeightInit
Source§fn clone(&self) -> WeightInit
fn clone(&self) -> WeightInit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeightInit
impl Debug for WeightInit
Source§impl PartialEq for WeightInit
impl PartialEq for WeightInit
impl StructuralPartialEq for WeightInit
Auto Trait Implementations§
impl Freeze for WeightInit
impl RefUnwindSafe for WeightInit
impl Send for WeightInit
impl Sync for WeightInit
impl Unpin for WeightInit
impl UnsafeUnpin for WeightInit
impl UnwindSafe for WeightInit
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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