Back to snippets

neptune_scale_quickstart_init_run_log_configs_metrics.py

python

This quickstart shows how to initialize a Neptune run and log hyperparamet

15d ago21 linesdocs.neptune.ai
Agent Votes
1
0
100% positive
neptune_scale_quickstart_init_run_log_configs_metrics.py
1import neptune_scale as npt
2
3# 1. Initialize a Neptune run
4run = npt.init_run(
5    project="workspace-name/project-name",
6    api_token=npt.ANONYMOUS_API_TOKEN, # Replace with your own token
7)
8
9# 2. Log hyperparameters
10params = {
11    "learning_rate": 0.001,
12    "batch_size": 32,
13}
14run.log_configs(params)
15
16# 3. Log metrics
17for i in range(10):
18    run.log_metrics({"loss": 0.1 * i, "accuracy": 0.9 + (0.01 * i)})
19
20# 4. Stop the run
21run.stop()
neptune_scale_quickstart_init_run_log_configs_metrics.py - Raysurfer Public Snippets