pub struct UnifiedAdam<A: Float> { /* private fields */ }Expand description
Adam optimizer with unified API
Implementations§
Source§impl<A: Float + ScalarOperand + Debug + Send + Sync> UnifiedAdam<A>
impl<A: Float + ScalarOperand + Debug + Send + Sync> UnifiedAdam<A>
Sourcepub fn new(config: OptimizerConfig<A>) -> Self
pub fn new(config: OptimizerConfig<A>) -> Self
Create a new Adam optimizer
Sourcepub fn with_betas(config: OptimizerConfig<A>, beta1: A, beta2: A) -> Self
pub fn with_betas(config: OptimizerConfig<A>, beta1: A, beta2: A) -> Self
Create Adam with custom betas
Trait Implementations§
Source§impl<A: Float + ScalarOperand + Debug + Send + Sync> UnifiedOptimizer<A> for UnifiedAdam<A>
impl<A: Float + ScalarOperand + Debug + Send + Sync> UnifiedOptimizer<A> for UnifiedAdam<A>
Source§fn config(&self) -> &OptimizerConfig<A>
fn config(&self) -> &OptimizerConfig<A>
Get optimizer configuration
Source§fn step_param<D: Dimension>(
&mut self,
param: &mut Parameter<A, D>,
) -> Result<()>
fn step_param<D: Dimension>( &mut self, param: &mut Parameter<A, D>, ) -> Result<()>
Update a single parameter
Source§fn load_state_dict(
&mut self,
_statedict: HashMap<String, Vec<u8>>,
) -> Result<()>
fn load_state_dict( &mut self, _statedict: HashMap<String, Vec<u8>>, ) -> Result<()>
Load state from dictionary
Source§fn step_params<D: Dimension>(
&mut self,
params: &mut [Parameter<A, D>],
) -> Result<()>where
A: ScalarOperand + Debug,
fn step_params<D: Dimension>(
&mut self,
params: &mut [Parameter<A, D>],
) -> Result<()>where
A: ScalarOperand + Debug,
Update multiple parameters
Auto Trait Implementations§
impl<A> Freeze for UnifiedAdam<A>where
A: Freeze,
impl<A> RefUnwindSafe for UnifiedAdam<A>where
A: RefUnwindSafe,
impl<A> Send for UnifiedAdam<A>where
A: Send,
impl<A> Sync for UnifiedAdam<A>where
A: Sync,
impl<A> Unpin for UnifiedAdam<A>where
A: Unpin,
impl<A> UnwindSafe for UnifiedAdam<A>where
A: UnwindSafe + RefUnwindSafe,
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.