Create a run
To create an experiment run, use the Run
constructor.
For example, to create a run that belongs to the seabird-flying-skills
experiment, use:
from neptune_scale import Run
if __name__ == "__main__":
run = Run(experiment_name="seabird-flying-skills")
-
The name can contain any Unicode character, including
/
,.
,:
,;
,&
, and|
. -
The line
if __name__ == "__main__":
ensures safe importing of the main module. For details, see the Python documentation.
Then, to track experiment metadata, call a logging method on the run
object:
for step in epoch:
# your training loop
acc = ...
loss = ...
run.log_metrics(
data={"metrics/accuracy": acc, "metrics/loss": loss},
step=1,
)
For details, see Log metadata.
To get a link to the experiment in the Neptune web app:
run = Run(experiment_name=...)
run.get_experiment_url()
For details, see Construct Neptune URLs.
Set target project
To specify the Neptune project, use the project
argument:
run = Run(
experiment_name="seabird-flying-skills",
project="team-alpha/project-x", # replace with your workspace and project name
)
You can also save the project name as an environment variable. For details, see Get started.
Set custom run ID
To override the auto-generated run identifier with a custom one, pass a string to the run_id
argument:
run = Run(
experiment_name="seabird-flying-skills",
run_id="astute-kittiwake-23",
)
The custom run ID provided to the
run_id
argument must be unique within the project. It can't contain the/
character.
Pass existing ID
If a run with the ID passed to run_id
already exists, Neptune continues logging to that run.
For details, see Resume a run.
View runs in the app
In the All runs tab, by default, Neptune displays the latest run of each experiment.
To show all runs, switch from Experiments to Runs:
You can save your table configuration as a custom view, which makes it easier to work on the runs later.