drytorch.trackers.csv

Module containing a tracker that dumps metrics in a CSV file.

Classes

CSVDumper(par_dir, dialect)

Dump metrics into a CSV file.

DryTorchDialect()

Dialect similar to excel that converts numbers to floats.

class CSVDumper(par_dir: Path | None = None, dialect: Dialect = <drytorch.trackers.csv.DryTorchDialect object>)[source]

Bases: Dumper, MetricLoader

Dump metrics into a CSV file.

Initialize.

Parameters:
  • par_dir (Path | None) – the parent directory for the tracker data. Default uses the same of the current experiment.

  • dialect (Dialect) – the format specification. Defaults to local dialect.

notify(event: Event) None[source]
notify(event: StartExperimentEvent) None
notify(event: MetricEvent) None

Notify the tracker of an event.

Parameters:

event (Event) – the event to notify about.

Return type:

None

read_csv(model_name: str, source: str, max_epoch: int = -1) tuple[list[int], dict[str, list[float]]][source]

Read the CSV file associated with the given model and source.

Parameters:
  • model_name (str) – the name of the model.

  • source (str) – the source of the metrics.

  • max_epoch (int) – the maximum number of epochs to load. Defaults to all.

Returns:

Epochs and relative value for each metric.

Return type:

tuple[list[int], dict[str, list[float]]]

clean_up() None[source]

Remove experimental data from the tracker.

Return type:

None