openfl.callbacks.MetricWriter

openfl.callbacks.MetricWriter#

class openfl.callbacks.MetricWriter(log_dir='./logs/')[source]#

Log scalar metrics at the end of each round.

This callback logs scalar metrics to a file and optionally to TensorBoard. To enable TensorBoard logging, set the environment variable TENSORBOARD=1.

Parameters:

log_dir (str)

log_dir#

Path to write logs as lines of JSON. Defaults to ./logs.

__init__(log_dir='./logs/')[source]#
Parameters:

log_dir (str)

Methods

__init__([log_dir])

on_experiment_begin([logs])

Open file handles for logging.

on_experiment_end([logs])

Cleanup.

on_round_begin(round_num[, logs])

Callback function to be executed at the beginning of a round.

on_round_end(round_num[, logs])

Log metrics.

on_task_begin(task_name, round_num[, logs])

Callback function to be executed at the beginning of a task.

on_task_end(task_name, round_num[, logs])

Callback function to be executed at the end of a task.

set_params(params)

set_tensor_db(tensor_db)