xnn.common.train.loggers.CSVLogger#

class xnn.common.train.loggers.CSVLogger(save_dir=None, filename='metrics.csv')[source]#

Bases: Logger

Writes every logged dictionary as one row of a CSV file (step plus one column per metric).

Parameters:
  • save_dir (str or None, optional) – Directory of metrics.csv and hparams.yaml; defaults to the run’s output_dir.

  • filename (str, optional) – Name of the metrics file. Defaults to "metrics.csv".

setup(output_dir)[source]#

Default save_dir to output_dir.

Parameters:

output_dir (str)

Return type:

None

property path: str#

Path of the metrics file.

log_hyperparams(params)[source]#

Write params to hparams.yaml next to the metrics file.

Parameters:

params (dict)

Return type:

None

log_metrics(metrics, step)[source]#

Append a row; the file is rewritten whenever a new column appears.

Parameters:
Return type:

None