Manual trainer

Concept

Manual trainer

Basic usage

 1from skrl.trainers.torch import ManualTrainer
 2
 3# asuming there is an environment called 'env'
 4# and an agent or a list of agents called 'agents'
 5
 6# create a sequential trainer
 7cfg = {"timesteps": 50000, "headless": False}
 8trainer = ManualTrainer(env=env, agents=agents, cfg=cfg)
 9
10# train the agent(s)
11for timestep in range(cfg["timesteps"]):
12    trainer.train(timestep=timestep)
13
14# evaluate the agent(s)
15for timestep in range(cfg["timesteps"]):
16    trainer.eval(timestep=timestep)

Configuration

skrl.trainers.torch.manual.MANUAL_TRAINER_DEFAULT_CONFIG
1MANUAL_TRAINER_DEFAULT_CONFIG = {
2    "timesteps": 100000,            # number of timesteps to train for
3    "headless": False,              # whether to use headless mode (no rendering)
4    "disable_progressbar": False,   # whether to disable the progressbar. If None, disable on non-TTY
5}

API