ConsoleResultTracker

class ConsoleResultTracker(*, track_parameters: bool = True, parameter_filter: None | str | Pattern[str] = None, track_metrics: bool = True, metric_filter: None | str | Pattern[str] = None, start_end_run: bool = False, writer: str = 'tqdm')[source]

Bases: ResultTracker

A class that directly prints to console.

Initialize the tracker.

Parameters:
  • track_parameters (bool) – Whether to print parameters.

  • parameter_filter (None | str | Pattern[str]) – A regular expression to filter parameters. If None, print all parameters.

  • track_metrics (bool) – Whether to print metrics.

  • metric_filter (None | str | Pattern[str]) – A regular expression to filter metrics. If None, print all parameters.

  • start_end_run (bool) – Whether to print start/end run messages.

  • writer (str) – The writer to use - one of “tqdm”, “builtin”, or “logger”.

Methods Summary

end_run([success])

End a run.

log_metrics(metrics[, step, prefix])

Log metrics to result store.

log_params(params[, prefix])

Log parameters to result store.

start_run([run_name])

Start a run with an optional name.

Methods Documentation

end_run(success: bool = True) None[source]

End a run.

HAS to be called after the experiment is finished.

Parameters:

success (bool) – Can be used to signal failed runs. May be ignored.

Return type:

None

log_metrics(metrics: Mapping[str, float], step: int | None = None, prefix: str | None = None) None[source]

Log metrics to result store.

Parameters:
  • metrics (Mapping[str, float]) – The metrics to log.

  • step (int | None) – An optional step to attach the metrics to (e.g. the epoch).

  • prefix (str | None) – An optional prefix to prepend to every key in metrics.

Return type:

None

log_params(params: Mapping[str, Any], prefix: str | None = None) None[source]

Log parameters to result store.

Parameters:
Return type:

None

start_run(run_name: str | None = None) None[source]

Start a run with an optional name.

Parameters:

run_name (str | None)

Return type:

None