Trait MetricsRenderer

pub trait MetricsRenderer: Send + Sync {
    // Required methods
    fn update_train(&mut self, state: MetricState);
    fn update_valid(&mut self, state: MetricState);
    fn render_train(&mut self, item: TrainingProgress);
    fn render_valid(&mut self, item: TrainingProgress);

    // Provided method
    fn on_train_end(&mut self) -> Result<(), Box<dyn Error>> { ... }
}
Expand description

Trait for rendering metrics.

Required Methods§

fn update_train(&mut self, state: MetricState)

Updates the training metric state.

§Arguments
  • state - The metric state.

fn update_valid(&mut self, state: MetricState)

Updates the validation metric state.

§Arguments
  • state - The metric state.

fn render_train(&mut self, item: TrainingProgress)

Renders the training progress.

§Arguments
  • item - The training progress.

fn render_valid(&mut self, item: TrainingProgress)

Renders the validation progress.

§Arguments
  • item - The validation progress.

Provided Methods§

fn on_train_end(&mut self) -> Result<(), Box<dyn Error>>

Callback method invoked when training ends, whether it completed successfully or was interrupted.

§Returns

A result indicating whether the end-of-training actions were successful.

Implementors§