towhee.trainer.callback.TrainerControl

class towhee.trainer.callback.TrainerControl(should_training_stop: bool = False, should_epoch_stop: bool = False, should_save: bool = False, should_evaluate=False, should_log=False)[source]

Bases: object

TrainerControl defines a set of current control status which trainer can get and take the corresponding action. It can be used by customized Callback to interfere the trainer.

Parameters:
  • should_training_stop – (bool) whether or not training should be interrupted.

  • should_epoch_stop – (bool) whether or not current training epoch should be interrupted.

  • should_save – (bool) whether or not trainer should save current model.

  • should_evaluate – (bool) whether or not trainer should evaluate current model.

  • should_log – (bool) whether or not trainer should report the log.

Methods

__init__(should_training_stop: bool = False, should_epoch_stop: bool = False, should_save: bool = False, should_evaluate=False, should_log=False)[source]