otx.api.usecases.reporting#
Training reporting.
Classes
|
Abstract base class used to build new callbacks. |
|
A callback to monitor the progress of training. |
- class otx.api.usecases.reporting.Callback[source]#
Bases:
object
Abstract base class used to build new callbacks.
- Properties
- params: dict. Training parameters
(eg. verbosity, batch size, number of epochs…).
- model: instance of keras.models.Model.
Reference of the model being trained.
The logs dictionary that callback methods take as argument will contain keys for quantities relevant to the current batch or epoch.
Currently, the .fit() method of the Sequential model class will include the following quantities in the logs that it passes to its callbacks:
- on_epoch_end: logs include acc and loss, and
optionally include val_loss (if validation is enabled in fit), and val_acc (if validation and accuracy monitoring are enabled).
- on_batch_begin: logs include size,
the number of samples in the current batch.
- on_batch_end: logs include loss, and optionally acc
(if accuracy monitoring is enabled).
- class otx.api.usecases.reporting.TimeMonitorCallback(num_epoch: int = 0, num_train_steps: int = 0, num_val_steps: int = 0, num_test_steps: int = 0, epoch_history: int = 5, step_history: int = 50, update_progress_callback: ~otx.api.entities.train_parameters.UpdateProgressCallback = <function default_progress_callback>)[source]#
Bases:
Callback
A callback to monitor the progress of training.
- Parameters:
num_epoch (int) – Amount of epochs
num_train_steps (int) – amount of training steps per epoch
num_val_steps (int) – amount of validation steps per epoch
num_test_steps (int) – amount of testing steps
epoch_history (int) – Amount of previous epochs to calculate average epoch time over
step_history (int) – Amount of previous steps to calculate average steps time over
update_progress_callback (UpdateProgressCallback) – Callback to update progress
- is_stalling() bool [source]#
Returns True if the training is stalling.
Returns True if the current step has taken more than 30 seconds and at least 20x more than the average step duration
- on_epoch_end(epoch, logs=None)[source]#
Computes the average time taken to complete an epoch based on a running average of epoch_history epochs.