Run
Representation of experiment tracking run logged with Neptune.
By default, Neptune periodically synchronizes the data with the server in the background. The connection to Neptune remains open until the run is stopped or the script finishes executing.
Initialization
Initialize with the class constructor:
from neptune_scale import Run
if __name__ == "__main__":
run = Run(...)
Or with a context manager:
from neptune_scale import Run
if __name__ == "__main__":
with Run(...) as run:
...
The line
if __name__ == "__main__":
ensures safe importing of the main module. For details, see the Python documentation.
Parameters
Examples
Create a run:
from neptune_scale import Run
with Run(experiment_name="swim-further") as run:
...
Create a run and pass Neptune credentials as arguments:
from neptune_scale import Run
with Run(
project="team-alpha/project-x",
api_token="h0dHBzOi8aHR0cHM6...Y2MifQ==",
experiment_name="swim-further",
) as run:
...
For help, see Create a run.
To restart (fork) an experiment, create a forked run:
with Run(
experiment_name="swim-further",
fork_run_id="likable-barracuda",
fork_step=102,
) as run:
...
Create a detached run:
with Run(
run_id="likable-barracuda", # optional
) as run:
...
Forking and history is only supported for experiment runs.
To take advantage of these and other features that concern analysis of multiple related runs, create experiments rather than stand-alone runs.
Methods
Method | Description |
---|---|
log_configs() | Logs the specified metadata to a Neptune run. |
log_metrics() | Logs the specified metrics to a Neptune run. |
log_string_series() | Logs the specified strings as a sequence. |
log_histograms() | Logs the specified histograms to a step in a Neptune run. |
add_tags() | Adds the list of tags to the run. |
remove_tags() | Removes the specified tags from the run. |
assign_files() | Logs the specified files to Neptune. |
log_files() | Logs the specified files as a sequence. |
get_run_url() | Returns a URL for viewing the run in the Neptune web app. |
get_experiment_url() | Returns a URL for viewing the experiment in the Neptune web app. |
wait_for_submission() | Waits until all metadata is submitted to Neptune for processing. |
wait_for_processing() | Waits until all metadata is processed by Neptune. |
close() | Waits for all locally queued data to be processed by Neptune and closes the run. |
terminate() | Terminates the failed run in the error callback. |