dcase_util.keras.ProgressLoggerCallback

class dcase_util.keras.ProgressLoggerCallback(manual_update=False, epochs=None, external_metric_labels=None, metric=None, loss=None, manual_update_interval=1, output_type='logging', show_timing=True, **kwargs)[source]

Keras callback to show metrics in logging interface. Implements Keras Callback API.

This callback is very similar to standard ProgbarLogger Keras callback, however it adds support for logging interface, and external metrics (metrics calculated outside Keras training process).

Constructor

Parameters
epochsint

Total amount of epochs Default value None

metricstr

Metric name Default value None

manual_updatebool

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

manual_update_intervalint

Epoch interval for manual update, used anticipate updates Default value 1

output_typestr

Output type, either ‘logging’, ‘console’, or ‘notebook’ Default value ‘logging’

show_timingbool

Show per epoch time and estimated time remaining Default value True

external_metric_labelsdict or OrderedDict

Dictionary with {‘metric_label’: ‘metric_name’} Default value None

__init__(manual_update=False, epochs=None, external_metric_labels=None, metric=None, loss=None, manual_update_interval=1, output_type='logging', show_timing=True, **kwargs)[source]

Constructor

Parameters
epochsint

Total amount of epochs Default value None

metricstr

Metric name Default value None

manual_updatebool

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

manual_update_intervalint

Epoch interval for manual update, used anticipate updates Default value 1

output_typestr

Output type, either ‘logging’, ‘console’, or ‘notebook’ Default value ‘logging’

show_timingbool

Show per epoch time and estimated time remaining Default value True

external_metric_labelsdict or OrderedDict

Dictionary with {‘metric_label’: ‘metric_name’} Default value None

Methods

__init__([manual_update, epochs, ...])

Constructor

add_external_metric(metric_id)

Add external metric to be monitored

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)

update()

Update

update_progress_log()

Update progress to logging interface

Attributes

logger