medkit.training.callbacks#

Classes#

TrainerCallback

A TrainerCallback is the base class for trainer callbacks.

DefaultPrinterCallback

Default implementation of TrainerCallback.

Module Contents#

class medkit.training.callbacks.TrainerCallback#

A TrainerCallback is the base class for trainer callbacks.

on_train_begin(config: medkit.training.trainer_config.TrainerConfig)#

Event called at the beginning of training.

on_train_end()#

Event called at the end of training.

on_epoch_begin(epoch: int)#

Event called at the beginning of an epoch.

on_epoch_end(metrics: dict[str, float], epoch: int, epoch_time: float)#

Event called at the end of an epoch.

on_step_begin(step_idx: int, nb_batches: int, phase: str)#

Event called at the beginning of a step in training.

on_step_end(step_idx: int, nb_batches: int, phase: str)#

Event called at the end of a step in training.

on_save(checkpoint_dir: str)#

Event called on saving a checkpoint.

class medkit.training.callbacks.DefaultPrinterCallback#

Bases: TrainerCallback

Default implementation of TrainerCallback.

logger#
console_handler#
formatter#
_progress_bar = None#
on_train_begin(config)#

Event called at the beginning of training.

on_epoch_end(metrics, epoch, epoch_duration)#

Event called at the end of an epoch.

on_train_end()#

Event called at the end of training.

on_save(checkpoint_dir)#

Event called on saving a checkpoint.

on_step_begin(step_idx: int, nb_batches: int, phase: str)#

Event called at the beginning of a step in training.

on_step_end(step_idx: int, nb_batches: int, phase: str)#

Event called at the end of a step in training.