pub struct TrainerConfig {
pub max_opts: usize,
pub opt_interval: usize,
pub eval_interval: usize,
pub flush_record_interval: usize,
pub record_compute_cost_interval: usize,
pub record_agent_info_interval: usize,
pub warmup_period: usize,
pub save_interval: usize,
}
Expand description
Configuration parameters for the training process.
This struct defines various intervals and thresholds that control the behavior of the training loop. Each parameter can be set using the builder pattern methods.
Fields§
§max_opts: usize
Maximum number of optimization steps to perform. Training stops when this number is reached.
opt_interval: usize
Number of environment steps between optimization updates. For example, if set to 1, optimization occurs after every environment step.
eval_interval: usize
Number of optimization steps between performance evaluations. During evaluation, the agent’s performance is measured and the best model is saved.
flush_record_interval: usize
Number of optimization steps between flushing recorded metrics to storage. This controls how frequently training metrics are persisted.
record_compute_cost_interval: usize
Number of optimization steps between recording computational performance metrics. This includes metrics like optimization steps per second.
record_agent_info_interval: usize
Number of optimization steps between recording agent-specific information. This can include internal agent metrics or state information.
warmup_period: usize
Initial number of environment steps before optimization begins. During this period, the replay buffer is filled with initial experiences.
save_interval: usize
Number of optimization steps between saving model checkpoints. These checkpoints can be used for resuming training or analysis.
Implementations§
Source§impl TrainerConfig
impl TrainerConfig
Sourcepub fn eval_interval(self, v: usize) -> Self
pub fn eval_interval(self, v: usize) -> Self
Sourcepub fn eval_threshold(self, _v: f32) -> Self
pub fn eval_threshold(self, _v: f32) -> Self
(Deprecated) Sets the evaluation threshold.
This method is currently unimplemented and may be removed in future versions.
Sourcepub fn opt_interval(self, opt_interval: usize) -> Self
pub fn opt_interval(self, opt_interval: usize) -> Self
Sourcepub fn flush_record_interval(self, flush_record_interval: usize) -> Self
pub fn flush_record_interval(self, flush_record_interval: usize) -> Self
Sourcepub fn record_compute_cost_interval(
self,
record_compute_cost_interval: usize,
) -> Self
pub fn record_compute_cost_interval( self, record_compute_cost_interval: usize, ) -> Self
Sourcepub fn record_agent_info_interval(
self,
record_agent_info_interval: usize,
) -> Self
pub fn record_agent_info_interval( self, record_agent_info_interval: usize, ) -> Self
Sourcepub fn warmup_period(self, warmup_period: usize) -> Self
pub fn warmup_period(self, warmup_period: usize) -> Self
Sourcepub fn save_interval(self, save_interval: usize) -> Self
pub fn save_interval(self, save_interval: usize) -> Self
Trait Implementations§
Source§impl Clone for TrainerConfig
impl Clone for TrainerConfig
Source§fn clone(&self) -> TrainerConfig
fn clone(&self) -> TrainerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TrainerConfig
impl Debug for TrainerConfig
Source§impl Default for TrainerConfig
impl Default for TrainerConfig
Source§fn default() -> Self
fn default() -> Self
Creates a default configuration with conservative values.
Default values are set to:
max_opts
: 0opt_interval
: 1 (optimize every step)eval_interval
: 0 (no evaluation)flush_record_interval
: usize::MAX (never flush)record_compute_cost_interval
: usize::MAX (never record)record_agent_info_interval
: usize::MAX (never record)warmup_period
: 0 (no warmup)save_interval
: usize::MAX (never save)