finetuner.tuner.callback.base module#
- class finetuner.tuner.callback.base.BaseCallback[source]#
Bases:
abc.ABC
The base callback class.
This class defines the different callback methods that can be overriden, however there is no method that the subclass would be required to override.
The callback instance should be passed to the tuner in the
fit
method, in a list that contains all callbacks and is passed to thecallbacks
argument.All methods receive the tuner instance to which the callback has been added as an argument. The most relevant property of the tuner instance is the
state
, which is an instance ofTunerState
and contains relevant training statistics, such as current loss, epoch number, number of batches and batch number.- on_fit_begin(tuner)[source]#
Called at the start of the
fit
method call, after all setup has been done, but before the training has started.
- on_train_batch_begin(tuner)[source]#
Called at the start of a training batch, after the data for the batch has already been loaded.
- on_epoch_end(tuner)[source]#
Called at the end of an epoch, after both training and validation (or just training if no validaton is provided).