JSONResultTracker

class JSONResultTracker(path=None, name=None)[source]

Bases: FileResultTracker

Tracking results to a JSON lines file.

Also allows monitoring experiments, e.g. by

tail -f results.txt | grep "hits_at_10"

Initialize the tracker.

Parameters:
  • path (Union[None, str, Path]) – The path of the log file.

  • name (Optional[str]) – The default file name for a file if no path is given. If no default is given, the current time is used.

Attributes Summary

extension

The file extension for this writer (do not include dot)

Methods Summary

log_metrics(metrics[, step, prefix])

Log metrics to result store.

log_params(params[, prefix])

Log parameters to result store.

Attributes Documentation

extension: ClassVar[str] = 'jsonl'

The file extension for this writer (do not include dot)

Methods Documentation

log_metrics(metrics, step=None, prefix=None)[source]

Log metrics to result store.

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

  • step (Optional[int]) – An optional step to attach the metrics to (e.g. the epoch).

  • prefix (Optional[str]) – An optional prefix to prepend to every key in metrics.

Return type:

None

log_params(params, prefix=None)[source]

Log parameters to result store.

Return type:

None

Parameters: