pub trait MetricCallback<F: Float + Debug + Display> {
// Required methods
fn on_train_begin(&mut self);
fn on_batch_end(
&mut self,
batch: usize,
predictions: &Array<F, IxDyn>,
targets: &Array<F, IxDyn>,
);
fn on_epoch_end(&mut self, epoch: usize) -> Result<(), MetricsError>;
fn on_train_end(&mut self);
}Expand description
Trait for callbacks that can track metrics during training
Required Methods§
Sourcefn on_train_begin(&mut self)
fn on_train_begin(&mut self)
Initialize the callback at the start of training
Sourcefn on_batch_end(
&mut self,
batch: usize,
predictions: &Array<F, IxDyn>,
targets: &Array<F, IxDyn>,
)
fn on_batch_end( &mut self, batch: usize, predictions: &Array<F, IxDyn>, targets: &Array<F, IxDyn>, )
Update with batch results
Sourcefn on_epoch_end(&mut self, epoch: usize) -> Result<(), MetricsError>
fn on_epoch_end(&mut self, epoch: usize) -> Result<(), MetricsError>
Finalize metrics at the end of an epoch
Sourcefn on_train_end(&mut self)
fn on_train_end(&mut self)
Clean up at the end of training