Skip to main content

Runs in Neptune

A run is the basic unit of a model-training experiment.

The below code creates a run in the specified Neptune project, as the "seabird-flying-skills" experiment.

Create an experiment run
from neptune_scale import Run

run = Run(
run_id="astute-kittiwake-15",
experiment_name="seabird-flying-skills",
)
What's the connection between a run and experiment?

In the code, experiments are represented as runs. An experiment run has the experiment name stored in its sys/name attribute.

In the below example, a run is created as the head of the experiment gull-flying-skills:

from neptune_scale import Run

run = Run(
experiment_name="gull-flying-skills",
run_id="vigilant-kittiwake-1",
)

If a new run is created with the same experiment name, it becomes the new representant run for the experiment:

run = Run(
experiment_name="gull-flying-skills",
run_id="vigilant-kittiwake-2",
)

The vigilant-kittiwake-1 run is still accessible as part of the experiment history, but it's no longer considered an experiment.

Run metadata structure

The metadata is stored in a folder-like structure, with all namespaces and attributes exactly as they were logged.

All metadata of a run displayed in the Neptune app

The below example shows both flat and nested attributes:

Sample code
run.log_configs(
{
"optimizer": "adam",
"parameters/learning_rate": 0.001,
"parameters/batch_size": 64,
},
)
Resulting structure
run
|-- optimizer # String attribute with value "adam"
|-- parameters/ # Namespace
|-- learning_rate # Float attribute with value 0.001
|-- batch_size # Int attribute with value 64