pub struct Adam<T: RealScalar = f64, B: LinearAlgebra<T> = NalgebraProvider> { /* private fields */ }Expand description
Scalar- and linear-algebra-generic Adam optimizer.
Trait Implementations§
Source§impl<T, B, P, U, E> Algorithm<P, GradientStatus<T, B>, U, E> for Adam<T, B>
impl<T, B, P, U, E> Algorithm<P, GradientStatus<T, B>, U, E> for Adam<T, B>
Source§type Summary = MinimizationSummary<T, B>
type Summary = MinimizationSummary<T, B>
A type which holds a summary of the algorithm’s ending state.
Source§type Config = AdamConfig<T, B>
type Config = AdamConfig<T, B>
The configuration struct for the algorithm.
Source§fn initialize(
&mut self,
problem: &P,
status: &mut GradientStatus<T, B>,
args: &U,
init: &Self::Init,
config: &Self::Config,
) -> Result<(), E>
fn initialize( &mut self, problem: &P, status: &mut GradientStatus<T, B>, args: &U, init: &Self::Init, config: &Self::Config, ) -> Result<(), E>
Any setup work done before the main steps of the algorithm should be done here. Read more
Source§fn step(
&mut self,
current_step: usize,
problem: &P,
status: &mut GradientStatus<T, B>,
args: &U,
config: &Self::Config,
) -> Result<(), E>
fn step( &mut self, current_step: usize, problem: &P, status: &mut GradientStatus<T, B>, args: &U, config: &Self::Config, ) -> Result<(), E>
The main “step” of an algorithm, which is repeated until termination conditions are met or
the max number of steps have been taken. Read more
Source§fn summarize(
&self,
_current_step: usize,
_problem: &P,
status: &GradientStatus<T, B>,
_args: &U,
init: &Self::Init,
config: &Self::Config,
) -> Result<Self::Summary, E>
fn summarize( &self, _current_step: usize, _problem: &P, status: &GradientStatus<T, B>, _args: &U, init: &Self::Init, config: &Self::Config, ) -> Result<Self::Summary, E>
Generates a new
Algorithm::Summary from the current state of the Algorithm, which can be displayed or used elsewhere. Read moreSource§fn default_callbacks() -> Callbacks<Self, P, GradientStatus<T, B>, U, E, Self::Config>
fn default_callbacks() -> Callbacks<Self, P, GradientStatus<T, B>, U, E, Self::Config>
Provides a set of reasonable default callbacks specific to this
Algorithm.Source§fn postprocessing(
&mut self,
problem: &P,
status: &mut S,
args: &U,
config: &Self::Config,
) -> Result<(), E>
fn postprocessing( &mut self, problem: &P, status: &mut S, args: &U, config: &Self::Config, ) -> Result<(), E>
Source§fn process<I, C>(
&mut self,
problem: &P,
args: &U,
init: I,
config: Self::Config,
callbacks: C,
) -> Result<Self::Summary, E>
fn process<I, C>( &mut self, problem: &P, args: &U, init: I, config: Self::Config, callbacks: C, ) -> Result<Self::Summary, E>
Source§impl<T: Clone + RealScalar, B: Clone + LinearAlgebra<T>> Clone for Adam<T, B>
impl<T: Clone + RealScalar, B: Clone + LinearAlgebra<T>> Clone for Adam<T, B>
Source§impl<T: Debug + RealScalar, B: Debug + LinearAlgebra<T>> Debug for Adam<T, B>
impl<T: Debug + RealScalar, B: Debug + LinearAlgebra<T>> Debug for Adam<T, B>
Source§impl<T, B> Default for Adam<T, B>where
T: RealScalar,
B: LinearAlgebra<T>,
impl<T, B> Default for Adam<T, B>where
T: RealScalar,
B: LinearAlgebra<T>,
Source§impl<T, B, P, U, E> Terminator<Adam<T, B>, P, GradientStatus<T, B>, U, E, AdamConfig<T, B>> for AdamEMATerminator<T>
impl<T, B, P, U, E> Terminator<Adam<T, B>, P, GradientStatus<T, B>, U, E, AdamConfig<T, B>> for AdamEMATerminator<T>
Source§fn check_for_termination(
&mut self,
_current_step: usize,
algorithm: &mut Adam<T, B>,
_problem: &P,
status: &mut GradientStatus<T, B>,
_args: &U,
_config: &AdamConfig<T, B>,
) -> ControlFlow<()>
fn check_for_termination( &mut self, _current_step: usize, algorithm: &mut Adam<T, B>, _problem: &P, status: &mut GradientStatus<T, B>, _args: &U, _config: &AdamConfig<T, B>, ) -> ControlFlow<()>
A termination check which is called on each step of an
Algorithm.Auto Trait Implementations§
impl<T, B> Freeze for Adam<T, B>
impl<T, B> RefUnwindSafe for Adam<T, B>
impl<T, B> Send for Adam<T, B>
impl<T, B> Sync for Adam<T, B>
impl<T, B> Unpin for Adam<T, B>
impl<T, B> UnsafeUnpin for Adam<T, B>
impl<T, B> UnwindSafe for Adam<T, B>
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<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.