-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexec_mlp.py
More file actions
52 lines (46 loc) · 1.23 KB
/
Copy pathexec_mlp.py
File metadata and controls
52 lines (46 loc) · 1.23 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
from itertools import combinations_with_replacement
import subprocess
import os
base_feats = [4, 8, 16, 32, 64]
feature_sets = [
list(combo)
for r in range(1, 4)
for combo in combinations_with_replacement(base_feats, r)
]
# Directorio de resultados
exp = "seq2pp"
results_dir = f"results/{exp}"
os.makedirs(results_dir, exist_ok=True)
for feats in feature_sets:
# formatear lista de features para Hydra: "[4,8,16]"
feat_str = ",".join(str(f) for f in feats)
# nombre de la corrida
run = f"SMLP_f{'_'.join(str(f) for f in feats)}"
# Training
train_cmd = [
"python3",
"-m",
"src.main",
"model=simplemlp",
f"model.features=[{feat_str}]",
f"exp={exp}",
f"run={run}",
"command=train",
f"train.out_path={results_dir}/{run}",
]
print("→ TRAIN:", " ".join(train_cmd))
subprocess.run(train_cmd, check=True)
# Testing
test_cmd = [
"python3",
"-m",
"src.main",
f"exp={exp}",
f"run={run}",
"model=simplemlp",
f"model.features=[{feat_str}]",
"command=test",
]
print("→ TEST: ", " ".join(test_cmd))
subprocess.run(test_cmd, check=True)