NeptuneResultTracker

class NeptuneResultTracker(project_qualified_name: str | None = None, api_token: str | None = None, offline: bool = False, experiment_id: int | None = None, experiment_name: str | None = None, tags: Collection[str] | None = None)[source]

Bases: ResultTracker

A tracker for Neptune.ai.

Initialize the Neptune result tracker.

Parameters:
  • project_qualified_name (str | None) – Qualified name of a project in a form of namespace/project_name. If None, the value of NEPTUNE_PROJECT environment variable will be taken. For testing, should be <your username>/sandbox

  • api_token (str | None) –

    User’s API token. If None, the value of NEPTUNE_API_TOKEN environment variable will be taken.

    Note

    It is strongly recommended to use NEPTUNE_API_TOKEN environment variable rather than placing your API token in plain text in your source code.

  • offline (bool) – Run neptune in offline mode (uses neptune.OfflineBackend as the backend)

  • experiment_id (int | None) – The identifier of a pre-existing experiment to use. If not given, will rely on the experiment_name.

  • experiment_name (str | None) – The name of the experiment. If no experiment_id is given, one will be created based on the name.

  • tags (Collection[str] | None) – A collection of tags to add to the experiment

Raises:

ValueError – If neither an experiment name nor experiment ID is given

Methods Summary

log_metrics(metrics[, step, prefix])

Log metrics to result store.

log_params(params[, prefix])

Log parameters to result store.

Methods Documentation

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