pub struct OptimizerConfig<A: Float> {
pub lr: A,
pub weight_decay: A,
pub grad_clip: Option<A>,
pub params: HashMap<String, A>,
}
Expand description
Unified optimizer configuration
Fields§
§lr: A
Learning rate
weight_decay: A
Weight decay (L2 regularization)
grad_clip: Option<A>
Gradient clipping value (optional)
params: HashMap<String, A>
Additional optimizer-specific parameters
Implementations§
Source§impl<A: Float> OptimizerConfig<A>
impl<A: Float> OptimizerConfig<A>
Sourcepub fn weight_decay(self, weight_decay: A) -> Self
pub fn weight_decay(self, weight_decay: A) -> Self
Set weight decay
Trait Implementations§
Source§impl<A: Clone + Float> Clone for OptimizerConfig<A>
impl<A: Clone + Float> Clone for OptimizerConfig<A>
Source§fn clone(&self) -> OptimizerConfig<A>
fn clone(&self) -> OptimizerConfig<A>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<A> Freeze for OptimizerConfig<A>where
A: Freeze,
impl<A> RefUnwindSafe for OptimizerConfig<A>where
A: RefUnwindSafe,
impl<A> Send for OptimizerConfig<A>where
A: Send,
impl<A> Sync for OptimizerConfig<A>where
A: Sync,
impl<A> Unpin for OptimizerConfig<A>where
A: Unpin,
impl<A> UnwindSafe for OptimizerConfig<A>where
A: UnwindSafe,
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
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