Struct border_core::Trainer
source · [−]pub struct Trainer<E, P, R> where
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output>, {
pub env_config_train: E::Config,
pub env_config_eval: Option<E::Config>,
pub step_proc_config: P::Config,
pub replay_buffer_config: R::Config,
pub model_dir: Option<String>,
pub opt_interval: usize,
pub record_interval: usize,
pub eval_interval: usize,
pub save_interval: usize,
pub max_opts: usize,
pub eval_episodes: usize,
}
Expand description
Manages training loop and related objects.
Fields
env_config_train: E::Config
Configuration of the environment for training.
env_config_eval: Option<E::Config>
Configuration of the environment for evaluation.
If None
, env_config_train
is used.
step_proc_config: P::Config
Configuration of the transition producer.
replay_buffer_config: R::Config
Configuration of the replay buffer.
model_dir: Option<String>
Where to save the trained model.
opt_interval: usize
Interval of optimization in environment steps.
record_interval: usize
Interval of recording in optimization steps.
eval_interval: usize
Interval of evaluation in optimization steps.
save_interval: usize
Interval of saving the model in optimization steps.
max_opts: usize
The maximal number of optimization steps.
eval_episodes: usize
The number of episodes for evaluation.
Implementations
impl<E, P, R> Trainer<E, P, R> where
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output>,
impl<E, P, R> Trainer<E, P, R> where
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output>,
Constructs a trainer.
Performs a training step.