MetricCallback

Trait MetricCallback 

Source
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§

Source

fn on_train_begin(&mut self)

Initialize the callback at the start of training

Source

fn on_batch_end( &mut self, batch: usize, predictions: &Array<F, IxDyn>, targets: &Array<F, IxDyn>, )

Update with batch results

Source

fn on_epoch_end(&mut self, epoch: usize) -> Result<(), MetricsError>

Finalize metrics at the end of an epoch

Source

fn on_train_end(&mut self)

Clean up at the end of training

Implementors§