Deepnote

You can easily execute runs in Deepnote notebooks and log them to Neptune. To do that you need to:

Step 1: Install neptune-client

! pip install neptune-client

Step 2: Set up an environment variable for the API token

Create a new environment variable integration in the left tab where you set the NEPTUNE_API_TOKEN. Alternatively, you can initialize neptune with the API token directly with the snippet:

# Alternative version to initialising Neptune
run = neptune.init(project='', api_token='')

See how to get your Neptune API token here.

Step 3: Replace the project name and log metrics into a Neptune dashboard

import neptune.new as neptune
# The init() function called this way assumes that
# NEPTUNE_API_TOKEN environment variable is defined by the integration.
run = neptune.init(project='my_workspace/my_project',
name='minimal_example')
# Track some metadata and hyperparameters
run["JIRA"] = "NPT-952"
run["algorithm"] = "ConvNet"
params = {
"batch_size": 64,
"dropout": 0.2,
"learning_rate": 0.001,
"optimizer": "Adam"
}
run["parameters"] = params
# Track the training process by logging your training metrics
for epoch in range(100):
run["train/accuracy"].log(epoch * 0.6)
run["train/loss"].log(epoch * 0.4)
# Log the final results
run["f1_score"] = 0.66