dcase_framework.keras_utils.StopperCallback

class dcase_framework.keras_utils.StopperCallback(*args, **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:

epochs : int

Total amount of epochs

manual_update : bool

Manually update callback, use this to when injecting external metrics Default value True

monitor : str

Metric value to be monitored Default value “val_loss”

patience : int

Number of epochs with no improvement after which training will be stopped. Default value 0

min_delta : float

Minimum change in the monitored quantity to qualify as an improvement. Default value 0

initial_delay : int

Amount of epochs to wait at the beginning before quantity is monitored. Default value 10

__init__(*args, **kwargs)[source]

Constructor

Parameters:

epochs : int

Total amount of epochs

manual_update : bool

Manually update callback, use this to when injecting external metrics Default value True

monitor : str

Metric value to be monitored Default value “val_loss”

patience : int

Number of epochs with no improvement after which training will be stopped. Default value 0

min_delta : float

Minimum change in the monitored quantity to qualify as an improvement. Default value 0

initial_delay : int

Amount of epochs to wait at the beginning before quantity is monitored. Default value 10

Methods

__init__(\*args, \*\*kwargs) Constructor
add_external_metric(metric_label)
get_operator(metric)
on_batch_begin(batch[, logs])
on_batch_end(batch[, logs])
on_epoch_begin(epoch[, logs])
on_epoch_end(epoch[, 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()