candle.keras_utils.TerminateOnTimeOut#
- class candle.keras_utils.TerminateOnTimeOut(timeout_in_sec=10)#
This class implements timeout on model training.
When the script reaches timeout, this class sets model.stop_training = True
- __init__(timeout_in_sec=10)#
Initialize TerminateOnTimeOut class.
- Parameters:
timeout_in_sec (int) – seconds to timeout
Methods
__init__
([timeout_in_sec])Initialize TerminateOnTimeOut class.
on_batch_begin
(batch[, logs])A backwards compatibility alias for on_train_batch_begin.
on_batch_end
(batch[, logs])A backwards compatibility alias for on_train_batch_end.
on_epoch_begin
(epoch[, logs])Called at the start of an epoch.
on_epoch_end
(epoch[, logs])On every epoch end, check whether it exceeded timeout and terminate training if necessary.
on_predict_batch_begin
(batch[, logs])Called at the beginning of a batch in predict methods.
on_predict_batch_end
(batch[, logs])Called at the end of a batch in predict methods.
on_predict_begin
([logs])Called at the beginning of prediction.
on_predict_end
([logs])Called at the end of prediction.
on_test_batch_begin
(batch[, logs])Called at the beginning of a batch in evaluate methods.
on_test_batch_end
(batch[, logs])Called at the end of a batch in evaluate methods.
on_test_begin
([logs])Called at the beginning of evaluation or validation.
on_test_end
([logs])Called at the end of evaluation or validation.
on_train_batch_begin
(batch[, logs])Called at the beginning of a training batch in fit methods.
on_train_batch_end
(batch[, logs])Called at the end of a training batch in fit methods.
on_train_begin
([logs])Start clock to calculate timeout.
on_train_end
([logs])Called at the end of training.
set_model
(model)set_params
(params)