-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (26 loc) · 1.02 KB
/
main.py
File metadata and controls
33 lines (26 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import neptune.new as neptune
import argparse
import torch
import os
parser = argparse.ArgumentParser(description="PyTorch CIFAR10 Training")
parser.add_argument("--lr", default=0.1, type=float)
parser.add_argument("--optimizer", default='adamW', type=str)
parser.add_argument("--lambda1", default=1., type=float)
parser.add_argument("--lambda2", default=1., type=float)
parser.add_argument("--lambda3", default=1., type=float)
parser.add_argument("--lambda4", default=1., type=float)
args = parser.parse_args()
run = neptune.init(
project="tutorial-cifar10/CIFAR10",
api_token=os.environ.get('NEPTUNE_API_TOKEN'),
) # your credentials
# save arguments
for key, value in vars(args).items():
run['args/'+key] = value
for epoch in range(10):
run["train/accuracy"].log(1 - 0.9 ** epoch)
run["train/loss"].log(0.9 ** epoch)
run["eval/test_acc"].log(torch.rand((1,)))
## We recommend you to save checkpoints and args to your local directory with a name containing the 'id' of neptune
# id = run.fetch()['sys']['id']
run.stop()