dcase_util.tfkeras.StopperCallback
- class dcase_util.tfkeras.StopperCallback(epochs=None, manual_update=False, monitor='val_loss', patience=0, min_delta=0, initial_delay=10, **kwargs)[source]
Keras callback to stop training when improvement has not seen in specified amount of epochs. Implements Keras Callback API.
Callback is very similar to standard
EarlyStopping
Keras callback, however it adds support for external metrics (calculated outside Keras training process).Constructor
- Parameters
- epochsint
Total amount of epochs
- manual_updatebool
Manually update callback, use this to when injecting external metrics
- monitorstr
Metric value to be monitored
- patienceint
Number of epochs with no improvement after which training will be stopped.
- min_deltafloat
Minimum change in the monitored quantity to qualify as an improvement.
- initial_delayint
Amount of epochs to wait at the beginning before quantity is monitored.
- __init__(epochs=None, manual_update=False, monitor='val_loss', patience=0, min_delta=0, initial_delay=10, **kwargs)[source]
Constructor
- Parameters
- epochsint
Total amount of epochs
- manual_updatebool
Manually update callback, use this to when injecting external metrics
- monitorstr
Metric value to be monitored
- patienceint
Number of epochs with no improvement after which training will be stopped.
- min_deltafloat
Minimum change in the monitored quantity to qualify as an improvement.
- initial_delayint
Amount of epochs to wait at the beginning before quantity is monitored.
Methods
__init__
([epochs, manual_update, monitor, ...])Constructor
add_external_metric
(metric_label)get_operator
(metric)on_epoch_begin
(epoch[, logs])on_epoch_end
(epoch[, logs])on_predict_batch_begin
(batch[, logs])on_predict_batch_end
(batch[, logs])on_predict_begin
([logs])on_predict_end
([logs])on_test_batch_begin
(batch[, logs])on_test_batch_end
(batch[, logs])on_test_begin
([logs])on_test_end
([logs])on_train_batch_begin
(batch[, logs])on_train_batch_end
(batch[, logs])on_train_begin
([logs])on_train_end
([logs])set_external_metric_value
(metric_label, ...)Add external metric value
set_model
(model)set_params
(params)stop
()update
()Attributes
logger