-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_all_sweeps.py
137 lines (132 loc) · 3.29 KB
/
run_all_sweeps.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import wandb
import sys
from baseline_sweep import main
baseline_config = {
'method': 'bayes',
'name': 'PLACEHOLDER',
'metric': {
'name': 'surrogate',
'goal': 'minimize'
},
'command': ['python', 'baseline_sweep.py'],
'parameters': {
'dataset': {
'value': 'PLACEHOLDER'
},
'task': {
'value': 'PLACEHOLDER'
},
'model': {
'value': 'PLACEHOLDER'
},
'lr': {
'values': [0.001, 0.005, 0.01]
},
'margin': {
'max': 0.5,
'min': 0.0
},
'embedding_dim': {
'values': [50, 100, 200]
}
}
}
boxsqel_config = {
"method": "bayes",
'name': 'PLACEHOLDER',
"metric": {
"goal": "minimize",
"name": "surrogate"
},
"parameters": {
"dataset": {
"value": "PLACEHOLDER"
},
"lr": {
"values": [
0.001,
0.005,
0.01
]
},
"lr_schedule": {
"values": [
2000,
10000
]
},
"margin": {
"max": 0.5,
"min": 0.0
},
"neg_dist": {
"distribution": "uniform",
"max": 10.0,
"min": 1.0
},
"num_neg": {
"max": 5,
"min": 1
},
"reg_factor": {
"max": 0.5,
"min": 0.0
},
"task": {
"value": "PLACEHOLDER"
},
'model': {
'value': 'PLACEHOLDER'
},
}
}
boxel_config = {
'method': 'grid',
'name': 'PLACEHOLDER',
'metric': {
'name': 'surrogate',
'goal': 'minimize'
},
'parameters': {
'dataset': {
'value': 'PLACEHOLDER'
},
'task': {
'value': 'PLACEHOLDER'
},
'model': {
'value': 'PLACEHOLDER'
},
'lr': {
'values': [0.001, 0.005, 0.01]
},
'embedding_dim': {
'values': [25, 50, 100, 200]
}
}
}
config = boxel_config
model = 'boxel'
task = 'prediction'
for dataset in ['GALEN', 'GO', 'ANATOMY']:
print(f'Starting sweep {model}-{dataset}-{task}')
config['name'] = f'{model}-{dataset}-{task}'
config['parameters']['dataset']['value'] = dataset
config['parameters']['task']['value'] = task
config['parameters']['model']['value'] = model
sweep_id = wandb.sweep(sweep=config, project='el-baselines')
print(f'Starting agent')
wandb.agent(sweep_id, function=main)
print(f'{model}-{dataset} sweep finished')
# for model in ['elem', 'emelpp', 'elbe']:
# for dataset in ['GALEN', 'GO', 'ANATOMY']:
# task = 'inferences'
# print(f'Starting sweep {model}-{dataset}-{task}')
# config['name'] = f'{model}-{dataset}-{task}'
# config['parameters']['dataset']['value'] = dataset
# config['parameters']['task']['value'] = task
# config['parameters']['model']['value'] = model
# sweep_id = wandb.sweep(sweep=config, project='el-baselines')
# print(f'Starting agent')
# wandb.agent(sweep_id, function=main, count=20)
# print(f'{model}-{dataset} sweep finished')