trinity.trainer.trainer module#
Trainer Class
- class trinity.trainer.trainer.Trainer(config: Config)[source]#
Bases:
object
Consume the experience and train the model.
- async train_step() bool [source]#
Train one step.
- Returns:
Whether to continue training.
- Return type:
bool
- property train_step_num: int#
Get the current training step number.
- class trinity.trainer.trainer.TrainEngineWrapper[source]#
Bases:
ABC
A wrapper class to wrap various training engines.
- abstract property train_step_num: int#
Get the current training step number.
- abstract train_step(batch: Experiences) Tuple[bool, Dict] [source]#
Training one step.
- Parameters:
batch (Experiences) – A batch of experiences to train.
- Returns:
Whether to continue training. Dict: Metrics of the training step.
- Return type:
bool
- trinity.trainer.trainer.get_trainer_wrapper(config: Config) TrainEngineWrapper [source]#
Get a trainer wrapper.