pub struct MultiMetricMonitor { /* private fields */ }Expand description
A multi-metric early stopping monitor.
Monitors multiple metrics simultaneously and applies a policy
(All or Any) to decide when to stop training.
Implementations§
Source§impl MultiMetricMonitor
impl MultiMetricMonitor
Sourcepub fn new(policy: MultiMetricPolicy) -> Self
pub fn new(policy: MultiMetricPolicy) -> Self
Create a new multi-metric monitor with the given policy.
Sourcepub fn add_metric(
&mut self,
name: impl Into<String>,
config: EarlyStoppingConfig,
)
pub fn add_metric( &mut self, name: impl Into<String>, config: EarlyStoppingConfig, )
Register a new metric to monitor.
Sourcepub fn step(&mut self, values: &[(String, f64)]) -> EarlyStoppingDecision
pub fn step(&mut self, values: &[(String, f64)]) -> EarlyStoppingDecision
Report values for all metrics and return a combined decision.
Keys in values must match registered metric names.
Metrics not present in values are skipped for that step.
Sourcepub fn get_monitor(&self, name: &str) -> Option<&EarlyStoppingMonitor>
pub fn get_monitor(&self, name: &str) -> Option<&EarlyStoppingMonitor>
Get an individual monitor by name.
Sourcepub fn num_metrics(&self) -> usize
pub fn num_metrics(&self) -> usize
Number of registered metrics.
Trait Implementations§
Source§impl Clone for MultiMetricMonitor
impl Clone for MultiMetricMonitor
Source§fn clone(&self) -> MultiMetricMonitor
fn clone(&self) -> MultiMetricMonitor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MultiMetricMonitor
impl RefUnwindSafe for MultiMetricMonitor
impl Send for MultiMetricMonitor
impl Sync for MultiMetricMonitor
impl Unpin for MultiMetricMonitor
impl UnsafeUnpin for MultiMetricMonitor
impl UnwindSafe for MultiMetricMonitor
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