physioex.train.logger.Logger#

class physioex.train.logger.Logger[source]#

Bases: ABC

Backend-agnostic experiment logger.

Every method has a no-op default so backends only override what they support; log() is the single required hook.

__init__()#

Methods

__init__()

close()

Release backend resources at the end of training.

log(stage, epoch, step, loss[, accuracy, ...])

Log the scalar metrics of a single train/validation step.

log_figure(tag, figure, step)

Record a matplotlib figure (e.g. a confusion matrix).

log_graph(model, input_sample)

Record the model computational graph.

log_histogram(tag, values, step)

Record a distribution of values (e.g. weights or gradients).

log_hparams(hparams[, metrics])

Record run hyper-parameters once at the start of training.

log_learning_rate(step, value)

Record the learning rate used at a global step.

log_scalars(mapping, step)

Record a batch of named scalars (per-class metrics, aggregates).

log_update_norm(step, value)

Record the L2 norm of the optimizer update at a global step.

update()

Flush buffered events to the backend.

watch_model(model[, log_freq])

Automatically track parameters/gradients (W&B only).

close()[source]#

Release backend resources at the end of training.

Return type:

None

abstract log(stage, epoch, step, loss, accuracy=None, extra_metrics=None)[source]#

Log the scalar metrics of a single train/validation step.

Parameters:
Return type:

None

log_figure(tag, figure, step)[source]#

Record a matplotlib figure (e.g. a confusion matrix).

Parameters:
Return type:

None

log_graph(model, input_sample)[source]#

Record the model computational graph.

Parameters:
  • model (Any)

  • input_sample (Any)

Return type:

None

log_histogram(tag, values, step)[source]#

Record a distribution of values (e.g. weights or gradients).

Parameters:
Return type:

None

log_hparams(hparams, metrics=None)[source]#

Record run hyper-parameters once at the start of training.

Parameters:
Return type:

None

log_learning_rate(step, value)[source]#

Record the learning rate used at a global step.

Parameters:
Return type:

None

log_scalars(mapping, step)[source]#

Record a batch of named scalars (per-class metrics, aggregates).

Parameters:
Return type:

None

log_update_norm(step, value)[source]#

Record the L2 norm of the optimizer update at a global step.

Parameters:
Return type:

None

update()[source]#

Flush buffered events to the backend.

Return type:

None

watch_model(model, log_freq=1000)[source]#

Automatically track parameters/gradients (W&B only).

Parameters:
Return type:

None