oa::ml::training::DqnTrainer

Stateful DQN training coordinator over caller-owned components. The online module, target module, optimizer, replay storage, and engine remain caller-owned and must outlive this coordinator. Dropping the trainer does not submit, wait, synchronize targets, or fire terminal callbacks; use DqnTrainer::finish for the explicit terminal boundary.

StRust public API

Declaration

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

Public Methods

pub fn add_metric(&mut self, metric: &'hooks mut dyn TrainingMetric)
pub fn add_callback(&mut self, callback: &'hooks mut dyn TrainingCallback)
pub fn update(&mut self) -> Result<bool>
pub fn sync_target(&self) -> Result<()>
pub fn is_done(&self) -> bool
pub const fn metrics(&self) -> DqnTrainerMetrics
pub const fn training_loop(&self) -> &ItTraining<'engine, 'hooks>
pub fn training_loop_mut(&mut self) -> &mut ItTraining<'engine, 'hooks>
pub fn finish(self) -> Result<TrainingSnapshot>

Associated Functions

pub fn new( engine: &'engine Engine, online: &'engine dyn Module, target: &'engine dyn Module, optimizer: &'engine mut dyn Optimizer, replay: &'engine ReplayBuffer, config: DqnTrainerConfig, ) -> Result<Self>

Public Method Documentation

pub fn add_metric( &mut self, metric: &'hooks mut dyn TrainingMetric )
No public source comment is attached to this declaration.
pub fn add_callback( &mut self, callback: &'hooks mut dyn TrainingCallback )
No public source comment is attached to this declaration.
pub fn update( &mut self ) -> Result<bool>
No public source comment is attached to this declaration.
pub fn sync_target(&self) -> Result<()>
No public source comment is attached to this declaration.
pub fn is_done( &self ) -> bool
No public source comment is attached to this declaration.
pub const fn metrics( &self ) -> DqnTrainerMetrics
No public source comment is attached to this declaration.
pub const fn training_loop( &self ) -> &ItTraining<'engine, 'hooks>
No public source comment is attached to this declaration.
pub fn training_loop_mut( &mut self ) -> &mut ItTraining<'engine, 'hooks>
No public source comment is attached to this declaration.
pub fn finish( self ) -> Result<TrainingSnapshot>
No public source comment is attached to this declaration.
pub fn new( engine: &'engine Engine, online: &'engine dyn Module, target: &'engine dyn Module, optimizer: &'engine mut dyn Optimizer, replay: &'engine ReplayBuffer, config: DqnTrainerConfig ) -> Result<Self>
No public source comment is attached to this declaration.