oa::ml::CheckpointManager

Stateful checkpoint selection and bounded incremental-retention policy.

StRust public API

Declaration

pub struct CheckpointManager<'engine> { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn model_directory(&self) -> PathBuf
pub fn incremental_directory(&self) -> PathBuf
pub fn master_path(&self) -> PathBuf
pub fn is_better(&self, metric: f64) -> bool
pub const fn best_metric(&self) -> f64
pub fn metric_name(&self) -> &str
pub fn maybe_save( &mut self, model: &dyn Module, optimizer: &dyn CheckpointOptimizer, step: u64, metric: f64, force: bool, ) -> Result<bool>
pub fn save_incremental( &mut self, model: &dyn Module, optimizer: &dyn CheckpointOptimizer, step: u64, metric: f64, metric_name: Option<&str>, ) -> Result<PathBuf>
pub fn load_best_into( &self, model: &dyn Module, optimizer: &mut dyn CheckpointOptimizer, ) -> Result<()>
pub fn load_latest_into( &self, model: &dyn Module, optimizer: &mut dyn CheckpointOptimizer, ) -> Result<u64>
pub fn resume_latest_into( &mut self, model: &dyn Module, optimizer: &mut dyn CheckpointOptimizer, ) -> Result<u64>

Associated Functions

pub fn new( engine: &'engine Engine, config: CheckpointManagerConfig, ) -> Result<Self>

Public Method Documentation

pub fn model_directory( &self ) -> PathBuf
No public source comment is attached to this declaration.
pub fn incremental_directory( &self ) -> PathBuf
No public source comment is attached to this declaration.
pub fn master_path( &self ) -> PathBuf
No public source comment is attached to this declaration.
pub fn is_better( &self, metric: f64 ) -> bool
No public source comment is attached to this declaration.
pub const fn best_metric( &self ) -> f64
No public source comment is attached to this declaration.
pub fn metric_name( &self ) -> &str
No public source comment is attached to this declaration.
pub fn maybe_save( &mut self, model: &dyn Module, optimizer: &dyn CheckpointOptimizer, step: u64, metric: f64, force: bool ) -> Result<bool>
No public source comment is attached to this declaration.
pub fn save_incremental( &mut self, model: &dyn Module, optimizer: &dyn CheckpointOptimizer, step: u64, metric: f64, metric_name: Option<&str> ) -> Result<PathBuf>
No public source comment is attached to this declaration.
pub fn load_best_into( &self, model: &dyn Module, optimizer: &mut dyn CheckpointOptimizer, ) -> Result<()>
No public source comment is attached to this declaration.
pub fn load_latest_into( &self, model: &dyn Module, optimizer: &mut dyn CheckpointOptimizer ) -> Result<u64>
No public source comment is attached to this declaration.
pub fn resume_latest_into( &mut self, model: &dyn Module, optimizer: &mut dyn CheckpointOptimizer ) -> Result<u64>
No public source comment is attached to this declaration.
pub fn new( engine: &'engine Engine, config: CheckpointManagerConfig ) -> Result<Self>
No public source comment is attached to this declaration.