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