-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_experiments.py
59 lines (55 loc) · 1.52 KB
/
run_experiments.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
from dotenv import load_dotenv
import sys
import wandb
sys.path.insert(0,'../')
from libs.ssl_dataloader import *
from libs.ssl_model import *
from libs.ssl_utils import *
if __name__ == '__main__':
load_dotenv()
WANDB_API_KEY = os.environ['WANDB_API_KEY']
x_params = {
'sfreq': 128,
'window': 20,
'preprocess': True,
}
train_params={
'num_epochs': 1,
'batch_size': 64,
'print_every': 1,
'learning_rate': 0.00001,
'num_workers': 0,
}
task_params={
'task': 'RelativePositioning',
'sfreq': 128,
'win': 0.5,
'tau_pos': 10,
'tau_neg': 10,
'n_samples': 1,
}
# combine all the parameters into a single config dict for logging
config = {**x_params, **train_params, **task_params}
dataset = HBNRestBIDSDataset(
data_dir = "/mnt/nemar/openneuro/ds004186",
x_params = x_params,
)
config['dataset'] = 'ds004186'
model = VGGSSL()
config['model'] = 'VGGSSL'
wandb.init(
# Set the project where this run will be logged
project="ssl-hbn-rest",
# We pass a run name (otherwise it’ll be randomly assigned, like sunshine-lollypop-10)
# name=f"experiment_{run}",
# Track hyperparameters and run metadata
config=config)
trainer = Trainer(
dataset=dataset,
model=model,
train_params=train_params,
task_params=task_params,
wandb=wandb,
)
trainer.train()