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

1
pip install neptune-client
Copied!

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:
1
# Alternative version to initialising Neptune
2
run = neptune.init(project='<YOUR_WORKSPACE/YOUR_PROJECT>', api_token='<YOUR_API_TOKEN>')
Copied!

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

1
import neptune.new as neptune
2
3
# The init() function called this way assumes that
4
# NEPTUNE_API_TOKEN environment variable is defined by the integration.
5
run = neptune.init(project='my_workspace/my_project',
6
name='minimal_example')
7
8
# Track some metadata and hyperparameters
9
run["JIRA"] = "NPT-952"
10
run["algorithm"] = "ConvNet"
11
12
params = {
13
"batch_size": 64,
14
"dropout": 0.2,
15
"learning_rate": 0.001,
16
"optimizer": "Adam"
17
}
18
run["parameters"] = params
19
20
# Track the training process by logging your training metrics
21
for epoch in range(100):
22
run["train/accuracy"].log(epoch * 0.6)
23
run["train/loss"].log(epoch * 0.4)
24
25
# Log the final results
26
run["f1_score"] = 0.66
Copied!
Last modified 3mo ago