pub enum InitStrategy {
Zeros,
Ones,
Constant(f64),
Xavier(InitDistribution),
He(FanMode, InitDistribution),
Kaiming(FanMode, InitDistribution),
LeCun(InitDistribution),
Orthogonal(f64),
Sparse(f64),
TruncatedNormal {
mean: f64,
std: f64,
a: f64,
b: f64,
},
}Expand description
Weight initialization strategy
Variants§
Zeros
All weights set to zero
Ones
All weights set to one
Constant(f64)
All weights set to a constant value
Xavier(InitDistribution)
Xavier/Glorot initialization: Var = 2/(fan_in + fan_out)
He(FanMode, InitDistribution)
He initialization: Var = 2/fan
Kaiming(FanMode, InitDistribution)
Kaiming initialization (alias for He)
LeCun(InitDistribution)
LeCun initialization: Var = 1/fan_in
Orthogonal(f64)
Orthogonal initialization with gain
Sparse(f64)
Sparse initialization with sparsity ratio (fraction of zeros)
TruncatedNormal
Truncated normal distribution clamped to [a, b]
Trait Implementations§
Source§impl Clone for InitStrategy
impl Clone for InitStrategy
Source§fn clone(&self) -> InitStrategy
fn clone(&self) -> InitStrategy
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 InitStrategy
impl Debug for InitStrategy
Source§impl PartialEq for InitStrategy
impl PartialEq for InitStrategy
Source§fn eq(&self, other: &InitStrategy) -> bool
fn eq(&self, other: &InitStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for InitStrategy
Auto Trait Implementations§
impl Freeze for InitStrategy
impl RefUnwindSafe for InitStrategy
impl Send for InitStrategy
impl Sync for InitStrategy
impl Unpin for InitStrategy
impl UnsafeUnpin for InitStrategy
impl UnwindSafe for InitStrategy
Blanket Implementations§
impl<T> Allocation for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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