-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline_run_active_exp.py
41 lines (30 loc) · 1.05 KB
/
pipeline_run_active_exp.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
import opt_mp
import glob
import json
import os
dataset_path = 'r490.csv'
output_path = 'traces/r490'
os.makedirs(output_path, exist_ok=True)
#exp_cfgs = glob.glob("exp_cfgs/*.json")
exp_cfgs = ['exp_cfgs/noisy_easy_constrained.json',
'exp_cfgs/noiseless_hard.json',
'exp_cfgs/noisy_hard.json',
'exp_cfgs/noisy_hard_constrained.json'
]
cfgs = [
'cfgs/pi.json',
'cfgs/ei.json',
'cfgs/greedy.json',
'cfgs/eg.json',
'cfgs/random.json']
for exp_cfg_path in exp_cfgs:
exp_name = os.path.basename(exp_cfg_path).replace(".json","")
for model_cfg_path in cfgs:
cfg_name = os.path.basename(model_cfg_path).replace(".json", "")
print("%s_%s" % (exp_name, cfg_name))
with open(exp_cfg_path, 'r') as f:
exp_cfg = json.load(f)
exp_cfg['n_reps'] = 50
with open(model_cfg_path, 'r') as f:
model_cfg = json.load(f)
opt_mp.main(dataset_path, exp_cfg, model_cfg, "%s/%s_%s.json" % (output_path, exp_name, cfg_name), n_processes=16)