How specify experiment parameters?

Problem

I saw that Neptune logs experiment parameters.

image

But I don’t know how to specify parameters for my experiments.

Solution

Configuration file

Step 1

Create neptune.yaml config file that has a parameters section:

1
2
3
parameters:
   lr: 0.01
   nr_epochs: 10

Step 2

Run your script pointing to the config you have just created:

1
neptune run --config neptune.yaml main.py 

Command line interface

Run your script as usual, but for every parameter, add --parameter followed by the name:value pair. For example:

1
neptune run --parameter 'lr:0.03' --parameter 'nr_layers:2'  main.py 

Mixed

You can also override parameters specified in the neptune.yaml from the command line or specify some parameters in config and some parameters in the command line. For example:

1
neptune run --config neptune.yaml --parameter 'lr:0.03' --parameter 'dropout:0.3'  main.py 

See also