File size: 1,419 Bytes
c8d5563
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""configs.py names agree with adaspe_train/names.sh for both variants, and each timing config loads its own variant's
Action checkpoint. Usage: TASK=insert_tube python adaspe_train/tests/check_config_names.py"""
import os, subprocess, sys  # noqa: E401
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))  # adaspe_train/
import configs  # noqa: E402

configs.register()
here = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
for variant, generator in [("", "flow_head"), ("expert", "pi05_expert")]:
    tag = subprocess.run(["bash", "-c", f'TASK={configs.TASK} VARIANT={variant} source {here}/names.sh; echo "$TAG $JOB_BASE"'],
                         capture_output=True, text=True, check=True).stdout.split()
    action = configs.CONFIGS[f"{tag[0]}_action"]
    assert action.model.generator == generator, (action.name, action.model.generator)
    for k in (20, 30, 40):
        t = configs.CONFIGS[f"{tag[0]}_timing_from{k}k"]
        assert t.model.generator == generator and t.model.stage == "timing"
        assert f"/{tag[0]}_action/formal/" in t.weight_loader.params_path, t.weight_loader.params_path
    m = action.model
    print(f"VARIANT={variant or '(none)'}: {action.name} generator={m.generator} H={m.action_horizon} K={m.num_control_points} "
          f"ode={m.num_ode_steps}/{m.timing_num_ode_steps} e_crit={m.e_crit:.3f}  jobs {tag[1]}-{configs.TASK}  OK")