oa::ml::training::PhaseSchedule

Consecutive phase policy over one super::super::ItTraining lifecycle. The phase schedule does not own another iterator. Its epoch/step totals must exactly match the iterator configuration, and its optional transition hook receives restricted mutable access to the iterator’s existing optimizer.

StRust public API

Declaration

pub struct PhaseSchedule<'hook> { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn add_phase( &mut self, id: impl Into<String>, epochs: u64, steps: u64, ) -> Result<()>
pub fn set_on_phase_begin( &mut self, hook: impl FnMut(usize, &TrainingPhase, &mut dyn Optimizer) -> Result<()> + 'hook, )
pub fn phases(&self) -> &[TrainingPhase]
pub const fn current_phase(&self) -> Option<usize>
pub fn total_epochs(&self) -> u64
pub fn total_steps(&self) -> u64
fn on_train_begin( &mut self, context: &mut TrainingCallbackContext<'_>, ) -> Result<TrainingControl>
fn on_epoch_begin( &mut self, context: &mut TrainingCallbackContext<'_>, ) -> Result<TrainingControl>
fn on_step_end( &mut self, _context: &mut TrainingCallbackContext<'_>, ) -> Result<TrainingControl>
fn on_epoch_end( &mut self, _context: &mut TrainingCallbackContext<'_>, ) -> Result<TrainingControl>
fn on_train_end( &mut self, _context: &mut TrainingCallbackContext<'_>, ) -> Result<TrainingControl>

Associated Functions

pub const fn new() -> Self
fn default() -> Self

Public Method Documentation

pub fn add_phase( &mut self, id: impl Into<String>, epochs: u64, steps: u64, ) -> Result<()>
No public source comment is attached to this declaration.
pub fn set_on_phase_begin( &mut self, hook: impl FnMut(usize, &TrainingPhase, &mut dyn Optimizer) -> Result<()> + 'hook )
No public source comment is attached to this declaration.
pub fn phases( &self ) -> &[TrainingPhase]
No public source comment is attached to this declaration.
pub const fn current_phase( &self ) -> Option<usize>
No public source comment is attached to this declaration.
pub fn total_epochs( &self ) -> u64
No public source comment is attached to this declaration.
pub fn total_steps( &self ) -> u64
No public source comment is attached to this declaration.
fn on_train_begin( &mut self, context: &mut TrainingCallbackContext<'_> ) -> Result<TrainingControl>
No public source comment is attached to this declaration.
fn on_epoch_begin( &mut self, context: &mut TrainingCallbackContext<'_> ) -> Result<TrainingControl>
No public source comment is attached to this declaration.
fn on_step_end( &mut self, _context: &mut TrainingCallbackContext<'_> ) -> Result<TrainingControl>
No public source comment is attached to this declaration.
fn on_epoch_end( &mut self, _context: &mut TrainingCallbackContext<'_> ) -> Result<TrainingControl>
No public source comment is attached to this declaration.
fn on_train_end( &mut self, _context: &mut TrainingCallbackContext<'_> ) -> Result<TrainingControl>
No public source comment is attached to this declaration.
pub const fn new() -> Self
No public source comment is attached to this declaration.
fn default() -> Self
No public source comment is attached to this declaration.