pub struct TrajectoryTracker { /* private fields */ }
Expand description
A callback-based trajectory tracker for use with optimization algorithms
Implementations§
Source§impl TrajectoryTracker
impl TrajectoryTracker
Sourcepub fn record(
&mut self,
iteration: usize,
params: &ArrayView1<'_, f64>,
function_value: f64,
)
pub fn record( &mut self, iteration: usize, params: &ArrayView1<'_, f64>, function_value: f64, )
Record a new point in the optimization trajectory
Sourcepub fn record_gradient_norm(&mut self, grad_norm: f64)
pub fn record_gradient_norm(&mut self, grad_norm: f64)
Record gradient norm
Sourcepub fn record_step_size(&mut self, step_size: f64)
pub fn record_step_size(&mut self, step_size: f64)
Record step size
Sourcepub fn record_custom_metric(&mut self, name: &str, value: f64)
pub fn record_custom_metric(&mut self, name: &str, value: f64)
Record custom metric
Sourcepub fn trajectory(&self) -> &OptimizationTrajectory
pub fn trajectory(&self) -> &OptimizationTrajectory
Get the recorded trajectory
Sourcepub fn into_trajectory(self) -> OptimizationTrajectory
pub fn into_trajectory(self) -> OptimizationTrajectory
Consume the tracker and return the trajectory
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrajectoryTracker
impl RefUnwindSafe for TrajectoryTracker
impl Send for TrajectoryTracker
impl Sync for TrajectoryTracker
impl Unpin for TrajectoryTracker
impl UnwindSafe for TrajectoryTracker
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.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.