TrainingCallback
- class TrainingCallback[source]
Bases:
object
An interface for training callbacks.
Initialize the callback.
Attributes Summary
The loss, accessed via the training loop.
The model, accessed via the training loop.
The optimizer, accessed via the training loop.
The result tracker, accessed via the training loop.
The training loop.
Methods Summary
on_batch
(epoch, batch, batch_loss, **kwargs)Call for training batches.
post_batch
(epoch, batch, **kwargs)Call for training batches.
post_epoch
(epoch, epoch_loss, **kwargs)Call after epoch.
post_train
(losses, **kwargs)Call after training.
pre_batch
(**kwargs)Call before training batch.
pre_step
(**kwargs)Call before the optimizer's step.
register_training_loop
(training_loop)Register the training loop.
Attributes Documentation
- loss
The loss, accessed via the training loop.
- model
The model, accessed via the training loop.
- optimizer
The optimizer, accessed via the training loop.
- result_tracker
The result tracker, accessed via the training loop.
- training_loop
The training loop.
Methods Documentation
- on_batch(epoch: int, batch, batch_loss: float, **kwargs: Any) None [source]
Call for training batches.
- pre_batch(**kwargs: Any) None [source]
Call before training batch.
- Parameters:
kwargs (Any)
- Return type:
None
- pre_step(**kwargs: Any) None [source]
Call before the optimizer’s step.
- Parameters:
kwargs (Any)
- Return type:
None
- register_training_loop(training_loop: TrainingLoop) None [source]
Register the training loop.
- Parameters:
training_loop (TrainingLoop)
- Return type:
None