-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_mn_sopt_grad.py
More file actions
40 lines (38 loc) · 1.88 KB
/
_mn_sopt_grad.py
File metadata and controls
40 lines (38 loc) · 1.88 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
from machinable import Interface, get
class _MnSoptGrad(Interface):
def launch(self):
for target in [
"objective",
"constraint",
"objective constraint",
]:
for backbone in ["fttransformer", "resnet"]:
for trial in range(3):
with get("machinable.scope", {"trial": trial}):
e = get(
"interface.sopt_modeling",
[
f"~from_protocol('benchmarks/motoneuron_modeling/config/wide_ranges.yaml')",
{
"dopt_params": {
"dynamic_initial_sampling": "models.ops.dynamic_sampling",
"dynamic_initial_sampling_kwargs": {
"samples_per_iteration": 20,
"max_samples": 1100, # n_initial
"mode": "c+o",
"backbone": backbone,
"feasibility_solving": 5,
"feasibility_targets": target,
"verbose": 1,
},
"n_epochs": 25,
"n_initial": 50, # 50 * 11 = 550 = 1/2 of initial
}
},
f"~joint_model(mode='o', backbone='{backbone}')",
],
).launch()
e.save_attribute(
"model_name",
f"{target}-{backbone}",
)