Skip to main content
App version: 3.4.3

Runs in Neptune

A run is the basic unit of a model-training experiment. It contains metadata related to the experiment.

The below code creates a run in the specified Neptune project:

Create a run
from neptune_scale import Run

run = Run(
project="team-alpha/project-x",
run_id="astute-kittiwake-15",
)
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 experiment head:

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

Creating a run that belongs to an experiment

You can also use Neptune experiments to connect related runs together. This enables forking and analysis of complete run history.

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",
)