CallbackEvents

class hybrid_learning.concepts.train_eval.callbacks.CallbackEvents(value)[source]

Bases: Enum

Supported callback events for training and evaluation. Events can be:

  • before_epoch_train: right before iterating one epoch of the

    training set

  • after_batch_train, after_epoch_eval:

    after every batch of an epoch of training

  • after_epoch_train: right after iterating one epoch of the

    training set; provides kpis of the training set of current epoch, and the train_loader

  • after_epoch_eval: right after iterating one epoch of evaluation

    (validation or test set); provides evaluation kpis of the current epoch and the val_loader

  • after_epoch: after an epoch of training: provides kpis of

    current epoch

  • between_epochs: after an epoch of a training run with several

    epochs: provides epoch context (total KPI history, current and total epoch number)

  • after_train: after the training of several epochs;

    provides full training and validation history as well as total epoch number

  • after_second_stage_train: like after_train only after the

    second stage training

Special Methods:

__new__(value)

Inherited from : py: class:Enum

__repr__()

Return repr(self).

__str__()

Return str(self).

__dir__()

Returns all members and all public methods

__format__(format_spec)

Returns format using actual value type unless __str__ has been overridden.

__hash__()

Return hash(self).

__reduce_ex__(proto)

Helper for pickle.


AFTER_BATCH_EVAL = 'after_batch_eval'
AFTER_BATCH_TRAIN = 'after_batch_train'
AFTER_EPOCH = 'after_epoch'
AFTER_EPOCH_EVAL = 'after_epoch_eval'
AFTER_EPOCH_TRAIN = 'after_epoch_train'
AFTER_SECOND_STAGE_TRAIN = 'after_second_stage_train'
AFTER_TRAIN = 'after_train'
BEFORE_EPOCH_TRAIN = 'before_epoch_train'
BETWEEN_EPOCHS = 'between_epochs'