ODE-MLP: 15 tasks (6 pause-trimmed b512-trim3f + 9 earlier tasks), 5000 steps from scratch, seed 42, step-005000 only (A800 2026-11-27)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- a10-trolley-push-v3/b512/step-005000/SHA256SUMS +29 -0
- a10-trolley-push-v3/b512/step-005000/config.json +1324 -0
- a10-trolley-push-v3/b512/step-005000/model.pt +3 -0
- a10-trolley-push-v3/b512/step-005000/protocol.json +241 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_commit.txt +2 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py +163 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/__init__.py +13 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/act_nets.py +615 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/adapters.py +58 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py +114 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_parity.py +141 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/data.py +415 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/flash.py +412 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py +99 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/inloop.py +117 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/nets.py +212 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/ode_nets.py +181 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/policies.py +459 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.lock.txt +61 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.txt +15 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/runtime.py +179 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/train.py +923 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/policy/ODEMLP/deploy.yml +36 -0
- a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/policy/ODEMLP/model.py +12 -0
- a10-trolley-push-v3/b512/step-005000/training_records/inloop-mse.jsonl +20 -0
- a10-trolley-push-v3/b512/step-005000/training_records/launch.sh +9 -0
- a10-trolley-push-v3/b512/step-005000/training_records/pip_freeze_hb-baselines.txt +58 -0
- a10-trolley-push-v3/b512/step-005000/training_records/run.json +1340 -0
- a10-trolley-push-v3/b512/step-005000/training_records/train.log +135 -0
- a10-trolley-push-v3/b512/step-005000/training_records/train_log.jsonl +106 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/SHA256SUMS +29 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/config.json +1432 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/model.pt +3 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/protocol.json +241 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_commit.txt +2 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py +163 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/__init__.py +13 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/act_nets.py +615 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/adapters.py +58 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py +114 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_parity.py +141 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/data.py +415 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/flash.py +412 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py +99 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/inloop.py +117 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/nets.py +212 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/ode_nets.py +181 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/policies.py +459 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.lock.txt +61 -0
- a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.txt +15 -0
a10-trolley-push-v3/b512/step-005000/SHA256SUMS
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
93fa4af8336a345caf7085c959a3ad474b99eba770ba0dd7c0a373516255a8bc config.json
|
| 2 |
+
bf855ba020981d652552c5e5233cae80a9b905f85ae1eefaeac94e5f7edb7464 model.pt
|
| 3 |
+
07a7a0f87602b324e76c69910f09c0f24227034612aa3519cda444ff6e72589c protocol.json
|
| 4 |
+
2bd274128b9cc8d9a4b574220e19f456b6c33858b7a180583691ca8458a626f8 training_records/code_commit.txt
|
| 5 |
+
9f7713cea4f846efcfc924234267ced48210357f419d67915c10b504316bedde training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py
|
| 6 |
+
bfbb52f85ac5d91e37f3cfc24bb8671de447b5b566760bfe091204ae69e1f7f6 training_records/code_d2096858/evaluation/baselines/__init__.py
|
| 7 |
+
3db95cd8e4e436875e11f1054a99d250ca7d94e0127909090b58730402340f19 training_records/code_d2096858/evaluation/baselines/act_nets.py
|
| 8 |
+
87e47332381fcb34e75d08cb258475c200519cb5cf17fd0e218bf2a1b21fa890 training_records/code_d2096858/evaluation/baselines/adapters.py
|
| 9 |
+
aa7fc175f50de83b130427cc30533a45220e70d0ed8c807f33ca44d39cb9fb81 training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py
|
| 10 |
+
91f714aa3b7ec6b5c28764496163671cadabe4a833c0b06b6bc4c155cec7f66f training_records/code_d2096858/evaluation/baselines/check_flash_parity.py
|
| 11 |
+
c8b0817f7fe3bdec71b13e94a2e2fea231e0c6c05bd16614b564419ff024e8e2 training_records/code_d2096858/evaluation/baselines/data.py
|
| 12 |
+
35c01a4e2edd80f85878b37928069c09ed3238127bbb51a5443e7f1c92703e53 training_records/code_d2096858/evaluation/baselines/flash.py
|
| 13 |
+
c987d9e641f5e5266703a8154b708d9ccab203b06d5ab82774d39a1cba602d62 training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py
|
| 14 |
+
0e6343d7d28893c4107864b943193eb4a402cf97b1625e94eb2acb1d163ca85c training_records/code_d2096858/evaluation/baselines/inloop.py
|
| 15 |
+
2d72e3c455d5e376a6f5954886fd4c7a6478eb516380c6a05515fa043c62fbce training_records/code_d2096858/evaluation/baselines/nets.py
|
| 16 |
+
38f2ea6050fa45e6c0d5e3f19caf21f1a72a50f80e356044dddcf76da22b144a training_records/code_d2096858/evaluation/baselines/ode_nets.py
|
| 17 |
+
74ca169fe453f64bf6ffc3f3a85a4208aed2961d0abd9eb3e92b96457f86daf1 training_records/code_d2096858/evaluation/baselines/policies.py
|
| 18 |
+
4b79b9dcc98f05bfe7bc9e64e3492f4565728f6d1f75cbdecc1c817d03ff32a5 training_records/code_d2096858/evaluation/baselines/requirements.lock.txt
|
| 19 |
+
56a8db94a98c5256028b475d9a0293cdee4cf475e415df763b3a0232433663ba training_records/code_d2096858/evaluation/baselines/requirements.txt
|
| 20 |
+
8cd8963bb87cdc453293a369658c97a97aadbef77281538d8a4c484925af00c5 training_records/code_d2096858/evaluation/baselines/runtime.py
|
| 21 |
+
cd74f1af7a382eea1903cc20142a19e82b06fe99dd03d5e75a9a42f0ae8ecf04 training_records/code_d2096858/evaluation/baselines/train.py
|
| 22 |
+
2c58049b2fca0406dce9adb4716412371ebe9fead24e4dbd751e10a5d78fcf7d training_records/code_d2096858/evaluation/policy/ODEMLP/deploy.yml
|
| 23 |
+
71f82a6b7c4802c87489a37c80c47b39492e2c4a35fe58fd544eee341e339d0e training_records/code_d2096858/evaluation/policy/ODEMLP/model.py
|
| 24 |
+
5bb85e00dc510a4fb7e18dca7ad0b1c7ca13f040c36e1d6ef7959007ce49ffcf training_records/inloop-mse.jsonl
|
| 25 |
+
d497d5fe09b104d02bdd5448fd7b663aa0ee169a472e503bb125e5abdda6c869 training_records/launch.sh
|
| 26 |
+
72942d6f1c95ab99ba51fcf641bfd0e4cb34943c5b19a2a39d8da72ef5daa6b2 training_records/pip_freeze_hb-baselines.txt
|
| 27 |
+
7cf58ef54082175356e467e4bdb6b038a9edd64ebfbd3344ac32478a75a906ae training_records/run.json
|
| 28 |
+
1f98168eb8c804d6b85c4c8ec030c8f4dd9b0b1a100e44d9792c11299d54339e training_records/train.log
|
| 29 |
+
834c18b280175220f6fc95721022fb846ac26ced0aa5c7e915b0f634fea1efb2 training_records/train_log.jsonl
|
a10-trolley-push-v3/b512/step-005000/config.json
ADDED
|
@@ -0,0 +1,1324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"policy": {
|
| 3 |
+
"policy": "ode_mlp",
|
| 4 |
+
"n_cameras": 2,
|
| 5 |
+
"state_dim": 44,
|
| 6 |
+
"action_dim": 76,
|
| 7 |
+
"horizon": 16,
|
| 8 |
+
"backbone": "resnet18",
|
| 9 |
+
"backbone_weights": null,
|
| 10 |
+
"backbone_norm": "group",
|
| 11 |
+
"hidden_dim": 384,
|
| 12 |
+
"num_layers": 4,
|
| 13 |
+
"num_heads": 8,
|
| 14 |
+
"mlp_ratio": 4.0,
|
| 15 |
+
"dropout": 0.1,
|
| 16 |
+
"time_embed_dim": 128,
|
| 17 |
+
"num_inference_steps": null,
|
| 18 |
+
"num_train_timesteps": 100,
|
| 19 |
+
"beta_schedule": "squaredcos_cap_v2",
|
| 20 |
+
"prediction_type": "epsilon",
|
| 21 |
+
"clip_sample": true,
|
| 22 |
+
"act_hidden_dim": 512,
|
| 23 |
+
"dim_feedforward": 3200,
|
| 24 |
+
"enc_layers": 4,
|
| 25 |
+
"dec_layers": 7,
|
| 26 |
+
"nheads": 8,
|
| 27 |
+
"latent_dim": 32,
|
| 28 |
+
"kl_weight": 10.0,
|
| 29 |
+
"ode_body_dim": 64,
|
| 30 |
+
"ode_width": 512,
|
| 31 |
+
"ode_layers": 4,
|
| 32 |
+
"ode_cond_dim": 512,
|
| 33 |
+
"ode_field_scale": 1.0,
|
| 34 |
+
"ode_dit_hidden": 512,
|
| 35 |
+
"ode_dit_layers": 4,
|
| 36 |
+
"ode_dit_heads": 8,
|
| 37 |
+
"ode_dit_tokens": 4,
|
| 38 |
+
"extra": {}
|
| 39 |
+
},
|
| 40 |
+
"contract": {
|
| 41 |
+
"name": "g1_sonic_dfx6",
|
| 42 |
+
"robot": "g1",
|
| 43 |
+
"cameras": [
|
| 44 |
+
"ego_view",
|
| 45 |
+
"chest"
|
| 46 |
+
],
|
| 47 |
+
"state": [
|
| 48 |
+
[
|
| 49 |
+
"observation.state",
|
| 50 |
+
0,
|
| 51 |
+
29
|
| 52 |
+
],
|
| 53 |
+
[
|
| 54 |
+
"observation.inspire_left_hand_state",
|
| 55 |
+
0,
|
| 56 |
+
6
|
| 57 |
+
],
|
| 58 |
+
[
|
| 59 |
+
"observation.inspire_right_hand_state",
|
| 60 |
+
0,
|
| 61 |
+
6
|
| 62 |
+
],
|
| 63 |
+
[
|
| 64 |
+
"observation.projected_gravity",
|
| 65 |
+
0,
|
| 66 |
+
3
|
| 67 |
+
]
|
| 68 |
+
],
|
| 69 |
+
"action": [
|
| 70 |
+
[
|
| 71 |
+
"action.motion_token",
|
| 72 |
+
0,
|
| 73 |
+
64
|
| 74 |
+
],
|
| 75 |
+
[
|
| 76 |
+
"observation.inspire_left_hand_state",
|
| 77 |
+
0,
|
| 78 |
+
6
|
| 79 |
+
],
|
| 80 |
+
[
|
| 81 |
+
"observation.inspire_right_hand_state",
|
| 82 |
+
0,
|
| 83 |
+
6
|
| 84 |
+
]
|
| 85 |
+
],
|
| 86 |
+
"state_dim": 44,
|
| 87 |
+
"action_dim": 76,
|
| 88 |
+
"action_space": "sonic_dfx6",
|
| 89 |
+
"body_dims": 29
|
| 90 |
+
},
|
| 91 |
+
"image_hw": [
|
| 92 |
+
168,
|
| 93 |
+
224
|
| 94 |
+
],
|
| 95 |
+
"task_text": "Walk naturally to the purple platform trolley with open hands, approach its handle slowly and directly, grasp with both hands, then push straight until the platform is alongside the cardboard box ahead and to the side, stop, open both hands and withdraw slightly from the handle.",
|
| 96 |
+
"dataset": {
|
| 97 |
+
"name": "data",
|
| 98 |
+
"root": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/a10-trolley-push-v3-6e410c5/data",
|
| 99 |
+
"robot_type": null,
|
| 100 |
+
"fps": 30.0,
|
| 101 |
+
"episodes": [
|
| 102 |
+
0,
|
| 103 |
+
1,
|
| 104 |
+
2,
|
| 105 |
+
3,
|
| 106 |
+
4,
|
| 107 |
+
5,
|
| 108 |
+
6,
|
| 109 |
+
7,
|
| 110 |
+
8,
|
| 111 |
+
9,
|
| 112 |
+
10,
|
| 113 |
+
11,
|
| 114 |
+
12,
|
| 115 |
+
13,
|
| 116 |
+
14,
|
| 117 |
+
15,
|
| 118 |
+
16,
|
| 119 |
+
17,
|
| 120 |
+
18,
|
| 121 |
+
19,
|
| 122 |
+
20,
|
| 123 |
+
21,
|
| 124 |
+
22,
|
| 125 |
+
23,
|
| 126 |
+
24,
|
| 127 |
+
25,
|
| 128 |
+
26,
|
| 129 |
+
27,
|
| 130 |
+
28,
|
| 131 |
+
29,
|
| 132 |
+
30,
|
| 133 |
+
31,
|
| 134 |
+
32,
|
| 135 |
+
33,
|
| 136 |
+
34,
|
| 137 |
+
35,
|
| 138 |
+
36,
|
| 139 |
+
37,
|
| 140 |
+
38,
|
| 141 |
+
39,
|
| 142 |
+
40,
|
| 143 |
+
41,
|
| 144 |
+
42,
|
| 145 |
+
43,
|
| 146 |
+
44,
|
| 147 |
+
45,
|
| 148 |
+
46,
|
| 149 |
+
47,
|
| 150 |
+
48,
|
| 151 |
+
49,
|
| 152 |
+
50,
|
| 153 |
+
51,
|
| 154 |
+
52,
|
| 155 |
+
53,
|
| 156 |
+
54,
|
| 157 |
+
55,
|
| 158 |
+
56,
|
| 159 |
+
57,
|
| 160 |
+
58,
|
| 161 |
+
59,
|
| 162 |
+
60,
|
| 163 |
+
61,
|
| 164 |
+
62,
|
| 165 |
+
63,
|
| 166 |
+
64,
|
| 167 |
+
65,
|
| 168 |
+
66,
|
| 169 |
+
67,
|
| 170 |
+
68,
|
| 171 |
+
69,
|
| 172 |
+
70,
|
| 173 |
+
71,
|
| 174 |
+
72,
|
| 175 |
+
73,
|
| 176 |
+
74,
|
| 177 |
+
75,
|
| 178 |
+
76,
|
| 179 |
+
77,
|
| 180 |
+
78,
|
| 181 |
+
79,
|
| 182 |
+
80,
|
| 183 |
+
81,
|
| 184 |
+
82,
|
| 185 |
+
83,
|
| 186 |
+
84,
|
| 187 |
+
85,
|
| 188 |
+
86,
|
| 189 |
+
87,
|
| 190 |
+
88,
|
| 191 |
+
89,
|
| 192 |
+
90,
|
| 193 |
+
91,
|
| 194 |
+
92,
|
| 195 |
+
93,
|
| 196 |
+
94,
|
| 197 |
+
95,
|
| 198 |
+
96,
|
| 199 |
+
97,
|
| 200 |
+
98,
|
| 201 |
+
99,
|
| 202 |
+
100,
|
| 203 |
+
101,
|
| 204 |
+
102,
|
| 205 |
+
103,
|
| 206 |
+
104,
|
| 207 |
+
105,
|
| 208 |
+
106,
|
| 209 |
+
107,
|
| 210 |
+
108,
|
| 211 |
+
109,
|
| 212 |
+
110,
|
| 213 |
+
111,
|
| 214 |
+
112,
|
| 215 |
+
113,
|
| 216 |
+
114,
|
| 217 |
+
115,
|
| 218 |
+
116,
|
| 219 |
+
117,
|
| 220 |
+
118,
|
| 221 |
+
119,
|
| 222 |
+
120,
|
| 223 |
+
121,
|
| 224 |
+
122,
|
| 225 |
+
123,
|
| 226 |
+
124,
|
| 227 |
+
125,
|
| 228 |
+
126,
|
| 229 |
+
127,
|
| 230 |
+
128,
|
| 231 |
+
129,
|
| 232 |
+
130,
|
| 233 |
+
131,
|
| 234 |
+
132,
|
| 235 |
+
133,
|
| 236 |
+
134,
|
| 237 |
+
135,
|
| 238 |
+
136,
|
| 239 |
+
137,
|
| 240 |
+
138,
|
| 241 |
+
139,
|
| 242 |
+
140,
|
| 243 |
+
141,
|
| 244 |
+
142,
|
| 245 |
+
143,
|
| 246 |
+
144,
|
| 247 |
+
145,
|
| 248 |
+
146,
|
| 249 |
+
147
|
| 250 |
+
],
|
| 251 |
+
"train_episodes": [
|
| 252 |
+
0,
|
| 253 |
+
1,
|
| 254 |
+
2,
|
| 255 |
+
3,
|
| 256 |
+
4,
|
| 257 |
+
5,
|
| 258 |
+
6,
|
| 259 |
+
7,
|
| 260 |
+
8,
|
| 261 |
+
9,
|
| 262 |
+
10,
|
| 263 |
+
11,
|
| 264 |
+
12,
|
| 265 |
+
13,
|
| 266 |
+
14,
|
| 267 |
+
15,
|
| 268 |
+
16,
|
| 269 |
+
17,
|
| 270 |
+
18,
|
| 271 |
+
19,
|
| 272 |
+
20,
|
| 273 |
+
21,
|
| 274 |
+
22,
|
| 275 |
+
23,
|
| 276 |
+
24,
|
| 277 |
+
25,
|
| 278 |
+
26,
|
| 279 |
+
27,
|
| 280 |
+
28,
|
| 281 |
+
29,
|
| 282 |
+
30,
|
| 283 |
+
31,
|
| 284 |
+
32,
|
| 285 |
+
33,
|
| 286 |
+
34,
|
| 287 |
+
35,
|
| 288 |
+
36,
|
| 289 |
+
37,
|
| 290 |
+
38,
|
| 291 |
+
39,
|
| 292 |
+
40,
|
| 293 |
+
41,
|
| 294 |
+
42,
|
| 295 |
+
43,
|
| 296 |
+
44,
|
| 297 |
+
45,
|
| 298 |
+
46,
|
| 299 |
+
47,
|
| 300 |
+
48,
|
| 301 |
+
49,
|
| 302 |
+
50,
|
| 303 |
+
51,
|
| 304 |
+
52,
|
| 305 |
+
53,
|
| 306 |
+
54,
|
| 307 |
+
55,
|
| 308 |
+
56,
|
| 309 |
+
57,
|
| 310 |
+
58,
|
| 311 |
+
59,
|
| 312 |
+
60,
|
| 313 |
+
61,
|
| 314 |
+
62,
|
| 315 |
+
63,
|
| 316 |
+
64,
|
| 317 |
+
65,
|
| 318 |
+
66,
|
| 319 |
+
67,
|
| 320 |
+
68,
|
| 321 |
+
69,
|
| 322 |
+
70,
|
| 323 |
+
71,
|
| 324 |
+
72,
|
| 325 |
+
73,
|
| 326 |
+
74,
|
| 327 |
+
75,
|
| 328 |
+
76,
|
| 329 |
+
77,
|
| 330 |
+
78,
|
| 331 |
+
79,
|
| 332 |
+
80,
|
| 333 |
+
81,
|
| 334 |
+
82,
|
| 335 |
+
83,
|
| 336 |
+
84,
|
| 337 |
+
85,
|
| 338 |
+
86,
|
| 339 |
+
87,
|
| 340 |
+
88,
|
| 341 |
+
89,
|
| 342 |
+
90,
|
| 343 |
+
91,
|
| 344 |
+
92,
|
| 345 |
+
93,
|
| 346 |
+
94,
|
| 347 |
+
95,
|
| 348 |
+
96,
|
| 349 |
+
97,
|
| 350 |
+
98,
|
| 351 |
+
99,
|
| 352 |
+
100,
|
| 353 |
+
101,
|
| 354 |
+
102,
|
| 355 |
+
103,
|
| 356 |
+
104,
|
| 357 |
+
105,
|
| 358 |
+
106,
|
| 359 |
+
107,
|
| 360 |
+
108,
|
| 361 |
+
109,
|
| 362 |
+
110,
|
| 363 |
+
111,
|
| 364 |
+
112,
|
| 365 |
+
113,
|
| 366 |
+
114,
|
| 367 |
+
115,
|
| 368 |
+
116,
|
| 369 |
+
117,
|
| 370 |
+
118,
|
| 371 |
+
119,
|
| 372 |
+
120,
|
| 373 |
+
121,
|
| 374 |
+
122,
|
| 375 |
+
123,
|
| 376 |
+
124,
|
| 377 |
+
125,
|
| 378 |
+
126,
|
| 379 |
+
127,
|
| 380 |
+
128,
|
| 381 |
+
129,
|
| 382 |
+
130,
|
| 383 |
+
131,
|
| 384 |
+
132,
|
| 385 |
+
133,
|
| 386 |
+
134,
|
| 387 |
+
135,
|
| 388 |
+
136,
|
| 389 |
+
137,
|
| 390 |
+
138,
|
| 391 |
+
139,
|
| 392 |
+
140,
|
| 393 |
+
141,
|
| 394 |
+
142,
|
| 395 |
+
143,
|
| 396 |
+
144,
|
| 397 |
+
145,
|
| 398 |
+
146,
|
| 399 |
+
147
|
| 400 |
+
],
|
| 401 |
+
"val_episodes": [],
|
| 402 |
+
"train_frames": 125290,
|
| 403 |
+
"git_commit": "d60c56c996a71c5df11fb93115792440da5092aa"
|
| 404 |
+
},
|
| 405 |
+
"training": {
|
| 406 |
+
"steps": 5000,
|
| 407 |
+
"batch_size": 512,
|
| 408 |
+
"lr": 0.0001,
|
| 409 |
+
"betas": [
|
| 410 |
+
0.95,
|
| 411 |
+
0.999
|
| 412 |
+
],
|
| 413 |
+
"weight_decay": 1e-06,
|
| 414 |
+
"warmup": 500,
|
| 415 |
+
"schedule": "diffusers_cosine",
|
| 416 |
+
"backbone_lr_scale": 1.0,
|
| 417 |
+
"ema": 0.9999,
|
| 418 |
+
"shift_px": 0,
|
| 419 |
+
"amp": true,
|
| 420 |
+
"seed": 42,
|
| 421 |
+
"augmentation": {
|
| 422 |
+
"spec": "docs/augmentation_v2.md",
|
| 423 |
+
"version": "hb-aug-v2-20261109",
|
| 424 |
+
"implementation": "evaluation/augmentation/hb_aug_v2.py",
|
| 425 |
+
"visual": {
|
| 426 |
+
"effects": [
|
| 427 |
+
"exposure",
|
| 428 |
+
"contrast",
|
| 429 |
+
"saturation",
|
| 430 |
+
"hue",
|
| 431 |
+
"gamma",
|
| 432 |
+
"temperature",
|
| 433 |
+
"rotation_crop",
|
| 434 |
+
"noise",
|
| 435 |
+
"gaussian_blur",
|
| 436 |
+
"jpeg",
|
| 437 |
+
"motion_blur",
|
| 438 |
+
"sharpen",
|
| 439 |
+
"defocus",
|
| 440 |
+
"light_shadow",
|
| 441 |
+
"wb_channel"
|
| 442 |
+
],
|
| 443 |
+
"boosted_per_sample": 1,
|
| 444 |
+
"boost": 1.5,
|
| 445 |
+
"pixel_scale": "H / 224",
|
| 446 |
+
"future_targets": "none (one observation frame)"
|
| 447 |
+
},
|
| 448 |
+
"proprio": {
|
| 449 |
+
"robot": "g1",
|
| 450 |
+
"body_dims": 29,
|
| 451 |
+
"bias_deg": 2.0,
|
| 452 |
+
"bias_scope": "per_sample",
|
| 453 |
+
"noise_deg": 0.25,
|
| 454 |
+
"noise_clip_sigma": 3,
|
| 455 |
+
"delay_probability": 0.0,
|
| 456 |
+
"history_drop_probability": 0.0,
|
| 457 |
+
"velocity": false
|
| 458 |
+
},
|
| 459 |
+
"native_image_augmentation": "off",
|
| 460 |
+
"evaluation": "off"
|
| 461 |
+
},
|
| 462 |
+
"preflight": {
|
| 463 |
+
"samples": 64,
|
| 464 |
+
"state_dim": 44,
|
| 465 |
+
"body_dims": 29,
|
| 466 |
+
"images_changed": 64,
|
| 467 |
+
"body_values_moved": 1.0,
|
| 468 |
+
"max_body_offset_deg": 2.5974,
|
| 469 |
+
"actions_bit_identical": true,
|
| 470 |
+
"non_body_state_bit_identical": true,
|
| 471 |
+
"eval_items_deterministic": 8
|
| 472 |
+
},
|
| 473 |
+
"aug_seed": 42,
|
| 474 |
+
"layout": {
|
| 475 |
+
"nodes": 1,
|
| 476 |
+
"gpus": 1,
|
| 477 |
+
"per_gpu_batch": 512,
|
| 478 |
+
"global_batch": 512,
|
| 479 |
+
"gradient_accumulation": 1,
|
| 480 |
+
"num_workers": 32,
|
| 481 |
+
"prefetch": 2
|
| 482 |
+
},
|
| 483 |
+
"continuation": null,
|
| 484 |
+
"total_steps": 5000,
|
| 485 |
+
"save_steps": [
|
| 486 |
+
750,
|
| 487 |
+
1750,
|
| 488 |
+
2500,
|
| 489 |
+
3250,
|
| 490 |
+
4250,
|
| 491 |
+
5000
|
| 492 |
+
],
|
| 493 |
+
"save_rule": "6 checkpoints spread evenly over the steps on the 250-step grid (owner 2026-11-27)",
|
| 494 |
+
"protocol_exceptions": [],
|
| 495 |
+
"ema_schedule": "diffusion_policy_emamodel",
|
| 496 |
+
"inloop": {
|
| 497 |
+
"task": "a10v3",
|
| 498 |
+
"code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse",
|
| 499 |
+
"every": 250,
|
| 500 |
+
"exception": null,
|
| 501 |
+
"code_sha256": {
|
| 502 |
+
"hb_inloop_core.py": "6c7c160f05cc624eeebd0721c5241b52d2b6b64ac25cd1e9fd72e0b8a6aca8e6",
|
| 503 |
+
"hb_eval_common.py": "c26efcb8e6c49be8b5883ec187e5b7292bd19d81c4442ba5ee1ba35e9bb8c8a6"
|
| 504 |
+
}
|
| 505 |
+
},
|
| 506 |
+
"protocol_recipe": {
|
| 507 |
+
"batch_size": 512,
|
| 508 |
+
"steps": 5000,
|
| 509 |
+
"warmup": 500,
|
| 510 |
+
"workers": 32,
|
| 511 |
+
"long_task_factor": 1
|
| 512 |
+
},
|
| 513 |
+
"protocol_deviations": [],
|
| 514 |
+
"environment": {
|
| 515 |
+
"python": "3.12.12",
|
| 516 |
+
"torch": "2.9.0+cu128",
|
| 517 |
+
"numpy": "2.2.6",
|
| 518 |
+
"cuda": "12.8",
|
| 519 |
+
"cudnn": 91002,
|
| 520 |
+
"torchvision": "0.24.0+cu128",
|
| 521 |
+
"pillow": "13.0.0",
|
| 522 |
+
"gpu": "NVIDIA A800-SXM4-80GB",
|
| 523 |
+
"driver": "570.133.20"
|
| 524 |
+
},
|
| 525 |
+
"code_dirty": null,
|
| 526 |
+
"allow_dirty_tree": false,
|
| 527 |
+
"augmentation_sha256": "9f7713cea4f846efcfc924234267ced48210357f419d67915c10b504316bedde",
|
| 528 |
+
"order": "EpochSampler: default_rng([seed, 1, epoch]) permutation; augmentation default_rng([aug_seed, draw])",
|
| 529 |
+
"upstream": "NTUMARS/ODE-POLICY real-g1@fd8bec47 (G1 port, HumanWAM packages/ode_g1) + main@cea26d94 (encoder, ode_dit field, default_train.yaml)"
|
| 530 |
+
},
|
| 531 |
+
"stats": {
|
| 532 |
+
"state": {
|
| 533 |
+
"min": [
|
| 534 |
+
-0.5649979114532471,
|
| 535 |
+
-0.13802263140678406,
|
| 536 |
+
-0.1670541912317276,
|
| 537 |
+
0.12547282874584198,
|
| 538 |
+
-0.7361007332801819,
|
| 539 |
+
-0.21955746412277222,
|
| 540 |
+
-0.5882344245910645,
|
| 541 |
+
-0.3116748631000519,
|
| 542 |
+
-0.46413329243659973,
|
| 543 |
+
0.11360634118318558,
|
| 544 |
+
-0.5077619552612305,
|
| 545 |
+
-0.1829676479101181,
|
| 546 |
+
-0.10724634677171707,
|
| 547 |
+
-0.08531239628791809,
|
| 548 |
+
-0.018562935292720795,
|
| 549 |
+
-0.7220436334609985,
|
| 550 |
+
-0.18919637799263,
|
| 551 |
+
-0.6303816437721252,
|
| 552 |
+
-0.6336395144462585,
|
| 553 |
+
0.6115855574607849,
|
| 554 |
+
-0.3079671561717987,
|
| 555 |
+
-0.6135874390602112,
|
| 556 |
+
-0.7832939028739929,
|
| 557 |
+
-0.5058244466781616,
|
| 558 |
+
-0.2831243574619293,
|
| 559 |
+
-0.6437979936599731,
|
| 560 |
+
-1.6898001432418823,
|
| 561 |
+
-0.19531497359275818,
|
| 562 |
+
-0.41606205701828003,
|
| 563 |
+
0.28926292061805725,
|
| 564 |
+
0.2978215515613556,
|
| 565 |
+
0.2999863028526306,
|
| 566 |
+
0.3241505026817322,
|
| 567 |
+
0.4532031714916229,
|
| 568 |
+
0.0,
|
| 569 |
+
0.28560081124305725,
|
| 570 |
+
0.2877190411090851,
|
| 571 |
+
0.2999747097492218,
|
| 572 |
+
0.3188680410385132,
|
| 573 |
+
0.2645348310470581,
|
| 574 |
+
0.0,
|
| 575 |
+
-0.20698592066764832,
|
| 576 |
+
-0.09532465785741806,
|
| 577 |
+
-1.0
|
| 578 |
+
],
|
| 579 |
+
"max": [
|
| 580 |
+
0.309661328792572,
|
| 581 |
+
0.379180908203125,
|
| 582 |
+
0.3793095648288727,
|
| 583 |
+
1.2328346967697144,
|
| 584 |
+
0.47058796882629395,
|
| 585 |
+
0.15291371941566467,
|
| 586 |
+
0.19136027991771698,
|
| 587 |
+
0.15236611664295197,
|
| 588 |
+
-0.015697233378887177,
|
| 589 |
+
1.1718807220458984,
|
| 590 |
+
0.5186899304389954,
|
| 591 |
+
0.14761242270469666,
|
| 592 |
+
0.1112193688750267,
|
| 593 |
+
0.0773688405752182,
|
| 594 |
+
0.1617131233215332,
|
| 595 |
+
1.00409996509552,
|
| 596 |
+
0.8376004099845886,
|
| 597 |
+
0.5049045085906982,
|
| 598 |
+
0.8701820969581604,
|
| 599 |
+
1.5639278888702393,
|
| 600 |
+
0.5088244676589966,
|
| 601 |
+
0.17580963671207428,
|
| 602 |
+
1.0189212560653687,
|
| 603 |
+
0.14113207161426544,
|
| 604 |
+
1.1240776777267456,
|
| 605 |
+
0.9259319305419922,
|
| 606 |
+
-0.5317077040672302,
|
| 607 |
+
0.5406411290168762,
|
| 608 |
+
0.2410225123167038,
|
| 609 |
+
0.9997925758361816,
|
| 610 |
+
1.0,
|
| 611 |
+
1.0,
|
| 612 |
+
1.0,
|
| 613 |
+
1.0,
|
| 614 |
+
0.9993118047714233,
|
| 615 |
+
1.0,
|
| 616 |
+
0.999999463558197,
|
| 617 |
+
1.0,
|
| 618 |
+
1.0,
|
| 619 |
+
1.0,
|
| 620 |
+
1.0,
|
| 621 |
+
0.1430673897266388,
|
| 622 |
+
0.1608637273311615,
|
| 623 |
+
-0.9776055812835693
|
| 624 |
+
],
|
| 625 |
+
"mean": [
|
| 626 |
+
-0.03259149700071818,
|
| 627 |
+
0.10292444149082529,
|
| 628 |
+
0.14249111690247215,
|
| 629 |
+
0.2586853334339307,
|
| 630 |
+
-0.13208746169373772,
|
| 631 |
+
-0.04728850229841452,
|
| 632 |
+
-0.057759515038012764,
|
| 633 |
+
-0.06284486123386064,
|
| 634 |
+
-0.2184019612651195,
|
| 635 |
+
0.2452933834388023,
|
| 636 |
+
-0.11712754842266818,
|
| 637 |
+
0.0048785726169163915,
|
| 638 |
+
-0.004230145816850251,
|
| 639 |
+
0.003071327284655127,
|
| 640 |
+
0.09238250920443919,
|
| 641 |
+
0.1588980504213021,
|
| 642 |
+
0.1931384421498494,
|
| 643 |
+
-0.1042624106421826,
|
| 644 |
+
-0.07162919313633376,
|
| 645 |
+
1.2364839745900875,
|
| 646 |
+
0.11456040760956449,
|
| 647 |
+
-0.02982258333000492,
|
| 648 |
+
0.12297573380987696,
|
| 649 |
+
-0.1314084334755782,
|
| 650 |
+
0.2841458952024311,
|
| 651 |
+
-0.024690842999814416,
|
| 652 |
+
-1.2646153851212503,
|
| 653 |
+
0.13921934353286197,
|
| 654 |
+
-0.0051523384937139476,
|
| 655 |
+
0.7584627563567199,
|
| 656 |
+
0.7347248990636687,
|
| 657 |
+
0.7359466597474728,
|
| 658 |
+
0.7434046703440507,
|
| 659 |
+
0.8677225796256197,
|
| 660 |
+
0.18050129081743033,
|
| 661 |
+
0.7157243621259897,
|
| 662 |
+
0.7192522151209102,
|
| 663 |
+
0.7318337730585849,
|
| 664 |
+
0.7466828414938838,
|
| 665 |
+
0.8631709350224399,
|
| 666 |
+
0.18055928431852253,
|
| 667 |
+
-0.042149546611078066,
|
| 668 |
+
0.009104512566997977,
|
| 669 |
+
-0.9984240542430339
|
| 670 |
+
],
|
| 671 |
+
"std": [
|
| 672 |
+
0.14332528920223156,
|
| 673 |
+
0.050326975118008516,
|
| 674 |
+
0.05447536225043596,
|
| 675 |
+
0.18542866648901002,
|
| 676 |
+
0.09795413152590728,
|
| 677 |
+
0.040414279934421656,
|
| 678 |
+
0.1314410589437231,
|
| 679 |
+
0.04705665020366312,
|
| 680 |
+
0.05069233811524638,
|
| 681 |
+
0.15587224743782863,
|
| 682 |
+
0.08590396003577097,
|
| 683 |
+
0.045061991383975486,
|
| 684 |
+
0.021383485564564507,
|
| 685 |
+
0.014773382285823268,
|
| 686 |
+
0.023373377725290283,
|
| 687 |
+
0.3311819219220262,
|
| 688 |
+
0.10532448629122226,
|
| 689 |
+
0.12440342036807371,
|
| 690 |
+
0.3243145748636537,
|
| 691 |
+
0.10518505753045373,
|
| 692 |
+
0.08286589309217163,
|
| 693 |
+
0.07242343474690907,
|
| 694 |
+
0.3441978307840592,
|
| 695 |
+
0.1108561220333568,
|
| 696 |
+
0.17804600736368034,
|
| 697 |
+
0.32602324245623393,
|
| 698 |
+
0.1009863076683941,
|
| 699 |
+
0.05984207969250063,
|
| 700 |
+
0.05603953470424581,
|
| 701 |
+
0.28970257569536595,
|
| 702 |
+
0.30400373906907074,
|
| 703 |
+
0.3010014700359181,
|
| 704 |
+
0.29230853834349046,
|
| 705 |
+
0.17118303819521438,
|
| 706 |
+
0.3785607898211561,
|
| 707 |
+
0.3253747707974398,
|
| 708 |
+
0.32108122353058915,
|
| 709 |
+
0.3064997790556862,
|
| 710 |
+
0.2895646717445341,
|
| 711 |
+
0.17312796927521015,
|
| 712 |
+
0.37853011602794057,
|
| 713 |
+
0.029836058972889025,
|
| 714 |
+
0.01995769633452533,
|
| 715 |
+
0.0011964531867846406
|
| 716 |
+
],
|
| 717 |
+
"q01": [
|
| 718 |
+
-0.46048143863677976,
|
| 719 |
+
-0.001417565532028675,
|
| 720 |
+
-0.019787334837019437,
|
| 721 |
+
0.1400335283577442,
|
| 722 |
+
-0.40042722046375273,
|
| 723 |
+
-0.1500592675805092,
|
| 724 |
+
-0.4469831359386444,
|
| 725 |
+
-0.20127003654837608,
|
| 726 |
+
-0.35273449271917345,
|
| 727 |
+
0.13117286264896394,
|
| 728 |
+
-0.31278882563114163,
|
| 729 |
+
-0.10695050276815891,
|
| 730 |
+
-0.06434167601168156,
|
| 731 |
+
-0.03814786046743393,
|
| 732 |
+
0.0030093658366240577,
|
| 733 |
+
-0.5162069481611252,
|
| 734 |
+
-0.031657121963798995,
|
| 735 |
+
-0.3940638452768326,
|
| 736 |
+
-0.5422306978702545,
|
| 737 |
+
0.9766830176115036,
|
| 738 |
+
-0.13969131857156752,
|
| 739 |
+
-0.24476195588707925,
|
| 740 |
+
-0.5818968629837036,
|
| 741 |
+
-0.3349967387318611,
|
| 742 |
+
-0.02889954417943954,
|
| 743 |
+
-0.5198817837238312,
|
| 744 |
+
-1.4832872450351715,
|
| 745 |
+
0.00666264486499131,
|
| 746 |
+
-0.16844903901219366,
|
| 747 |
+
0.3000469207763672,
|
| 748 |
+
0.3000378906726837,
|
| 749 |
+
0.300070583820343,
|
| 750 |
+
0.3319503664970398,
|
| 751 |
+
0.4941388964653015,
|
| 752 |
+
0.0,
|
| 753 |
+
0.2999802529811859,
|
| 754 |
+
0.3000173270702362,
|
| 755 |
+
0.3000636100769043,
|
| 756 |
+
0.32894015312194824,
|
| 757 |
+
0.5052923560142517,
|
| 758 |
+
0.0,
|
| 759 |
+
-0.09914009734988212,
|
| 760 |
+
-0.025850909166038036,
|
| 761 |
+
-0.9999485015869141
|
| 762 |
+
],
|
| 763 |
+
"q99": [
|
| 764 |
+
0.20422495111823086,
|
| 765 |
+
0.25848694026470187,
|
| 766 |
+
0.2645684388279915,
|
| 767 |
+
1.0600767815113068,
|
| 768 |
+
0.07926157340407373,
|
| 769 |
+
0.05578560329973699,
|
| 770 |
+
0.12076335318386557,
|
| 771 |
+
0.0634762664884329,
|
| 772 |
+
-0.09861872553825378,
|
| 773 |
+
0.9024305552244187,
|
| 774 |
+
0.08224537916481496,
|
| 775 |
+
0.10222977459430696,
|
| 776 |
+
0.05355732761323453,
|
| 777 |
+
0.03978750210255386,
|
| 778 |
+
0.1318538938462734,
|
| 779 |
+
0.8845052689313889,
|
| 780 |
+
0.4733697807788849,
|
| 781 |
+
0.21367629334330562,
|
| 782 |
+
0.740164201259613,
|
| 783 |
+
1.455635689496994,
|
| 784 |
+
0.2315270981192589,
|
| 785 |
+
0.09163028463721276,
|
| 786 |
+
0.8678649854660034,
|
| 787 |
+
0.09198425464332108,
|
| 788 |
+
0.7561256486177446,
|
| 789 |
+
0.8060805976390839,
|
| 790 |
+
-0.9242562597990035,
|
| 791 |
+
0.330000014603138,
|
| 792 |
+
0.13720838129520418,
|
| 793 |
+
0.9997493028640747,
|
| 794 |
+
0.9996715849637985,
|
| 795 |
+
0.9996342724561691,
|
| 796 |
+
0.9996714061498642,
|
| 797 |
+
1.0,
|
| 798 |
+
0.9991828799247742,
|
| 799 |
+
0.9997599720954895,
|
| 800 |
+
0.9996874332427979,
|
| 801 |
+
0.9996535778045654,
|
| 802 |
+
0.9996883869171143,
|
| 803 |
+
1.0,
|
| 804 |
+
0.9991675019264221,
|
| 805 |
+
0.0729682007431984,
|
| 806 |
+
0.08541205741465092,
|
| 807 |
+
-0.9938413059711456
|
| 808 |
+
],
|
| 809 |
+
"unit_dims": [
|
| 810 |
+
29,
|
| 811 |
+
30,
|
| 812 |
+
31,
|
| 813 |
+
32,
|
| 814 |
+
33,
|
| 815 |
+
34,
|
| 816 |
+
35,
|
| 817 |
+
36,
|
| 818 |
+
37,
|
| 819 |
+
38,
|
| 820 |
+
39,
|
| 821 |
+
40
|
| 822 |
+
]
|
| 823 |
+
},
|
| 824 |
+
"action": {
|
| 825 |
+
"min": [
|
| 826 |
+
-0.4375,
|
| 827 |
+
-0.4375,
|
| 828 |
+
-0.5625,
|
| 829 |
+
-0.4375,
|
| 830 |
+
-0.5,
|
| 831 |
+
-0.0625,
|
| 832 |
+
-0.1875,
|
| 833 |
+
-0.5,
|
| 834 |
+
-0.25,
|
| 835 |
+
-0.4375,
|
| 836 |
+
-0.4375,
|
| 837 |
+
-0.375,
|
| 838 |
+
-0.4375,
|
| 839 |
+
-0.1875,
|
| 840 |
+
-0.0625,
|
| 841 |
+
-0.3125,
|
| 842 |
+
-0.0625,
|
| 843 |
+
-0.125,
|
| 844 |
+
-0.5,
|
| 845 |
+
-0.25,
|
| 846 |
+
-0.625,
|
| 847 |
+
-0.5,
|
| 848 |
+
-0.25,
|
| 849 |
+
0.0,
|
| 850 |
+
-0.25,
|
| 851 |
+
-0.25,
|
| 852 |
+
-0.3125,
|
| 853 |
+
-0.25,
|
| 854 |
+
-0.25,
|
| 855 |
+
-0.1875,
|
| 856 |
+
-0.375,
|
| 857 |
+
-0.1875,
|
| 858 |
+
-0.0625,
|
| 859 |
+
-0.375,
|
| 860 |
+
-0.375,
|
| 861 |
+
-0.375,
|
| 862 |
+
0.0,
|
| 863 |
+
-0.4375,
|
| 864 |
+
-0.3125,
|
| 865 |
+
-0.3125,
|
| 866 |
+
-0.3125,
|
| 867 |
+
-0.5,
|
| 868 |
+
-0.5,
|
| 869 |
+
-0.25,
|
| 870 |
+
-0.3125,
|
| 871 |
+
-0.3125,
|
| 872 |
+
-0.375,
|
| 873 |
+
-0.5,
|
| 874 |
+
0.0,
|
| 875 |
+
-0.25,
|
| 876 |
+
-0.5,
|
| 877 |
+
-0.3125,
|
| 878 |
+
-0.3125,
|
| 879 |
+
-0.3125,
|
| 880 |
+
-0.3125,
|
| 881 |
+
-0.375,
|
| 882 |
+
-0.4375,
|
| 883 |
+
-0.125,
|
| 884 |
+
-0.1875,
|
| 885 |
+
-0.5,
|
| 886 |
+
-0.6875,
|
| 887 |
+
-0.3125,
|
| 888 |
+
-0.3125,
|
| 889 |
+
-0.5,
|
| 890 |
+
0.28926292061805725,
|
| 891 |
+
0.2978215515613556,
|
| 892 |
+
0.2999863028526306,
|
| 893 |
+
0.3241505026817322,
|
| 894 |
+
0.4532031714916229,
|
| 895 |
+
0.0,
|
| 896 |
+
0.28560081124305725,
|
| 897 |
+
0.2877190411090851,
|
| 898 |
+
0.2999747097492218,
|
| 899 |
+
0.3188680410385132,
|
| 900 |
+
0.2645348310470581,
|
| 901 |
+
0.0
|
| 902 |
+
],
|
| 903 |
+
"max": [
|
| 904 |
+
0.25,
|
| 905 |
+
0.3125,
|
| 906 |
+
0.125,
|
| 907 |
+
0.25,
|
| 908 |
+
0.4375,
|
| 909 |
+
0.5625,
|
| 910 |
+
0.375,
|
| 911 |
+
0.25,
|
| 912 |
+
0.375,
|
| 913 |
+
0.0625,
|
| 914 |
+
0.0625,
|
| 915 |
+
0.1875,
|
| 916 |
+
0.3125,
|
| 917 |
+
0.75,
|
| 918 |
+
0.5,
|
| 919 |
+
0.3125,
|
| 920 |
+
0.3125,
|
| 921 |
+
0.375,
|
| 922 |
+
0.125,
|
| 923 |
+
0.4375,
|
| 924 |
+
0.1875,
|
| 925 |
+
0.5625,
|
| 926 |
+
0.3125,
|
| 927 |
+
0.5,
|
| 928 |
+
0.3125,
|
| 929 |
+
0.5,
|
| 930 |
+
0.125,
|
| 931 |
+
0.5625,
|
| 932 |
+
0.375,
|
| 933 |
+
0.5,
|
| 934 |
+
0.5625,
|
| 935 |
+
0.5,
|
| 936 |
+
0.5,
|
| 937 |
+
0.5,
|
| 938 |
+
0.3125,
|
| 939 |
+
0.1875,
|
| 940 |
+
0.6875,
|
| 941 |
+
0.1875,
|
| 942 |
+
0.625,
|
| 943 |
+
0.0625,
|
| 944 |
+
0.3125,
|
| 945 |
+
0.25,
|
| 946 |
+
0.25,
|
| 947 |
+
0.1875,
|
| 948 |
+
0.3125,
|
| 949 |
+
0.1875,
|
| 950 |
+
0.25,
|
| 951 |
+
0.375,
|
| 952 |
+
0.75,
|
| 953 |
+
0.5625,
|
| 954 |
+
0.5,
|
| 955 |
+
0.375,
|
| 956 |
+
0.4375,
|
| 957 |
+
0.375,
|
| 958 |
+
0.25,
|
| 959 |
+
0.3125,
|
| 960 |
+
0.1875,
|
| 961 |
+
0.25,
|
| 962 |
+
0.1875,
|
| 963 |
+
0.25,
|
| 964 |
+
-0.3125,
|
| 965 |
+
0.25,
|
| 966 |
+
0.5,
|
| 967 |
+
0.375,
|
| 968 |
+
0.9997925758361816,
|
| 969 |
+
1.0,
|
| 970 |
+
1.0,
|
| 971 |
+
1.0,
|
| 972 |
+
1.0,
|
| 973 |
+
0.9993118047714233,
|
| 974 |
+
1.0,
|
| 975 |
+
0.999999463558197,
|
| 976 |
+
1.0,
|
| 977 |
+
1.0,
|
| 978 |
+
1.0,
|
| 979 |
+
1.0
|
| 980 |
+
],
|
| 981 |
+
"mean": [
|
| 982 |
+
-0.06629070556309362,
|
| 983 |
+
-0.05511014446484157,
|
| 984 |
+
-0.22505886343682657,
|
| 985 |
+
-0.039107769973661104,
|
| 986 |
+
-0.04682386862479049,
|
| 987 |
+
0.3142594181498922,
|
| 988 |
+
0.06716717216058744,
|
| 989 |
+
-0.015287532923617208,
|
| 990 |
+
0.08235743076063533,
|
| 991 |
+
-0.17423327879319978,
|
| 992 |
+
-0.20464023465559902,
|
| 993 |
+
-0.03392479447681379,
|
| 994 |
+
0.03874261712826243,
|
| 995 |
+
0.2375,
|
| 996 |
+
0.1918529012690558,
|
| 997 |
+
0.05225077819458855,
|
| 998 |
+
0.16261922340170804,
|
| 999 |
+
0.1694284260515604,
|
| 1000 |
+
-0.17236411525261394,
|
| 1001 |
+
0.12906207598371777,
|
| 1002 |
+
-0.11041334104876686,
|
| 1003 |
+
-0.09034489983238886,
|
| 1004 |
+
0.07829086519275281,
|
| 1005 |
+
0.22341667331790246,
|
| 1006 |
+
-0.016289707877723682,
|
| 1007 |
+
0.05943411285816905,
|
| 1008 |
+
-0.11190338414877485,
|
| 1009 |
+
0.11185998483518238,
|
| 1010 |
+
0.03395073429643228,
|
| 1011 |
+
0.11506903982759997,
|
| 1012 |
+
0.039812135844839974,
|
| 1013 |
+
0.17395841647378082,
|
| 1014 |
+
0.2093303535796951,
|
| 1015 |
+
0.12787433155080213,
|
| 1016 |
+
0.05439081331311358,
|
| 1017 |
+
-0.15496298587277516,
|
| 1018 |
+
0.19578278394125628,
|
| 1019 |
+
-0.15189310798946445,
|
| 1020 |
+
-0.04390713544576582,
|
| 1021 |
+
-0.14537971905179983,
|
| 1022 |
+
-0.09730674834384229,
|
| 1023 |
+
-0.06830702769574587,
|
| 1024 |
+
-0.20630387500997685,
|
| 1025 |
+
-0.07832927607949557,
|
| 1026 |
+
-0.043487608747705325,
|
| 1027 |
+
0.023496488147497805,
|
| 1028 |
+
-9.478011014446484e-06,
|
| 1029 |
+
0.006343782424774523,
|
| 1030 |
+
0.4254489584164738,
|
| 1031 |
+
0.19045863596456222,
|
| 1032 |
+
0.0642414598132333,
|
| 1033 |
+
0.11013349030249821,
|
| 1034 |
+
-0.03714931359246548,
|
| 1035 |
+
0.06375209513927688,
|
| 1036 |
+
-0.06714322771170883,
|
| 1037 |
+
-0.10344750179583366,
|
| 1038 |
+
-0.016653364195067445,
|
| 1039 |
+
0.035530569079735015,
|
| 1040 |
+
-0.006146240721526059,
|
| 1041 |
+
-0.11385984515923059,
|
| 1042 |
+
-0.6169801061537233,
|
| 1043 |
+
0.07215659669566606,
|
| 1044 |
+
-0.062095937425173595,
|
| 1045 |
+
-0.06103539787692553,
|
| 1046 |
+
0.7584627563567199,
|
| 1047 |
+
0.7347248990636687,
|
| 1048 |
+
0.7359466597474728,
|
| 1049 |
+
0.7434046703440507,
|
| 1050 |
+
0.8677225796256197,
|
| 1051 |
+
0.18050129081743033,
|
| 1052 |
+
0.7157243621259897,
|
| 1053 |
+
0.7192522151209102,
|
| 1054 |
+
0.7318337730585849,
|
| 1055 |
+
0.7466828414938838,
|
| 1056 |
+
0.8631709350224399,
|
| 1057 |
+
0.18055928431852253
|
| 1058 |
+
],
|
| 1059 |
+
"std": [
|
| 1060 |
+
0.08355496121131518,
|
| 1061 |
+
0.09326184648072526,
|
| 1062 |
+
0.08203358498822505,
|
| 1063 |
+
0.06955414567790866,
|
| 1064 |
+
0.10596747618875023,
|
| 1065 |
+
0.07795442659140216,
|
| 1066 |
+
0.07092115557940734,
|
| 1067 |
+
0.12551970791788017,
|
| 1068 |
+
0.07726665297605524,
|
| 1069 |
+
0.08503618788026966,
|
| 1070 |
+
0.04939946109970159,
|
| 1071 |
+
0.0642530465250632,
|
| 1072 |
+
0.10165332059491544,
|
| 1073 |
+
0.16715226435676253,
|
| 1074 |
+
0.07978636779653304,
|
| 1075 |
+
0.062093797277847175,
|
| 1076 |
+
0.06906049598665721,
|
| 1077 |
+
0.061107210734037076,
|
| 1078 |
+
0.10103219576880981,
|
| 1079 |
+
0.12552738140001207,
|
| 1080 |
+
0.11307675563355261,
|
| 1081 |
+
0.1315226204681107,
|
| 1082 |
+
0.0539603663638299,
|
| 1083 |
+
0.07761860329949177,
|
| 1084 |
+
0.0814798817598654,
|
| 1085 |
+
0.08871903770821819,
|
| 1086 |
+
0.042644450865256506,
|
| 1087 |
+
0.11889695762095398,
|
| 1088 |
+
0.09244965300262262,
|
| 1089 |
+
0.08260374980620613,
|
| 1090 |
+
0.1694667219988425,
|
| 1091 |
+
0.08529732186866353,
|
| 1092 |
+
0.07239679018020305,
|
| 1093 |
+
0.11005592215273363,
|
| 1094 |
+
0.09032910022286104,
|
| 1095 |
+
0.06908623040805847,
|
| 1096 |
+
0.09871646552427954,
|
| 1097 |
+
0.1239992628273514,
|
| 1098 |
+
0.1433562434186525,
|
| 1099 |
+
0.05147929395251614,
|
| 1100 |
+
0.07641809442013198,
|
| 1101 |
+
0.105798513365219,
|
| 1102 |
+
0.09447674175568083,
|
| 1103 |
+
0.062372487097606795,
|
| 1104 |
+
0.09040021909821346,
|
| 1105 |
+
0.06330894955736102,
|
| 1106 |
+
0.1000297074555641,
|
| 1107 |
+
0.09828292929155315,
|
| 1108 |
+
0.11854148907613134,
|
| 1109 |
+
0.1441671361875703,
|
| 1110 |
+
0.10845541642742883,
|
| 1111 |
+
0.12332705685672458,
|
| 1112 |
+
0.11286697307607886,
|
| 1113 |
+
0.07940003144723148,
|
| 1114 |
+
0.09312402313087363,
|
| 1115 |
+
0.0724733252946844,
|
| 1116 |
+
0.09132727788851353,
|
| 1117 |
+
0.07193283597257298,
|
| 1118 |
+
0.062306487349445695,
|
| 1119 |
+
0.0846974241318232,
|
| 1120 |
+
0.04614175344349353,
|
| 1121 |
+
0.07787907390454928,
|
| 1122 |
+
0.09273522667792361,
|
| 1123 |
+
0.15382179172960914,
|
| 1124 |
+
0.28970257569536595,
|
| 1125 |
+
0.30400373906907074,
|
| 1126 |
+
0.3010014700359181,
|
| 1127 |
+
0.29230853834349046,
|
| 1128 |
+
0.17118303819521438,
|
| 1129 |
+
0.3785607898211561,
|
| 1130 |
+
0.3253747707974398,
|
| 1131 |
+
0.32108122353058915,
|
| 1132 |
+
0.3064997790556862,
|
| 1133 |
+
0.2895646717445341,
|
| 1134 |
+
0.17312796927521015,
|
| 1135 |
+
0.37853011602794057
|
| 1136 |
+
],
|
| 1137 |
+
"q01": [
|
| 1138 |
+
-0.25,
|
| 1139 |
+
-0.25,
|
| 1140 |
+
-0.375,
|
| 1141 |
+
-0.25,
|
| 1142 |
+
-0.3125,
|
| 1143 |
+
0.0625,
|
| 1144 |
+
-0.0625,
|
| 1145 |
+
-0.3125,
|
| 1146 |
+
-0.125,
|
| 1147 |
+
-0.3125,
|
| 1148 |
+
-0.3125,
|
| 1149 |
+
-0.1875,
|
| 1150 |
+
-0.25,
|
| 1151 |
+
-0.125,
|
| 1152 |
+
0.0625,
|
| 1153 |
+
-0.125,
|
| 1154 |
+
0.0,
|
| 1155 |
+
0.0,
|
| 1156 |
+
-0.375,
|
| 1157 |
+
-0.1875,
|
| 1158 |
+
-0.375,
|
| 1159 |
+
-0.375,
|
| 1160 |
+
-0.0625,
|
| 1161 |
+
0.0625,
|
| 1162 |
+
-0.1875,
|
| 1163 |
+
-0.125,
|
| 1164 |
+
-0.1875,
|
| 1165 |
+
-0.125,
|
| 1166 |
+
-0.125,
|
| 1167 |
+
-0.0625,
|
| 1168 |
+
-0.3125,
|
| 1169 |
+
-0.0625,
|
| 1170 |
+
0.0625,
|
| 1171 |
+
-0.125,
|
| 1172 |
+
-0.1875,
|
| 1173 |
+
-0.3125,
|
| 1174 |
+
0.0625,
|
| 1175 |
+
-0.375,
|
| 1176 |
+
-0.3125,
|
| 1177 |
+
-0.25,
|
| 1178 |
+
-0.1875,
|
| 1179 |
+
-0.375,
|
| 1180 |
+
-0.375,
|
| 1181 |
+
-0.1875,
|
| 1182 |
+
-0.25,
|
| 1183 |
+
-0.125,
|
| 1184 |
+
-0.25,
|
| 1185 |
+
-0.3125,
|
| 1186 |
+
0.1875,
|
| 1187 |
+
-0.125,
|
| 1188 |
+
-0.25,
|
| 1189 |
+
-0.1875,
|
| 1190 |
+
-0.25,
|
| 1191 |
+
-0.125,
|
| 1192 |
+
-0.25,
|
| 1193 |
+
-0.25,
|
| 1194 |
+
-0.25,
|
| 1195 |
+
-0.0625,
|
| 1196 |
+
-0.125,
|
| 1197 |
+
-0.3125,
|
| 1198 |
+
-0.6875,
|
| 1199 |
+
-0.1875,
|
| 1200 |
+
-0.25,
|
| 1201 |
+
-0.375,
|
| 1202 |
+
0.3000469207763672,
|
| 1203 |
+
0.3000378906726837,
|
| 1204 |
+
0.300070583820343,
|
| 1205 |
+
0.3319503664970398,
|
| 1206 |
+
0.4941388964653015,
|
| 1207 |
+
0.0,
|
| 1208 |
+
0.2999802529811859,
|
| 1209 |
+
0.3000173270702362,
|
| 1210 |
+
0.3000636100769043,
|
| 1211 |
+
0.32894015312194824,
|
| 1212 |
+
0.5052923560142517,
|
| 1213 |
+
0.0
|
| 1214 |
+
],
|
| 1215 |
+
"q99": [
|
| 1216 |
+
0.125,
|
| 1217 |
+
0.1875,
|
| 1218 |
+
-0.0625,
|
| 1219 |
+
0.125,
|
| 1220 |
+
0.1875,
|
| 1221 |
+
0.4375,
|
| 1222 |
+
0.25,
|
| 1223 |
+
0.1875,
|
| 1224 |
+
0.25,
|
| 1225 |
+
0.0,
|
| 1226 |
+
-0.0625,
|
| 1227 |
+
0.125,
|
| 1228 |
+
0.25,
|
| 1229 |
+
0.5625,
|
| 1230 |
+
0.375,
|
| 1231 |
+
0.1875,
|
| 1232 |
+
0.25,
|
| 1233 |
+
0.3125,
|
| 1234 |
+
0.0,
|
| 1235 |
+
0.375,
|
| 1236 |
+
0.125,
|
| 1237 |
+
0.25,
|
| 1238 |
+
0.1875,
|
| 1239 |
+
0.375,
|
| 1240 |
+
0.1875,
|
| 1241 |
+
0.25,
|
| 1242 |
+
0.0,
|
| 1243 |
+
0.4375,
|
| 1244 |
+
0.25,
|
| 1245 |
+
0.3125,
|
| 1246 |
+
0.4375,
|
| 1247 |
+
0.375,
|
| 1248 |
+
0.375,
|
| 1249 |
+
0.375,
|
| 1250 |
+
0.25,
|
| 1251 |
+
0.0,
|
| 1252 |
+
0.5625,
|
| 1253 |
+
0.125,
|
| 1254 |
+
0.3125,
|
| 1255 |
+
0.0,
|
| 1256 |
+
0.125,
|
| 1257 |
+
0.125,
|
| 1258 |
+
0.0625,
|
| 1259 |
+
0.0625,
|
| 1260 |
+
0.25,
|
| 1261 |
+
0.125,
|
| 1262 |
+
0.1875,
|
| 1263 |
+
0.1875,
|
| 1264 |
+
0.625,
|
| 1265 |
+
0.5,
|
| 1266 |
+
0.3125,
|
| 1267 |
+
0.375,
|
| 1268 |
+
0.25,
|
| 1269 |
+
0.25,
|
| 1270 |
+
0.125,
|
| 1271 |
+
0.125,
|
| 1272 |
+
0.125,
|
| 1273 |
+
0.1875,
|
| 1274 |
+
0.125,
|
| 1275 |
+
0.125,
|
| 1276 |
+
-0.5,
|
| 1277 |
+
0.1875,
|
| 1278 |
+
0.25,
|
| 1279 |
+
0.25,
|
| 1280 |
+
0.9997493028640747,
|
| 1281 |
+
0.9996715849637985,
|
| 1282 |
+
0.9996342724561691,
|
| 1283 |
+
0.9996714061498642,
|
| 1284 |
+
1.0,
|
| 1285 |
+
0.9991828799247742,
|
| 1286 |
+
0.9997599720954895,
|
| 1287 |
+
0.9996874332427979,
|
| 1288 |
+
0.9996535778045654,
|
| 1289 |
+
0.9996883869171143,
|
| 1290 |
+
1.0,
|
| 1291 |
+
0.9991675019264221
|
| 1292 |
+
],
|
| 1293 |
+
"unit_dims": [
|
| 1294 |
+
64,
|
| 1295 |
+
65,
|
| 1296 |
+
66,
|
| 1297 |
+
67,
|
| 1298 |
+
68,
|
| 1299 |
+
69,
|
| 1300 |
+
70,
|
| 1301 |
+
71,
|
| 1302 |
+
72,
|
| 1303 |
+
73,
|
| 1304 |
+
74,
|
| 1305 |
+
75
|
| 1306 |
+
]
|
| 1307 |
+
}
|
| 1308 |
+
},
|
| 1309 |
+
"code_commit": "d20968588471ede76533662de44fd0df9e124b49",
|
| 1310 |
+
"task": "a10v3",
|
| 1311 |
+
"dataset_id": "a10-trolley-push-v3@6e410c5 (inferred from the directory name)",
|
| 1312 |
+
"step": 5000,
|
| 1313 |
+
"weights": "ema",
|
| 1314 |
+
"offline_eval": {
|
| 1315 |
+
"mse": 0.008637136779725552,
|
| 1316 |
+
"mse_row0": 0.004760934505611658,
|
| 1317 |
+
"mse_motion_token": 0.00967626366764307,
|
| 1318 |
+
"mse_inspire_left_hand_state": 0.003269098000600934,
|
| 1319 |
+
"mse_inspire_right_hand_state": 0.0029211402870714664,
|
| 1320 |
+
"samples": 256,
|
| 1321 |
+
"frames": "train"
|
| 1322 |
+
},
|
| 1323 |
+
"format": "hb_baselines/1"
|
| 1324 |
+
}
|
a10-trolley-push-v3/b512/step-005000/model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bf855ba020981d652552c5e5233cae80a9b905f85ae1eefaeac94e5f7edb7464
|
| 3 |
+
size 105997549
|
a10-trolley-push-v3/b512/step-005000/protocol.json
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format": "hb_baselines/1",
|
| 3 |
+
"step": 5000,
|
| 4 |
+
"policy": "ode_mlp",
|
| 5 |
+
"task": "a10v3",
|
| 6 |
+
"dataset_id": "a10-trolley-push-v3@6e410c5 (inferred from the directory name)",
|
| 7 |
+
"episodes": 148,
|
| 8 |
+
"frames": 125290,
|
| 9 |
+
"fps": 30.0,
|
| 10 |
+
"steps": 5000,
|
| 11 |
+
"total_steps": 5000,
|
| 12 |
+
"save_steps": [
|
| 13 |
+
750,
|
| 14 |
+
1750,
|
| 15 |
+
2500,
|
| 16 |
+
3250,
|
| 17 |
+
4250,
|
| 18 |
+
5000
|
| 19 |
+
],
|
| 20 |
+
"global_batch": 512,
|
| 21 |
+
"per_gpu_batch": 512,
|
| 22 |
+
"num_gpus": 1,
|
| 23 |
+
"gradient_accumulation_steps": 1,
|
| 24 |
+
"lr": 0.0001,
|
| 25 |
+
"warmup": 500,
|
| 26 |
+
"schedule": "diffusers_cosine",
|
| 27 |
+
"seed": 42,
|
| 28 |
+
"aug_seed": 42,
|
| 29 |
+
"code_commit": "d20968588471ede76533662de44fd0df9e124b49",
|
| 30 |
+
"code_dirty": null,
|
| 31 |
+
"environment": {
|
| 32 |
+
"python": "3.12.12",
|
| 33 |
+
"torch": "2.9.0+cu128",
|
| 34 |
+
"numpy": "2.2.6",
|
| 35 |
+
"cuda": "12.8",
|
| 36 |
+
"cudnn": 91002,
|
| 37 |
+
"torchvision": "0.24.0+cu128",
|
| 38 |
+
"pillow": "13.0.0",
|
| 39 |
+
"gpu": "NVIDIA A800-SXM4-80GB",
|
| 40 |
+
"driver": "570.133.20"
|
| 41 |
+
},
|
| 42 |
+
"continuation": null,
|
| 43 |
+
"protocol_deviations": [],
|
| 44 |
+
"protocol_exceptions": [],
|
| 45 |
+
"files": {
|
| 46 |
+
"config.json": {
|
| 47 |
+
"bytes": 22529,
|
| 48 |
+
"sha256": "93fa4af8336a345caf7085c959a3ad474b99eba770ba0dd7c0a373516255a8bc"
|
| 49 |
+
},
|
| 50 |
+
"model.pt": {
|
| 51 |
+
"bytes": 105997549,
|
| 52 |
+
"sha256": "bf855ba020981d652552c5e5233cae80a9b905f85ae1eefaeac94e5f7edb7464"
|
| 53 |
+
},
|
| 54 |
+
"training_records/code_commit.txt": {
|
| 55 |
+
"bytes": 312,
|
| 56 |
+
"sha256": "2bd274128b9cc8d9a4b574220e19f456b6c33858b7a180583691ca8458a626f8"
|
| 57 |
+
},
|
| 58 |
+
"training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py": {
|
| 59 |
+
"bytes": 7475,
|
| 60 |
+
"sha256": "9f7713cea4f846efcfc924234267ced48210357f419d67915c10b504316bedde"
|
| 61 |
+
},
|
| 62 |
+
"training_records/code_d2096858/evaluation/baselines/__init__.py": {
|
| 63 |
+
"bytes": 1060,
|
| 64 |
+
"sha256": "bfbb52f85ac5d91e37f3cfc24bb8671de447b5b566760bfe091204ae69e1f7f6"
|
| 65 |
+
},
|
| 66 |
+
"training_records/code_d2096858/evaluation/baselines/act_nets.py": {
|
| 67 |
+
"bytes": 22435,
|
| 68 |
+
"sha256": "3db95cd8e4e436875e11f1054a99d250ca7d94e0127909090b58730402340f19"
|
| 69 |
+
},
|
| 70 |
+
"training_records/code_d2096858/evaluation/baselines/adapters.py": {
|
| 71 |
+
"bytes": 3479,
|
| 72 |
+
"sha256": "87e47332381fcb34e75d08cb258475c200519cb5cf17fd0e218bf2a1b21fa890"
|
| 73 |
+
},
|
| 74 |
+
"training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py": {
|
| 75 |
+
"bytes": 6003,
|
| 76 |
+
"sha256": "aa7fc175f50de83b130427cc30533a45220e70d0ed8c807f33ca44d39cb9fb81"
|
| 77 |
+
},
|
| 78 |
+
"training_records/code_d2096858/evaluation/baselines/check_flash_parity.py": {
|
| 79 |
+
"bytes": 7900,
|
| 80 |
+
"sha256": "91f714aa3b7ec6b5c28764496163671cadabe4a833c0b06b6bc4c155cec7f66f"
|
| 81 |
+
},
|
| 82 |
+
"training_records/code_d2096858/evaluation/baselines/data.py": {
|
| 83 |
+
"bytes": 21493,
|
| 84 |
+
"sha256": "c8b0817f7fe3bdec71b13e94a2e2fea231e0c6c05bd16614b564419ff024e8e2"
|
| 85 |
+
},
|
| 86 |
+
"training_records/code_d2096858/evaluation/baselines/flash.py": {
|
| 87 |
+
"bytes": 24032,
|
| 88 |
+
"sha256": "35c01a4e2edd80f85878b37928069c09ed3238127bbb51a5443e7f1c92703e53"
|
| 89 |
+
},
|
| 90 |
+
"training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py": {
|
| 91 |
+
"bytes": 6013,
|
| 92 |
+
"sha256": "c987d9e641f5e5266703a8154b708d9ccab203b06d5ab82774d39a1cba602d62"
|
| 93 |
+
},
|
| 94 |
+
"training_records/code_d2096858/evaluation/baselines/inloop.py": {
|
| 95 |
+
"bytes": 6993,
|
| 96 |
+
"sha256": "0e6343d7d28893c4107864b943193eb4a402cf97b1625e94eb2acb1d163ca85c"
|
| 97 |
+
},
|
| 98 |
+
"training_records/code_d2096858/evaluation/baselines/nets.py": {
|
| 99 |
+
"bytes": 10478,
|
| 100 |
+
"sha256": "2d72e3c455d5e376a6f5954886fd4c7a6478eb516380c6a05515fa043c62fbce"
|
| 101 |
+
},
|
| 102 |
+
"training_records/code_d2096858/evaluation/baselines/ode_nets.py": {
|
| 103 |
+
"bytes": 9148,
|
| 104 |
+
"sha256": "38f2ea6050fa45e6c0d5e3f19caf21f1a72a50f80e356044dddcf76da22b144a"
|
| 105 |
+
},
|
| 106 |
+
"training_records/code_d2096858/evaluation/baselines/policies.py": {
|
| 107 |
+
"bytes": 25760,
|
| 108 |
+
"sha256": "74ca169fe453f64bf6ffc3f3a85a4208aed2961d0abd9eb3e92b96457f86daf1"
|
| 109 |
+
},
|
| 110 |
+
"training_records/code_d2096858/evaluation/baselines/requirements.lock.txt": {
|
| 111 |
+
"bytes": 1481,
|
| 112 |
+
"sha256": "4b79b9dcc98f05bfe7bc9e64e3492f4565728f6d1f75cbdecc1c817d03ff32a5"
|
| 113 |
+
},
|
| 114 |
+
"training_records/code_d2096858/evaluation/baselines/requirements.txt": {
|
| 115 |
+
"bytes": 850,
|
| 116 |
+
"sha256": "56a8db94a98c5256028b475d9a0293cdee4cf475e415df763b3a0232433663ba"
|
| 117 |
+
},
|
| 118 |
+
"training_records/code_d2096858/evaluation/baselines/runtime.py": {
|
| 119 |
+
"bytes": 11034,
|
| 120 |
+
"sha256": "8cd8963bb87cdc453293a369658c97a97aadbef77281538d8a4c484925af00c5"
|
| 121 |
+
},
|
| 122 |
+
"training_records/code_d2096858/evaluation/baselines/train.py": {
|
| 123 |
+
"bytes": 60225,
|
| 124 |
+
"sha256": "cd74f1af7a382eea1903cc20142a19e82b06fe99dd03d5e75a9a42f0ae8ecf04"
|
| 125 |
+
},
|
| 126 |
+
"training_records/code_d2096858/evaluation/policy/ODEMLP/deploy.yml": {
|
| 127 |
+
"bytes": 3320,
|
| 128 |
+
"sha256": "2c58049b2fca0406dce9adb4716412371ebe9fead24e4dbd751e10a5d78fcf7d"
|
| 129 |
+
},
|
| 130 |
+
"training_records/code_d2096858/evaluation/policy/ODEMLP/model.py": {
|
| 131 |
+
"bytes": 607,
|
| 132 |
+
"sha256": "71f82a6b7c4802c87489a37c80c47b39492e2c4a35fe58fd544eee341e339d0e"
|
| 133 |
+
},
|
| 134 |
+
"training_records/inloop-mse.jsonl": {
|
| 135 |
+
"bytes": 33226,
|
| 136 |
+
"sha256": "5bb85e00dc510a4fb7e18dca7ad0b1c7ca13f040c36e1d6ef7959007ce49ffcf"
|
| 137 |
+
},
|
| 138 |
+
"training_records/launch.sh": {
|
| 139 |
+
"bytes": 1548,
|
| 140 |
+
"sha256": "d497d5fe09b104d02bdd5448fd7b663aa0ee169a472e503bb125e5abdda6c869"
|
| 141 |
+
},
|
| 142 |
+
"training_records/pip_freeze_hb-baselines.txt": {
|
| 143 |
+
"bytes": 1185,
|
| 144 |
+
"sha256": "72942d6f1c95ab99ba51fcf641bfd0e4cb34943c5b19a2a39d8da72ef5daa6b2"
|
| 145 |
+
},
|
| 146 |
+
"training_records/run.json": {
|
| 147 |
+
"bytes": 23123,
|
| 148 |
+
"sha256": "7cf58ef54082175356e467e4bdb6b038a9edd64ebfbd3344ac32478a75a906ae"
|
| 149 |
+
},
|
| 150 |
+
"training_records/train.log": {
|
| 151 |
+
"bytes": 30804,
|
| 152 |
+
"sha256": "1f98168eb8c804d6b85c4c8ec030c8f4dd9b0b1a100e44d9792c11299d54339e"
|
| 153 |
+
},
|
| 154 |
+
"training_records/train_log.jsonl": {
|
| 155 |
+
"bytes": 26699,
|
| 156 |
+
"sha256": "834c18b280175220f6fc95721022fb846ac26ced0aa5c7e915b0f634fea1efb2"
|
| 157 |
+
}
|
| 158 |
+
},
|
| 159 |
+
"task_dir": "a10-trolley-push-v3",
|
| 160 |
+
"training_data": "humanoid-benchmark/a10-trolley-push-expert-v3 @6e410c55, all 148 episodes (125,290 frames)",
|
| 161 |
+
"lr_schedule": "diffusers_cosine after a 500-step linear warm-up",
|
| 162 |
+
"ema": 0.9999,
|
| 163 |
+
"augmentation": "Humanoid Benchmark online augmentation spec v2 (hb-aug-v2-20261109): 15 visual effects, one per sample at 1.5x; proprio per-joint bias U(+-2 deg) + N(0, 0.25 deg); no delay, no history drop; model-native image augmentation off",
|
| 164 |
+
"state_dim": 44,
|
| 165 |
+
"action_dim": 76,
|
| 166 |
+
"cameras": [
|
| 167 |
+
"ego_view",
|
| 168 |
+
"chest"
|
| 169 |
+
],
|
| 170 |
+
"contract": "g1_sonic_dfx6",
|
| 171 |
+
"image_hw": [
|
| 172 |
+
168,
|
| 173 |
+
224
|
| 174 |
+
],
|
| 175 |
+
"task_text": "Walk naturally to the purple platform trolley with open hands, approach its handle slowly and directly, grasp with both hands, then push straight until the platform is alongside the cardboard box ahead and to the side, stop, open both hands and withdraw slightly from the handle.",
|
| 176 |
+
"inloop_mse": {
|
| 177 |
+
"task": "a10v3",
|
| 178 |
+
"split": "train10",
|
| 179 |
+
"every": 250,
|
| 180 |
+
"seed": 1234,
|
| 181 |
+
"weights": "ema",
|
| 182 |
+
"nmse_at_this_step": 0.0421,
|
| 183 |
+
"curve": {
|
| 184 |
+
"250": 0.1764,
|
| 185 |
+
"500": 0.1003,
|
| 186 |
+
"750": 0.0846,
|
| 187 |
+
"1000": 0.0748,
|
| 188 |
+
"1250": 0.0676,
|
| 189 |
+
"1500": 0.0629,
|
| 190 |
+
"1750": 0.059,
|
| 191 |
+
"2000": 0.056,
|
| 192 |
+
"2250": 0.0535,
|
| 193 |
+
"2500": 0.0512,
|
| 194 |
+
"2750": 0.0493,
|
| 195 |
+
"3000": 0.0477,
|
| 196 |
+
"3250": 0.0463,
|
| 197 |
+
"3500": 0.0453,
|
| 198 |
+
"3750": 0.0443,
|
| 199 |
+
"4000": 0.0436,
|
| 200 |
+
"4250": 0.043,
|
| 201 |
+
"4500": 0.0426,
|
| 202 |
+
"4750": 0.0423,
|
| 203 |
+
"5000": 0.0421
|
| 204 |
+
}
|
| 205 |
+
},
|
| 206 |
+
"reproducibility": {
|
| 207 |
+
"protocol": "https://github.com/zuo-kuangji/HumanWAM/blob/bai/hb_training/REPRODUCIBILITY.md",
|
| 208 |
+
"protocol_commit": "4ab064d",
|
| 209 |
+
"training_seed": 42,
|
| 210 |
+
"training_seed_source": "config.json training.seed of this folder (hb_baselines code, policy ode_mlp; 42 = upstream NTUMARS/ODE-POLICY default_train.yaml training_params.seed)",
|
| 211 |
+
"training_seed_verified_from_run_files": true,
|
| 212 |
+
"augmentation_random_stream": "seeded: per DataLoader worker numpy default_rng([HB_AUG_SEED=42, torch.initial_seed(), worker id]) (protocol.yaml models.ode_mlp aug_rng)",
|
| 213 |
+
"inloop_mse_seed": 1234,
|
| 214 |
+
"layout": {
|
| 215 |
+
"nodes": 1,
|
| 216 |
+
"gpus_per_node": 1,
|
| 217 |
+
"per_gpu_batch": 512,
|
| 218 |
+
"global_batch": 512,
|
| 219 |
+
"gradient_accumulation": 1,
|
| 220 |
+
"num_workers": 32,
|
| 221 |
+
"prefetch": 2
|
| 222 |
+
},
|
| 223 |
+
"environment": "hb-baselines (Humanoid_benchmark evaluation/baselines/requirements.lock.txt: Python 3.12.12, torch 2.9.0+cu128, pillow 13.0.0); training_records/pip_freeze_hb-baselines.txt",
|
| 224 |
+
"hardware": "Alibaba Cloud PAI DLC A800 cluster (dlc19te5fv9wtn5t), 1 x NVIDIA A800-SXM4-80GB, driver 570.133.20",
|
| 225 |
+
"upstream_code": "github.com/zuo-kuangji/Humanoid_benchmark bai @ d20968588471ede76533662de44fd0df9e124b49 (evaluation/baselines/train.py --policy ode_mlp --contract g1_sonic_dfx6); policy from NTUMARS/ODE-POLICY real-g1@fd8bec47 (G1 port, HumanWAM packages/ode_g1) + main@cea26d94 (encoder, ode_dit field, default_train.yaml)",
|
| 226 |
+
"determinism": "statistical reproducibility: same data commit, config, seed and layout give the same curves within run-to-run noise; GPU kernels are not bitwise deterministic",
|
| 227 |
+
"exceptions": "see the exception registry, REPRODUCIBILITY.md section 7; ODE recipe: section 4.7",
|
| 228 |
+
"adapter_code": "config.json in this folder records the model, data contract, dataset episodes, training and augmentation settings",
|
| 229 |
+
"upstream_method": "github.com/NTUMARS/ODE-POLICY @ real-g1 fd8bec47 (G1 port) + main cea26d94 (encoder, ode_dit field, default_train.yaml) (Apache-2.0)"
|
| 230 |
+
},
|
| 231 |
+
"inference": {
|
| 232 |
+
"integration": "Euler, one step per action row (dt = 1 row), 16 rows; start row = the last executed action (episode start: BOS = normalized zero)",
|
| 233 |
+
"deploy": "evaluation/policy/ODEMLP"
|
| 234 |
+
},
|
| 235 |
+
"resume_state_included": false,
|
| 236 |
+
"ema_schedule": "diffusion_policy_emamodel",
|
| 237 |
+
"published_steps": [
|
| 238 |
+
5000
|
| 239 |
+
],
|
| 240 |
+
"evaluated_checkpoint": "step-005000"
|
| 241 |
+
}
|
a10-trolley-push-v3/b512/step-005000/training_records/code_commit.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
d20968588471ede76533662de44fd0df9e124b49
|
| 2 |
+
train.py of bai d2096858 (code_commit fix, verified by sha256) on top of the 07a80dd9 tree; every other file in evaluation/baselines and evaluation/augmentation verified file by file by sha256 (2026-11-27). Not a git work tree: the cluster cannot fetch the private repo.
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Humanoid Benchmark data augmentation v2 (project CLAUDE.md), model-agnostic torch implementation.
|
| 2 |
+
|
| 3 |
+
augment(x, rng, obs_mask=None) takes x: float [T, V, 3, H, W] in [0, 1] (T frames, V cameras) and returns the
|
| 4 |
+
augmented tensor. Each call is one training sample: one of the 15 effects is chosen uniformly and its magnitude
|
| 5 |
+
is scaled by 1.5 around identity; the rest stay at x1. Colour is shared across cameras and time; geometry, light
|
| 6 |
+
patches and white balance are drawn per camera and fixed over time; sensor/optics effects (noise, gaussian blur,
|
| 7 |
+
JPEG, motion blur, sharpen, defocus) apply only to observation frames (obs_mask True).
|
| 8 |
+
Pixel-size parameters are defined at 224 px and scaled by H / 224.
|
| 9 |
+
perturb_joints(q, rng) applies the proprio spec: per-joint bias +-2 deg plus N(0, 0.25 deg) clipped at 3 sigma.
|
| 10 |
+
"""
|
| 11 |
+
import io
|
| 12 |
+
import math
|
| 13 |
+
|
| 14 |
+
import numpy as np
|
| 15 |
+
import torch
|
| 16 |
+
import torch.nn.functional as F
|
| 17 |
+
from PIL import Image
|
| 18 |
+
from torchvision.transforms import InterpolationMode
|
| 19 |
+
from torchvision.transforms import functional as TF
|
| 20 |
+
|
| 21 |
+
EFFECTS = ("exposure", "contrast", "saturation", "hue", "gamma", "temperature", "rotation_crop", "noise",
|
| 22 |
+
"gaussian_blur", "jpeg", "motion_blur", "sharpen", "defocus", "light_shadow", "wb_channel")
|
| 23 |
+
CENTER = {"exposure": 0.0, "contrast": 1.0, "saturation": 1.0, "hue": 0.0, "gamma": 1.0, "temperature": 0.0}
|
| 24 |
+
RANGE = {"exposure": (-0.22, 0.22), "contrast": (0.88, 1.12), "saturation": (0.76, 1.24), "hue": (-0.015, 0.015),
|
| 25 |
+
"gamma": (0.89, 1.11), "temperature": (-0.066, 0.066)}
|
| 26 |
+
VERSION = "hb-aug-v2-20261109"
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def sample(rng, views, height):
|
| 30 |
+
boost = EFFECTS[int(rng.integers(len(EFFECTS)))]
|
| 31 |
+
|
| 32 |
+
def k(name):
|
| 33 |
+
return 1.5 if boost == name else 1.0
|
| 34 |
+
|
| 35 |
+
px = height / 224.0
|
| 36 |
+
p = {"boost": boost}
|
| 37 |
+
for name, (a, b) in RANGE.items():
|
| 38 |
+
c = CENTER[name]
|
| 39 |
+
p[name] = float(rng.uniform(c + k(name) * (a - c), c + k(name) * (b - c)))
|
| 40 |
+
p["geometry"] = []
|
| 41 |
+
for _ in range(views):
|
| 42 |
+
angle = float(rng.uniform(-1.5 * k("rotation_crop"), 1.5 * k("rotation_crop")))
|
| 43 |
+
p["geometry"].append((angle, 1.0 + abs(angle) * 0.015 + float(rng.uniform(0, 0.02 * k("rotation_crop")))))
|
| 44 |
+
p["noise"] = 4.0 / 255.0 * k("noise") if rng.random() < 0.5 else 0.0
|
| 45 |
+
p["gaussian_blur"] = float(rng.uniform(0.25, 0.65)) * k("gaussian_blur") if rng.random() < 0.15 else 0.0
|
| 46 |
+
if rng.random() < 0.35:
|
| 47 |
+
lo = int(round(100 - k("jpeg") * 30))
|
| 48 |
+
hi = int(round(100 - k("jpeg") * 5))
|
| 49 |
+
p["jpeg"] = int(rng.integers(lo, hi + 1))
|
| 50 |
+
else:
|
| 51 |
+
p["jpeg"] = None
|
| 52 |
+
p["motion_blur"] = ((float(rng.uniform(3, 7)) * k("motion_blur") * px, float(rng.uniform(0, 180)))
|
| 53 |
+
if rng.random() < 0.15 else None)
|
| 54 |
+
p["sharpen"] = float(rng.uniform(0.2, 0.6)) * k("sharpen") if rng.random() < 0.15 else 0.0
|
| 55 |
+
p["defocus"] = float(rng.uniform(1, 2)) * k("defocus") * px if rng.random() < 0.10 else 0.0
|
| 56 |
+
if rng.random() < 0.30:
|
| 57 |
+
g = 0.30 * k("light_shadow")
|
| 58 |
+
p["light_shadow"] = [[(float(rng.uniform(0.1, 0.9)), float(rng.uniform(0.1, 0.9)),
|
| 59 |
+
float(rng.uniform(0.15, 0.35)), float(rng.uniform(1 - g, 1 + g)))
|
| 60 |
+
for _ in range(int(rng.integers(1, 3)))] for _ in range(views)]
|
| 61 |
+
else:
|
| 62 |
+
p["light_shadow"] = None
|
| 63 |
+
if rng.random() < 0.30:
|
| 64 |
+
g = 0.10 * k("wb_channel")
|
| 65 |
+
gains = []
|
| 66 |
+
for _ in range(views):
|
| 67 |
+
row = [1.0, 1.0, 1.0]
|
| 68 |
+
row[int(rng.integers(0, 3))] = float(rng.uniform(1 - g, 1 + g))
|
| 69 |
+
gains.append(row)
|
| 70 |
+
p["wb_channel"] = gains
|
| 71 |
+
else:
|
| 72 |
+
p["wb_channel"] = None
|
| 73 |
+
return p
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def _conv(x, kernel):
|
| 77 |
+
n, c, h, w = x.shape
|
| 78 |
+
k = kernel.to(x)[None, None].repeat(c, 1, 1, 1)
|
| 79 |
+
pad = kernel.shape[-1] // 2
|
| 80 |
+
return F.conv2d(F.pad(x, (pad, pad, pad, pad), mode="reflect"), k, groups=c)
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def motion_kernel(length, angle_deg):
|
| 84 |
+
size = max(3, int(round(length)) | 1)
|
| 85 |
+
k = torch.zeros(size, size)
|
| 86 |
+
c = size // 2
|
| 87 |
+
th = math.radians(angle_deg)
|
| 88 |
+
for s in np.linspace(-(length - 1) / 2, (length - 1) / 2, 8 * size):
|
| 89 |
+
k[int(round(c - s * math.sin(th))), int(round(c + s * math.cos(th)))] = 1.0
|
| 90 |
+
return k / k.sum()
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def disk_kernel(r):
|
| 94 |
+
size = 2 * int(math.ceil(r)) + 1
|
| 95 |
+
c = size // 2
|
| 96 |
+
yy, xx = torch.meshgrid(torch.arange(size), torch.arange(size), indexing="ij")
|
| 97 |
+
k = (((yy - c) ** 2 + (xx - c) ** 2) <= (r + 0.5) ** 2).float()
|
| 98 |
+
return k / k.sum()
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
def apply(x, p, obs_mask=None, noise_seed=0):
|
| 102 |
+
t, v, c, h, w = x.shape
|
| 103 |
+
x = x.clone().clamp(0, 1)
|
| 104 |
+
for vi, (angle, scale) in enumerate(p["geometry"]):
|
| 105 |
+
x[:, vi] = TF.affine(x[:, vi], angle=angle, translate=[0, 0], scale=scale, shear=[0, 0],
|
| 106 |
+
interpolation=InterpolationMode.BILINEAR)
|
| 107 |
+
if p["light_shadow"] is not None:
|
| 108 |
+
yy, xx = torch.meshgrid(torch.linspace(0, 1, h), torch.linspace(0, 1, w), indexing="ij")
|
| 109 |
+
for vi, blobs in enumerate(p["light_shadow"]):
|
| 110 |
+
m = torch.ones(h, w)
|
| 111 |
+
for cx, cy, s, g in blobs:
|
| 112 |
+
m = m + (g - 1.0) * torch.exp(-((xx - cx) ** 2 + (yy - cy) ** 2) / (2 * s * s))
|
| 113 |
+
x[:, vi] = (x[:, vi] * m.clamp(min=0).to(x)).clamp(0, 1)
|
| 114 |
+
if p["wb_channel"] is not None:
|
| 115 |
+
for vi, g in enumerate(p["wb_channel"]):
|
| 116 |
+
x[:, vi] = (x[:, vi] * torch.tensor(g, dtype=x.dtype).view(1, 3, 1, 1)).clamp(0, 1)
|
| 117 |
+
y = x.reshape(t * v, c, h, w)
|
| 118 |
+
y = (y * float(2.0 ** p["exposure"])).clamp(0, 1)
|
| 119 |
+
d = p["temperature"]
|
| 120 |
+
y = (y * y.new_tensor([1.0 + d, 1.0, 1.0 - d]).view(1, 3, 1, 1)).clamp(0, 1)
|
| 121 |
+
y = ((y - 0.5) * p["contrast"] + 0.5).clamp(0, 1)
|
| 122 |
+
y = TF.adjust_saturation(y, p["saturation"])
|
| 123 |
+
y = TF.adjust_hue(y, p["hue"])
|
| 124 |
+
y = y.clamp(0, 1).pow(p["gamma"])
|
| 125 |
+
x = y.reshape(t, v, c, h, w)
|
| 126 |
+
mask = torch.ones(t, dtype=torch.bool) if obs_mask is None else torch.as_tensor(obs_mask, dtype=torch.bool)
|
| 127 |
+
if bool(mask.any()):
|
| 128 |
+
o = x[mask].reshape(-1, c, h, w)
|
| 129 |
+
if p["gaussian_blur"] > 0:
|
| 130 |
+
o = TF.gaussian_blur(o, [3, 3], [p["gaussian_blur"]] * 2)
|
| 131 |
+
if p["motion_blur"] is not None:
|
| 132 |
+
o = _conv(o, motion_kernel(*p["motion_blur"]))
|
| 133 |
+
if p["defocus"] > 0:
|
| 134 |
+
o = _conv(o, disk_kernel(p["defocus"]))
|
| 135 |
+
if p["sharpen"] > 0:
|
| 136 |
+
o = o + p["sharpen"] * (o - TF.gaussian_blur(o, [5, 5], [1.0, 1.0]))
|
| 137 |
+
o = o.clamp(0, 1)
|
| 138 |
+
if p["noise"] > 0:
|
| 139 |
+
gen = torch.Generator().manual_seed(int(noise_seed))
|
| 140 |
+
o = (o + torch.randn(o.shape, generator=gen, dtype=o.dtype) * p["noise"]).clamp(0, 1)
|
| 141 |
+
if p["jpeg"] is not None:
|
| 142 |
+
for i in range(o.shape[0]):
|
| 143 |
+
buf = io.BytesIO()
|
| 144 |
+
TF.to_pil_image(o[i]).save(buf, format="JPEG", quality=int(p["jpeg"]))
|
| 145 |
+
buf.seek(0)
|
| 146 |
+
with Image.open(buf) as im:
|
| 147 |
+
o[i] = TF.pil_to_tensor(im.convert("RGB")).to(o.dtype).div(255.0)
|
| 148 |
+
x[mask] = o.reshape(-1, v, c, h, w)
|
| 149 |
+
return x.clamp(0, 1)
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
def augment(x, rng, obs_mask=None):
|
| 153 |
+
p = sample(rng, x.shape[1], x.shape[-2])
|
| 154 |
+
return apply(x, p, obs_mask, noise_seed=int(rng.integers(0, 2 ** 62))), p
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
def perturb_joints(q, rng):
|
| 158 |
+
q = np.asarray(q, dtype=np.float64)
|
| 159 |
+
d = q.shape[-1]
|
| 160 |
+
bias = rng.uniform(-math.radians(2.0), math.radians(2.0), size=d)
|
| 161 |
+
sigma = math.radians(0.25)
|
| 162 |
+
noise = np.clip(rng.normal(0.0, sigma, size=q.shape), -3 * sigma, 3 * sigma)
|
| 163 |
+
return (q + bias + noise).astype(np.float32)
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/__init__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FM-DiT, DP (Diffusion Policy, DDPM-DiT), ACT, FLASH, ODE-MLP and ODE-DiT visuomotor baselines of the Humanoid
|
| 2 |
+
Benchmark.
|
| 3 |
+
|
| 4 |
+
FM-DiT, DP and ACT are ported from DextraVerse's imitation-learning core (`dextraverse/algorithms/il/models/
|
| 5 |
+
{fm_dit,ddpm_dit,act}.py` and their networks), FLASH and FM-DiT v2 (FLASH-Policy's own FM-DiT; `fm_dit_v2.py`, a separate entry from the
|
| 6 |
+
DextraVerse FM-DiT) from NTUMARS/FLASH-Policy @ f47e490 (`flash.py`), ODE-MLP and
|
| 7 |
+
ODE-DiT after ODE Policy's G1 port (github.com/NTUMARS/ODE-POLICY real-g1; networks in ode_nets.py), each in its
|
| 8 |
+
authors' own configuration; torch only. `train.py` trains one on a task's LeRobot v2.1 expert dataset through a robot
|
| 9 |
+
contract (`data.CONTRACTS`: G1 state44/action76 or H2 state78/action75); `runtime.BaselinePolicy` serves a checkpoint
|
| 10 |
+
to the G1 evaluation adapters (`evaluation/policy/{FMDiT,FMDiT_v2,DP,ACT,FLASH,ODEMLP,ODEDiT}/model.py`, via `adapters.py`) and
|
| 11 |
+
to the H2 adapter
|
| 12 |
+
(`debug/newton/h2_policy_adapters/baseline.py`). Usage and the environment: evaluation/README.md#baselines.
|
| 13 |
+
"""
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/act_nets.py
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""ACT (Zhao et al. 2023, "Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware") network core: the
|
| 2 |
+
ResNet backbone with frozen BatchNorm and sine position embedding, the DETR encoder-decoder transformer and the CVAE
|
| 3 |
+
action-chunk decoder.
|
| 4 |
+
|
| 5 |
+
Ported unchanged from DextraVerse (`dextraverse/algorithms/il/models/nets/act/`), which vendors the ACT repository's
|
| 6 |
+
`detr/models/{backbone,position_encoding,transformer,detr_vae}.py` (Apache-2.0, (c) Facebook, Inc. and its
|
| 7 |
+
affiliates; see THIRD_PARTY_NOTICES.md) with the NestedTensor/argparse plumbing removed, explicit `qpos_dim` /
|
| 8 |
+
`action_dim` instead of the ALOHA 14-DoF constants, and one backbone shared by every camera (upstream behaviour).
|
| 9 |
+
The policy uses `return_intermediate_dec=False`: `Transformer.forward(...)[0]` is the final decoder layer.
|
| 10 |
+
"""
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import copy
|
| 14 |
+
import math
|
| 15 |
+
from typing import Optional
|
| 16 |
+
|
| 17 |
+
import numpy as np
|
| 18 |
+
import torch
|
| 19 |
+
import torch.nn.functional as F
|
| 20 |
+
import torchvision
|
| 21 |
+
from torch import Tensor, nn
|
| 22 |
+
from torchvision.models._utils import IntermediateLayerGetter
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class PositionEmbeddingSine(nn.Module):
|
| 26 |
+
"""Standard DETR sine embedding over a ``(B, C, H, W)`` feature map."""
|
| 27 |
+
|
| 28 |
+
def __init__(
|
| 29 |
+
self, num_pos_feats: int = 64, temperature: int = 10000, normalize: bool = False
|
| 30 |
+
) -> None:
|
| 31 |
+
super().__init__()
|
| 32 |
+
self.num_pos_feats = num_pos_feats
|
| 33 |
+
self.temperature = temperature
|
| 34 |
+
self.normalize = normalize
|
| 35 |
+
self.scale = 2 * math.pi
|
| 36 |
+
|
| 37 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 38 |
+
not_mask = torch.ones((1, x.shape[-2], x.shape[-1]), device=x.device)
|
| 39 |
+
y_embed = not_mask.cumsum(1, dtype=torch.float32)
|
| 40 |
+
x_embed = not_mask.cumsum(2, dtype=torch.float32)
|
| 41 |
+
if self.normalize:
|
| 42 |
+
eps = 1e-6
|
| 43 |
+
y_embed = y_embed / (y_embed[:, -1:, :] + eps) * self.scale
|
| 44 |
+
x_embed = x_embed / (x_embed[:, :, -1:] + eps) * self.scale
|
| 45 |
+
|
| 46 |
+
dim_t = torch.arange(self.num_pos_feats, dtype=torch.float32, device=x.device)
|
| 47 |
+
dim_t = self.temperature ** (2 * (dim_t // 2) / self.num_pos_feats)
|
| 48 |
+
|
| 49 |
+
pos_x = x_embed[:, :, :, None] / dim_t
|
| 50 |
+
pos_y = y_embed[:, :, :, None] / dim_t
|
| 51 |
+
pos_x = torch.stack(
|
| 52 |
+
(pos_x[:, :, :, 0::2].sin(), pos_x[:, :, :, 1::2].cos()), dim=4
|
| 53 |
+
).flatten(3)
|
| 54 |
+
pos_y = torch.stack(
|
| 55 |
+
(pos_y[:, :, :, 0::2].sin(), pos_y[:, :, :, 1::2].cos()), dim=4
|
| 56 |
+
).flatten(3)
|
| 57 |
+
return torch.cat((pos_y, pos_x), dim=3).permute(0, 3, 1, 2)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class FrozenBatchNorm2d(nn.Module):
|
| 61 |
+
"""BatchNorm2d with fixed statistics and affine parameters (the DETR/ACT backbone norm)."""
|
| 62 |
+
|
| 63 |
+
def __init__(self, n: int) -> None:
|
| 64 |
+
super().__init__()
|
| 65 |
+
self.register_buffer("weight", torch.ones(n))
|
| 66 |
+
self.register_buffer("bias", torch.zeros(n))
|
| 67 |
+
self.register_buffer("running_mean", torch.zeros(n))
|
| 68 |
+
self.register_buffer("running_var", torch.ones(n))
|
| 69 |
+
|
| 70 |
+
def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, *args):
|
| 71 |
+
state_dict.pop(prefix + "num_batches_tracked", None)
|
| 72 |
+
super()._load_from_state_dict(state_dict, prefix, local_metadata, strict, *args)
|
| 73 |
+
|
| 74 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 75 |
+
w = self.weight.reshape(1, -1, 1, 1)
|
| 76 |
+
b = self.bias.reshape(1, -1, 1, 1)
|
| 77 |
+
rv = self.running_var.reshape(1, -1, 1, 1)
|
| 78 |
+
rm = self.running_mean.reshape(1, -1, 1, 1)
|
| 79 |
+
scale = w * (rv + 1e-5).rsqrt()
|
| 80 |
+
return x * scale + (b - rm * scale)
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
class Backbone(nn.Module):
|
| 84 |
+
"""ResNet trunk returning the layer4 feature map."""
|
| 85 |
+
|
| 86 |
+
def __init__(self, name: str = "resnet18", weights: str | None = None) -> None:
|
| 87 |
+
super().__init__()
|
| 88 |
+
trunk = getattr(torchvision.models, name)(
|
| 89 |
+
replace_stride_with_dilation=[False, False, False],
|
| 90 |
+
weights=weights,
|
| 91 |
+
norm_layer=FrozenBatchNorm2d,
|
| 92 |
+
)
|
| 93 |
+
self.body = IntermediateLayerGetter(trunk, return_layers={"layer4": "0"})
|
| 94 |
+
self.num_channels = 512 if name in ("resnet18", "resnet34") else 2048
|
| 95 |
+
|
| 96 |
+
def forward(self, x: torch.Tensor) -> dict[str, torch.Tensor]:
|
| 97 |
+
return self.body(x)
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
class Joiner(nn.Sequential):
|
| 101 |
+
"""Backbone + position embedding, returning matched feature/position lists."""
|
| 102 |
+
|
| 103 |
+
def __init__(self, backbone: Backbone, position_embedding: PositionEmbeddingSine) -> None:
|
| 104 |
+
super().__init__(backbone, position_embedding)
|
| 105 |
+
self.num_channels = backbone.num_channels
|
| 106 |
+
|
| 107 |
+
def forward(self, x: torch.Tensor) -> tuple[list[torch.Tensor], list[torch.Tensor]]:
|
| 108 |
+
features = list(self[0](x).values())
|
| 109 |
+
pos = [self[1](f).to(f.dtype) for f in features]
|
| 110 |
+
return features, pos
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
def build_backbone(
|
| 114 |
+
name: str = "resnet18", hidden_dim: int = 512, weights: str | None = None
|
| 115 |
+
) -> Joiner:
|
| 116 |
+
"""The ACT camera backbone: ResNet + sine embedding sized to the transformer width."""
|
| 117 |
+
return Joiner(Backbone(name, weights=weights), PositionEmbeddingSine(hidden_dim // 2))
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
class Transformer(nn.Module):
|
| 121 |
+
def __init__(
|
| 122 |
+
self,
|
| 123 |
+
d_model=512,
|
| 124 |
+
nhead=8,
|
| 125 |
+
num_encoder_layers=6,
|
| 126 |
+
num_decoder_layers=6,
|
| 127 |
+
dim_feedforward=2048,
|
| 128 |
+
dropout=0.1,
|
| 129 |
+
activation="relu",
|
| 130 |
+
normalize_before=False,
|
| 131 |
+
return_intermediate_dec=False,
|
| 132 |
+
):
|
| 133 |
+
super().__init__()
|
| 134 |
+
|
| 135 |
+
encoder_layer = TransformerEncoderLayer(
|
| 136 |
+
d_model, nhead, dim_feedforward, dropout, activation, normalize_before
|
| 137 |
+
)
|
| 138 |
+
encoder_norm = nn.LayerNorm(d_model) if normalize_before else None
|
| 139 |
+
self.encoder = TransformerEncoder(encoder_layer, num_encoder_layers, encoder_norm)
|
| 140 |
+
|
| 141 |
+
decoder_layer = TransformerDecoderLayer(
|
| 142 |
+
d_model, nhead, dim_feedforward, dropout, activation, normalize_before
|
| 143 |
+
)
|
| 144 |
+
decoder_norm = nn.LayerNorm(d_model)
|
| 145 |
+
self.decoder = TransformerDecoder(
|
| 146 |
+
decoder_layer,
|
| 147 |
+
num_decoder_layers,
|
| 148 |
+
decoder_norm,
|
| 149 |
+
return_intermediate=return_intermediate_dec,
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
self._reset_parameters()
|
| 153 |
+
|
| 154 |
+
self.d_model = d_model
|
| 155 |
+
self.nhead = nhead
|
| 156 |
+
|
| 157 |
+
def _reset_parameters(self):
|
| 158 |
+
for p in self.parameters():
|
| 159 |
+
if p.dim() > 1:
|
| 160 |
+
nn.init.xavier_uniform_(p)
|
| 161 |
+
|
| 162 |
+
def forward(
|
| 163 |
+
self,
|
| 164 |
+
src,
|
| 165 |
+
mask,
|
| 166 |
+
query_embed,
|
| 167 |
+
pos_embed,
|
| 168 |
+
latent_input=None,
|
| 169 |
+
proprio_input=None,
|
| 170 |
+
additional_pos_embed=None,
|
| 171 |
+
):
|
| 172 |
+
# TODO flatten only when input has H and W
|
| 173 |
+
if len(src.shape) == 4: # has H and W
|
| 174 |
+
# flatten NxCxHxW to HWxNxC
|
| 175 |
+
bs, c, h, w = src.shape
|
| 176 |
+
src = src.flatten(2).permute(2, 0, 1)
|
| 177 |
+
pos_embed = pos_embed.flatten(2).permute(2, 0, 1).repeat(1, bs, 1)
|
| 178 |
+
query_embed = query_embed.unsqueeze(1).repeat(1, bs, 1)
|
| 179 |
+
# mask = mask.flatten(1)
|
| 180 |
+
|
| 181 |
+
additional_pos_embed = additional_pos_embed.unsqueeze(1).repeat(
|
| 182 |
+
1, bs, 1
|
| 183 |
+
) # seq, bs, dim
|
| 184 |
+
pos_embed = torch.cat([additional_pos_embed, pos_embed], axis=0)
|
| 185 |
+
|
| 186 |
+
addition_input = torch.stack([latent_input, proprio_input], axis=0)
|
| 187 |
+
src = torch.cat([addition_input, src], axis=0)
|
| 188 |
+
else:
|
| 189 |
+
assert len(src.shape) == 3
|
| 190 |
+
# flatten NxHWxC to HWxNxC
|
| 191 |
+
bs, hw, c = src.shape
|
| 192 |
+
src = src.permute(1, 0, 2)
|
| 193 |
+
pos_embed = pos_embed.unsqueeze(1).repeat(1, bs, 1)
|
| 194 |
+
query_embed = query_embed.unsqueeze(1).repeat(1, bs, 1)
|
| 195 |
+
|
| 196 |
+
tgt = torch.zeros_like(query_embed)
|
| 197 |
+
memory = self.encoder(src, src_key_padding_mask=mask, pos=pos_embed)
|
| 198 |
+
hs = self.decoder(
|
| 199 |
+
tgt, memory, memory_key_padding_mask=mask, pos=pos_embed, query_pos=query_embed
|
| 200 |
+
)
|
| 201 |
+
hs = hs.transpose(1, 2)
|
| 202 |
+
return hs
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
class TransformerEncoder(nn.Module):
|
| 206 |
+
def __init__(self, encoder_layer, num_layers, norm=None):
|
| 207 |
+
super().__init__()
|
| 208 |
+
self.layers = _get_clones(encoder_layer, num_layers)
|
| 209 |
+
self.num_layers = num_layers
|
| 210 |
+
self.norm = norm
|
| 211 |
+
|
| 212 |
+
def forward(
|
| 213 |
+
self,
|
| 214 |
+
src,
|
| 215 |
+
mask: Optional[Tensor] = None,
|
| 216 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 217 |
+
pos: Optional[Tensor] = None,
|
| 218 |
+
):
|
| 219 |
+
output = src
|
| 220 |
+
|
| 221 |
+
for layer in self.layers:
|
| 222 |
+
output = layer(
|
| 223 |
+
output, src_mask=mask, src_key_padding_mask=src_key_padding_mask, pos=pos
|
| 224 |
+
)
|
| 225 |
+
|
| 226 |
+
if self.norm is not None:
|
| 227 |
+
output = self.norm(output)
|
| 228 |
+
|
| 229 |
+
return output
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
class TransformerDecoder(nn.Module):
|
| 233 |
+
def __init__(self, decoder_layer, num_layers, norm=None, return_intermediate=False):
|
| 234 |
+
super().__init__()
|
| 235 |
+
self.layers = _get_clones(decoder_layer, num_layers)
|
| 236 |
+
self.num_layers = num_layers
|
| 237 |
+
self.norm = norm
|
| 238 |
+
self.return_intermediate = return_intermediate
|
| 239 |
+
|
| 240 |
+
def forward(
|
| 241 |
+
self,
|
| 242 |
+
tgt,
|
| 243 |
+
memory,
|
| 244 |
+
tgt_mask: Optional[Tensor] = None,
|
| 245 |
+
memory_mask: Optional[Tensor] = None,
|
| 246 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 247 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 248 |
+
pos: Optional[Tensor] = None,
|
| 249 |
+
query_pos: Optional[Tensor] = None,
|
| 250 |
+
):
|
| 251 |
+
output = tgt
|
| 252 |
+
|
| 253 |
+
intermediate = []
|
| 254 |
+
|
| 255 |
+
for layer in self.layers:
|
| 256 |
+
output = layer(
|
| 257 |
+
output,
|
| 258 |
+
memory,
|
| 259 |
+
tgt_mask=tgt_mask,
|
| 260 |
+
memory_mask=memory_mask,
|
| 261 |
+
tgt_key_padding_mask=tgt_key_padding_mask,
|
| 262 |
+
memory_key_padding_mask=memory_key_padding_mask,
|
| 263 |
+
pos=pos,
|
| 264 |
+
query_pos=query_pos,
|
| 265 |
+
)
|
| 266 |
+
if self.return_intermediate:
|
| 267 |
+
intermediate.append(self.norm(output))
|
| 268 |
+
|
| 269 |
+
if self.norm is not None:
|
| 270 |
+
output = self.norm(output)
|
| 271 |
+
if self.return_intermediate:
|
| 272 |
+
intermediate.pop()
|
| 273 |
+
intermediate.append(output)
|
| 274 |
+
|
| 275 |
+
if self.return_intermediate:
|
| 276 |
+
return torch.stack(intermediate)
|
| 277 |
+
|
| 278 |
+
return output.unsqueeze(0)
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
class TransformerEncoderLayer(nn.Module):
|
| 282 |
+
def __init__(
|
| 283 |
+
self,
|
| 284 |
+
d_model,
|
| 285 |
+
nhead,
|
| 286 |
+
dim_feedforward=2048,
|
| 287 |
+
dropout=0.1,
|
| 288 |
+
activation="relu",
|
| 289 |
+
normalize_before=False,
|
| 290 |
+
):
|
| 291 |
+
super().__init__()
|
| 292 |
+
self.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
|
| 293 |
+
# Implementation of Feedforward model
|
| 294 |
+
self.linear1 = nn.Linear(d_model, dim_feedforward)
|
| 295 |
+
self.dropout = nn.Dropout(dropout)
|
| 296 |
+
self.linear2 = nn.Linear(dim_feedforward, d_model)
|
| 297 |
+
|
| 298 |
+
self.norm1 = nn.LayerNorm(d_model)
|
| 299 |
+
self.norm2 = nn.LayerNorm(d_model)
|
| 300 |
+
self.dropout1 = nn.Dropout(dropout)
|
| 301 |
+
self.dropout2 = nn.Dropout(dropout)
|
| 302 |
+
|
| 303 |
+
self.activation = _get_activation_fn(activation)
|
| 304 |
+
self.normalize_before = normalize_before
|
| 305 |
+
|
| 306 |
+
def with_pos_embed(self, tensor, pos: Optional[Tensor]):
|
| 307 |
+
return tensor if pos is None else tensor + pos
|
| 308 |
+
|
| 309 |
+
def forward_post(
|
| 310 |
+
self,
|
| 311 |
+
src,
|
| 312 |
+
src_mask: Optional[Tensor] = None,
|
| 313 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 314 |
+
pos: Optional[Tensor] = None,
|
| 315 |
+
):
|
| 316 |
+
q = k = self.with_pos_embed(src, pos)
|
| 317 |
+
src2 = self.self_attn(
|
| 318 |
+
q, k, value=src, attn_mask=src_mask, key_padding_mask=src_key_padding_mask
|
| 319 |
+
)[0]
|
| 320 |
+
src = src + self.dropout1(src2)
|
| 321 |
+
src = self.norm1(src)
|
| 322 |
+
src2 = self.linear2(self.dropout(self.activation(self.linear1(src))))
|
| 323 |
+
src = src + self.dropout2(src2)
|
| 324 |
+
src = self.norm2(src)
|
| 325 |
+
return src
|
| 326 |
+
|
| 327 |
+
def forward_pre(
|
| 328 |
+
self,
|
| 329 |
+
src,
|
| 330 |
+
src_mask: Optional[Tensor] = None,
|
| 331 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 332 |
+
pos: Optional[Tensor] = None,
|
| 333 |
+
):
|
| 334 |
+
src2 = self.norm1(src)
|
| 335 |
+
q = k = self.with_pos_embed(src2, pos)
|
| 336 |
+
src2 = self.self_attn(
|
| 337 |
+
q, k, value=src2, attn_mask=src_mask, key_padding_mask=src_key_padding_mask
|
| 338 |
+
)[0]
|
| 339 |
+
src = src + self.dropout1(src2)
|
| 340 |
+
src2 = self.norm2(src)
|
| 341 |
+
src2 = self.linear2(self.dropout(self.activation(self.linear1(src2))))
|
| 342 |
+
src = src + self.dropout2(src2)
|
| 343 |
+
return src
|
| 344 |
+
|
| 345 |
+
def forward(
|
| 346 |
+
self,
|
| 347 |
+
src,
|
| 348 |
+
src_mask: Optional[Tensor] = None,
|
| 349 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 350 |
+
pos: Optional[Tensor] = None,
|
| 351 |
+
):
|
| 352 |
+
if self.normalize_before:
|
| 353 |
+
return self.forward_pre(src, src_mask, src_key_padding_mask, pos)
|
| 354 |
+
return self.forward_post(src, src_mask, src_key_padding_mask, pos)
|
| 355 |
+
|
| 356 |
+
|
| 357 |
+
class TransformerDecoderLayer(nn.Module):
|
| 358 |
+
def __init__(
|
| 359 |
+
self,
|
| 360 |
+
d_model,
|
| 361 |
+
nhead,
|
| 362 |
+
dim_feedforward=2048,
|
| 363 |
+
dropout=0.1,
|
| 364 |
+
activation="relu",
|
| 365 |
+
normalize_before=False,
|
| 366 |
+
):
|
| 367 |
+
super().__init__()
|
| 368 |
+
self.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
|
| 369 |
+
self.multihead_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
|
| 370 |
+
# Implementation of Feedforward model
|
| 371 |
+
self.linear1 = nn.Linear(d_model, dim_feedforward)
|
| 372 |
+
self.dropout = nn.Dropout(dropout)
|
| 373 |
+
self.linear2 = nn.Linear(dim_feedforward, d_model)
|
| 374 |
+
|
| 375 |
+
self.norm1 = nn.LayerNorm(d_model)
|
| 376 |
+
self.norm2 = nn.LayerNorm(d_model)
|
| 377 |
+
self.norm3 = nn.LayerNorm(d_model)
|
| 378 |
+
self.dropout1 = nn.Dropout(dropout)
|
| 379 |
+
self.dropout2 = nn.Dropout(dropout)
|
| 380 |
+
self.dropout3 = nn.Dropout(dropout)
|
| 381 |
+
|
| 382 |
+
self.activation = _get_activation_fn(activation)
|
| 383 |
+
self.normalize_before = normalize_before
|
| 384 |
+
|
| 385 |
+
def with_pos_embed(self, tensor, pos: Optional[Tensor]):
|
| 386 |
+
return tensor if pos is None else tensor + pos
|
| 387 |
+
|
| 388 |
+
def forward_post(
|
| 389 |
+
self,
|
| 390 |
+
tgt,
|
| 391 |
+
memory,
|
| 392 |
+
tgt_mask: Optional[Tensor] = None,
|
| 393 |
+
memory_mask: Optional[Tensor] = None,
|
| 394 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 395 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 396 |
+
pos: Optional[Tensor] = None,
|
| 397 |
+
query_pos: Optional[Tensor] = None,
|
| 398 |
+
):
|
| 399 |
+
q = k = self.with_pos_embed(tgt, query_pos)
|
| 400 |
+
tgt2 = self.self_attn(
|
| 401 |
+
q, k, value=tgt, attn_mask=tgt_mask, key_padding_mask=tgt_key_padding_mask
|
| 402 |
+
)[0]
|
| 403 |
+
tgt = tgt + self.dropout1(tgt2)
|
| 404 |
+
tgt = self.norm1(tgt)
|
| 405 |
+
tgt2 = self.multihead_attn(
|
| 406 |
+
query=self.with_pos_embed(tgt, query_pos),
|
| 407 |
+
key=self.with_pos_embed(memory, pos),
|
| 408 |
+
value=memory,
|
| 409 |
+
attn_mask=memory_mask,
|
| 410 |
+
key_padding_mask=memory_key_padding_mask,
|
| 411 |
+
)[0]
|
| 412 |
+
tgt = tgt + self.dropout2(tgt2)
|
| 413 |
+
tgt = self.norm2(tgt)
|
| 414 |
+
tgt2 = self.linear2(self.dropout(self.activation(self.linear1(tgt))))
|
| 415 |
+
tgt = tgt + self.dropout3(tgt2)
|
| 416 |
+
tgt = self.norm3(tgt)
|
| 417 |
+
return tgt
|
| 418 |
+
|
| 419 |
+
def forward_pre(
|
| 420 |
+
self,
|
| 421 |
+
tgt,
|
| 422 |
+
memory,
|
| 423 |
+
tgt_mask: Optional[Tensor] = None,
|
| 424 |
+
memory_mask: Optional[Tensor] = None,
|
| 425 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 426 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 427 |
+
pos: Optional[Tensor] = None,
|
| 428 |
+
query_pos: Optional[Tensor] = None,
|
| 429 |
+
):
|
| 430 |
+
tgt2 = self.norm1(tgt)
|
| 431 |
+
q = k = self.with_pos_embed(tgt2, query_pos)
|
| 432 |
+
tgt2 = self.self_attn(
|
| 433 |
+
q, k, value=tgt2, attn_mask=tgt_mask, key_padding_mask=tgt_key_padding_mask
|
| 434 |
+
)[0]
|
| 435 |
+
tgt = tgt + self.dropout1(tgt2)
|
| 436 |
+
tgt2 = self.norm2(tgt)
|
| 437 |
+
tgt2 = self.multihead_attn(
|
| 438 |
+
query=self.with_pos_embed(tgt2, query_pos),
|
| 439 |
+
key=self.with_pos_embed(memory, pos),
|
| 440 |
+
value=memory,
|
| 441 |
+
attn_mask=memory_mask,
|
| 442 |
+
key_padding_mask=memory_key_padding_mask,
|
| 443 |
+
)[0]
|
| 444 |
+
tgt = tgt + self.dropout2(tgt2)
|
| 445 |
+
tgt2 = self.norm3(tgt)
|
| 446 |
+
tgt2 = self.linear2(self.dropout(self.activation(self.linear1(tgt2))))
|
| 447 |
+
tgt = tgt + self.dropout3(tgt2)
|
| 448 |
+
return tgt
|
| 449 |
+
|
| 450 |
+
def forward(
|
| 451 |
+
self,
|
| 452 |
+
tgt,
|
| 453 |
+
memory,
|
| 454 |
+
tgt_mask: Optional[Tensor] = None,
|
| 455 |
+
memory_mask: Optional[Tensor] = None,
|
| 456 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 457 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 458 |
+
pos: Optional[Tensor] = None,
|
| 459 |
+
query_pos: Optional[Tensor] = None,
|
| 460 |
+
):
|
| 461 |
+
if self.normalize_before:
|
| 462 |
+
return self.forward_pre(
|
| 463 |
+
tgt,
|
| 464 |
+
memory,
|
| 465 |
+
tgt_mask,
|
| 466 |
+
memory_mask,
|
| 467 |
+
tgt_key_padding_mask,
|
| 468 |
+
memory_key_padding_mask,
|
| 469 |
+
pos,
|
| 470 |
+
query_pos,
|
| 471 |
+
)
|
| 472 |
+
return self.forward_post(
|
| 473 |
+
tgt,
|
| 474 |
+
memory,
|
| 475 |
+
tgt_mask,
|
| 476 |
+
memory_mask,
|
| 477 |
+
tgt_key_padding_mask,
|
| 478 |
+
memory_key_padding_mask,
|
| 479 |
+
pos,
|
| 480 |
+
query_pos,
|
| 481 |
+
)
|
| 482 |
+
|
| 483 |
+
|
| 484 |
+
def _get_clones(module, N):
|
| 485 |
+
return nn.ModuleList([copy.deepcopy(module) for i in range(N)])
|
| 486 |
+
|
| 487 |
+
|
| 488 |
+
def _get_activation_fn(activation):
|
| 489 |
+
"""Return an activation function given a string."""
|
| 490 |
+
if activation == "relu":
|
| 491 |
+
return F.relu
|
| 492 |
+
if activation == "gelu":
|
| 493 |
+
return F.gelu
|
| 494 |
+
raise RuntimeError(f"activation should be relu/gelu, not {activation}.")
|
| 495 |
+
|
| 496 |
+
|
| 497 |
+
|
| 498 |
+
def reparametrize(mu: torch.Tensor, logvar: torch.Tensor) -> torch.Tensor:
|
| 499 |
+
std = logvar.div(2).exp()
|
| 500 |
+
return mu + std * torch.randn_like(std)
|
| 501 |
+
|
| 502 |
+
|
| 503 |
+
def get_sinusoid_encoding_table(n_position: int, d_hid: int) -> torch.Tensor:
|
| 504 |
+
def angle_vec(position: int) -> list[float]:
|
| 505 |
+
return [position / np.power(10000, 2 * (j // 2) / d_hid) for j in range(d_hid)]
|
| 506 |
+
|
| 507 |
+
table = np.array([angle_vec(i) for i in range(n_position)])
|
| 508 |
+
table[:, 0::2] = np.sin(table[:, 0::2])
|
| 509 |
+
table[:, 1::2] = np.cos(table[:, 1::2])
|
| 510 |
+
return torch.FloatTensor(table).unsqueeze(0)
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
def build_style_encoder(
|
| 514 |
+
hidden_dim: int, nheads: int, dim_feedforward: int, enc_layers: int, dropout: float
|
| 515 |
+
) -> TransformerEncoder:
|
| 516 |
+
"""The CVAE style encoder (a plain transformer encoder over [CLS, qpos, action seq])."""
|
| 517 |
+
layer = TransformerEncoderLayer(hidden_dim, nheads, dim_feedforward, dropout, "relu", False)
|
| 518 |
+
return TransformerEncoder(layer, enc_layers, norm=None)
|
| 519 |
+
|
| 520 |
+
|
| 521 |
+
class DETRVAE(nn.Module):
|
| 522 |
+
"""CVAE decoder: (qpos, images[, action seq]) → ``num_queries`` future actions."""
|
| 523 |
+
|
| 524 |
+
def __init__(
|
| 525 |
+
self,
|
| 526 |
+
backbone: Joiner,
|
| 527 |
+
transformer: Transformer,
|
| 528 |
+
encoder: TransformerEncoder,
|
| 529 |
+
*,
|
| 530 |
+
qpos_dim: int,
|
| 531 |
+
action_dim: int,
|
| 532 |
+
num_queries: int,
|
| 533 |
+
latent_dim: int = 32,
|
| 534 |
+
) -> None:
|
| 535 |
+
super().__init__()
|
| 536 |
+
self.num_queries = num_queries
|
| 537 |
+
self.transformer = transformer
|
| 538 |
+
self.encoder = encoder
|
| 539 |
+
hidden_dim = transformer.d_model
|
| 540 |
+
self.action_head = nn.Linear(hidden_dim, action_dim)
|
| 541 |
+
self.query_embed = nn.Embedding(num_queries, hidden_dim)
|
| 542 |
+
self.backbone = backbone # ONE backbone shared by every camera (upstream behavior)
|
| 543 |
+
self.input_proj = nn.Conv2d(backbone.num_channels, hidden_dim, kernel_size=1)
|
| 544 |
+
self.input_proj_robot_state = nn.Linear(qpos_dim, hidden_dim)
|
| 545 |
+
|
| 546 |
+
# CVAE style encoder inputs
|
| 547 |
+
self.latent_dim = latent_dim
|
| 548 |
+
self.cls_embed = nn.Embedding(1, hidden_dim)
|
| 549 |
+
self.encoder_action_proj = nn.Linear(action_dim, hidden_dim)
|
| 550 |
+
self.encoder_joint_proj = nn.Linear(qpos_dim, hidden_dim)
|
| 551 |
+
self.latent_proj = nn.Linear(hidden_dim, latent_dim * 2)
|
| 552 |
+
self.register_buffer(
|
| 553 |
+
"pos_table", get_sinusoid_encoding_table(1 + 1 + num_queries, hidden_dim)
|
| 554 |
+
)
|
| 555 |
+
# decoder side
|
| 556 |
+
self.latent_out_proj = nn.Linear(latent_dim, hidden_dim)
|
| 557 |
+
self.additional_pos_embed = nn.Embedding(2, hidden_dim) # latent + proprio slots
|
| 558 |
+
|
| 559 |
+
def forward(
|
| 560 |
+
self,
|
| 561 |
+
qpos: torch.Tensor,
|
| 562 |
+
images: torch.Tensor,
|
| 563 |
+
actions: torch.Tensor | None = None,
|
| 564 |
+
is_pad: torch.Tensor | None = None,
|
| 565 |
+
) -> tuple[torch.Tensor, tuple[torch.Tensor | None, torch.Tensor | None]]:
|
| 566 |
+
"""``qpos (B, Dq)``, ``images (B, ncam, C, H, W)``; train passes ``actions (B, T, Da)``."""
|
| 567 |
+
is_training = actions is not None
|
| 568 |
+
bs = qpos.shape[0]
|
| 569 |
+
if is_training:
|
| 570 |
+
action_embed = self.encoder_action_proj(actions)
|
| 571 |
+
qpos_embed = self.encoder_joint_proj(qpos).unsqueeze(1)
|
| 572 |
+
cls_embed = self.cls_embed.weight.unsqueeze(0).repeat(bs, 1, 1)
|
| 573 |
+
encoder_input = torch.cat([cls_embed, qpos_embed, action_embed], dim=1)
|
| 574 |
+
encoder_input = encoder_input.permute(1, 0, 2)
|
| 575 |
+
if is_pad is None:
|
| 576 |
+
is_pad = torch.zeros(bs, actions.shape[1], dtype=torch.bool, device=qpos.device)
|
| 577 |
+
cls_joint_is_pad = torch.full((bs, 2), False, device=qpos.device)
|
| 578 |
+
key_pad = torch.cat([cls_joint_is_pad, is_pad], dim=1)
|
| 579 |
+
pos_embed = self.pos_table.clone().detach().permute(1, 0, 2)
|
| 580 |
+
encoder_output = self.encoder(
|
| 581 |
+
encoder_input, pos=pos_embed, src_key_padding_mask=key_pad
|
| 582 |
+
)[0]
|
| 583 |
+
latent_info = self.latent_proj(encoder_output)
|
| 584 |
+
mu = latent_info[:, : self.latent_dim]
|
| 585 |
+
logvar = latent_info[:, self.latent_dim :]
|
| 586 |
+
latent_input = self.latent_out_proj(reparametrize(mu, logvar))
|
| 587 |
+
else:
|
| 588 |
+
mu = logvar = None
|
| 589 |
+
latent_sample = torch.zeros(bs, self.latent_dim, device=qpos.device)
|
| 590 |
+
latent_input = self.latent_out_proj(latent_sample)
|
| 591 |
+
|
| 592 |
+
all_cam_features, all_cam_pos = [], []
|
| 593 |
+
for cam_id in range(images.shape[1]):
|
| 594 |
+
features, pos = self.backbone(images[:, cam_id])
|
| 595 |
+
all_cam_features.append(self.input_proj(features[0]))
|
| 596 |
+
all_cam_pos.append(pos[0])
|
| 597 |
+
proprio_input = self.input_proj_robot_state(qpos)
|
| 598 |
+
src = torch.cat(all_cam_features, dim=3) # cameras fold into the width axis
|
| 599 |
+
pos = torch.cat(all_cam_pos, dim=3)
|
| 600 |
+
hs = self.transformer(
|
| 601 |
+
src,
|
| 602 |
+
None,
|
| 603 |
+
self.query_embed.weight,
|
| 604 |
+
pos,
|
| 605 |
+
latent_input,
|
| 606 |
+
proprio_input,
|
| 607 |
+
self.additional_pos_embed.weight,
|
| 608 |
+
)[0]
|
| 609 |
+
return self.action_head(hs), (mu, logvar)
|
| 610 |
+
|
| 611 |
+
|
| 612 |
+
def kl_divergence(mu: torch.Tensor, logvar: torch.Tensor) -> torch.Tensor:
|
| 613 |
+
"""Total KL(q(z|x) || N(0, I)), summed over latent dims, meaned over the batch."""
|
| 614 |
+
klds = -0.5 * (1 + logvar - mu.pow(2) - logvar.exp())
|
| 615 |
+
return klds.sum(1).mean()
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/adapters.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The G1 evaluation adapters of the baselines (evaluation/README.md#the-model-interface): `make_model('fm_dit')`
|
| 2 |
+
returns the `Model` class that `evaluation/policy/FMDiT/model.py` exports (likewise DP, ACT, FLASH, ODEMLP, ODEDiT).
|
| 3 |
+
|
| 4 |
+
Observation: the current ego_view and chest frames (480x640 RGB, resized as the training cache) and state44; FM-DiT,
|
| 5 |
+
DP and ACT read no past actions or earlier frames (one frame); FLASH and the ODE policies also read the interface's
|
| 6 |
+
executed rows before the query (`past_actions`, `history_valid`: the token sent and the INSPIRE opening measured at
|
| 7 |
+
each earlier frame): FLASH for its polynomial history, the ODE policies the last one (frame t-1) as their start.
|
| 8 |
+
Output: the checkpoint's whole chunk (16 rows of action76, row 0 executed at the request's frame), `execution_steps`
|
| 9 |
+
rows of it executed before the next query (deploy.yml `config: execution_steps`, default the whole chunk; the runners
|
| 10 |
+
re-query after at most 12 rows), the request's seed for the sampling noise (FM-DiT, DP).
|
| 11 |
+
"""
|
| 12 |
+
from __future__ import annotations
|
| 13 |
+
|
| 14 |
+
from .runtime import BaselinePolicy
|
| 15 |
+
|
| 16 |
+
WIDTH = {'sonic_dfx6': 76}
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def require(condition, message):
|
| 20 |
+
if not condition:
|
| 21 |
+
raise RuntimeError(message)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def make_model(policy_name: str):
|
| 25 |
+
class Model:
|
| 26 |
+
history_length = 1 # the current head and chest frames only
|
| 27 |
+
video_frames = 0
|
| 28 |
+
|
| 29 |
+
def __init__(self, cfg):
|
| 30 |
+
self.policy = BaselinePolicy(cfg['checkpoint_path'], device=cfg.get('device', 'cuda:0'),
|
| 31 |
+
policy=policy_name, robot='g1')
|
| 32 |
+
contract = self.policy.contract
|
| 33 |
+
require(cfg['action_space'] in WIDTH and contract['action_space'] == cfg['action_space']
|
| 34 |
+
and self.policy.action_dim == WIDTH[cfg['action_space']] and self.policy.state_dim == 44
|
| 35 |
+
and list(self.policy.cameras) == ['ego_view', 'chest'],
|
| 36 |
+
f"checkpoint contract {contract['name']} does not serve {cfg['action_space']}")
|
| 37 |
+
extra = cfg.get('config') or {}
|
| 38 |
+
if extra.get('check_task', True):
|
| 39 |
+
require(cfg['task'].strip() == (self.policy.task_text or '').strip(),
|
| 40 |
+
f'task text {cfg["task"]!r} is not the training task {self.policy.task_text!r}')
|
| 41 |
+
self.execution_steps = int(extra.get('execution_steps') or self.policy.horizon)
|
| 42 |
+
require(1 <= self.execution_steps <= self.policy.horizon, f'execution_steps {self.execution_steps}')
|
| 43 |
+
self.uses_history = self.policy.name == 'flash' or self.policy.uses_previous
|
| 44 |
+
self.info = dict(self.policy.info(), execution_steps=self.execution_steps,
|
| 45 |
+
inputs='current frames + state44' + (' + executed-action history' if self.uses_history
|
| 46 |
+
else ''))
|
| 47 |
+
|
| 48 |
+
def get_action(self, obs):
|
| 49 |
+
if self.uses_history:
|
| 50 |
+
action, _ = self.policy.predict(obs['images'], obs['state'], seed=obs['seed'],
|
| 51 |
+
past_actions=obs['past_actions'], history_valid=obs['history_valid'])
|
| 52 |
+
else:
|
| 53 |
+
action, _ = self.policy.predict(obs['images'], obs['state'], seed=obs['seed'])
|
| 54 |
+
return dict(action=action, execution_steps=self.execution_steps,
|
| 55 |
+
sampling_steps=self.policy.sampling_steps)
|
| 56 |
+
|
| 57 |
+
Model.__name__ = Model.__qualname__ = f'Model_{policy_name}'
|
| 58 |
+
return Model
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline check of the FLASH adapter against the training path on recorded frames (before any closed-loop run):
|
| 2 |
+
|
| 3 |
+
<baselines env>/bin/python -I evaluation/baselines/check_flash_adapter.py --checkpoint <checkpoints/step-NNNNNN> \\
|
| 4 |
+
--dataset <LeRobot v2.1 root> --episodes 0,60 --queries 8 [--device cuda:0]
|
| 5 |
+
|
| 6 |
+
For query frames t of each episode (0, then evenly spaced) it builds
|
| 7 |
+
(a) the interface observation a runner sends: the 480x640 ego_view / chest frames (decoded from the dataset videos),
|
| 8 |
+
state44 and past_actions = the 40 recorded action rows before t (history_valid 0 before the episode start), and
|
| 9 |
+
calls evaluation/policy/FLASH/model.py Model.get_action, the deployed adapter;
|
| 10 |
+
(b) the training path: FlashChunkDataset's item for the same anchor (frames resized as the frame cache, the dataset's
|
| 11 |
+
history rule) through FlashPolicy.predict.
|
| 12 |
+
Both chunks must be equal bit for bit (same weights, same device); it also prints the normalized MSE of the chunk
|
| 13 |
+
against the recorded rows from t (rows past the episode's end excluded). Exits 1 on a mismatch.
|
| 14 |
+
"""
|
| 15 |
+
from __future__ import annotations
|
| 16 |
+
|
| 17 |
+
import argparse
|
| 18 |
+
import json
|
| 19 |
+
from pathlib import Path
|
| 20 |
+
import sys
|
| 21 |
+
|
| 22 |
+
import numpy as np
|
| 23 |
+
|
| 24 |
+
HERE = Path(__file__).resolve().parent
|
| 25 |
+
EVALUATION = HERE.parent
|
| 26 |
+
if str(EVALUATION) not in sys.path:
|
| 27 |
+
sys.path.insert(0, str(EVALUATION))
|
| 28 |
+
|
| 29 |
+
HISTORY_ROWS = 40 # the interface's past_actions rows (debug/newton/b6_policy_eval.py HISTORY_ROWS)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def decode(path, indices):
|
| 33 |
+
import av
|
| 34 |
+
want, out = set(int(i) for i in indices), {}
|
| 35 |
+
with av.open(str(path)) as container:
|
| 36 |
+
for k, frame in enumerate(container.decode(video=0)):
|
| 37 |
+
if k in want:
|
| 38 |
+
out[k] = frame.to_ndarray(format='rgb24')
|
| 39 |
+
if len(out) == len(want):
|
| 40 |
+
break
|
| 41 |
+
return out
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def main():
|
| 45 |
+
p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
| 46 |
+
p.add_argument('--checkpoint', type=Path, required=True)
|
| 47 |
+
p.add_argument('--dataset', type=Path, required=True)
|
| 48 |
+
p.add_argument('--episodes', default='0')
|
| 49 |
+
p.add_argument('--queries', type=int, default=8)
|
| 50 |
+
p.add_argument('--device', default='cuda:0')
|
| 51 |
+
a = p.parse_args()
|
| 52 |
+
|
| 53 |
+
import torch
|
| 54 |
+
from baselines.data import CONTRACTS, FlashChunkDataset, LeRobotDataset, load_lowdim, resize_frame
|
| 55 |
+
from baselines.runtime import BaselinePolicy
|
| 56 |
+
sys.path.insert(0, str(EVALUATION / 'policy' / 'FLASH'))
|
| 57 |
+
import model as flash_model
|
| 58 |
+
|
| 59 |
+
base = BaselinePolicy(a.checkpoint, device=a.device, policy='flash', robot='g1')
|
| 60 |
+
contract = CONTRACTS[base.contract['name']]
|
| 61 |
+
adapter = flash_model.Model(dict(checkpoint_path=str(a.checkpoint), device=a.device, action_space='sonic_dfx6',
|
| 62 |
+
task=base.task_text or '', config={}))
|
| 63 |
+
policy = adapter.policy.model # the adapter's own loaded weights
|
| 64 |
+
dataset = LeRobotDataset(a.dataset)
|
| 65 |
+
episodes = [int(e) for e in a.episodes.split(',')]
|
| 66 |
+
lowdim = load_lowdim(dataset, contract, episodes)
|
| 67 |
+
report, worst = [], 0.0
|
| 68 |
+
for pos, ep in enumerate(episodes):
|
| 69 |
+
s, n = int(lowdim['starts'][pos]), int(lowdim['lengths'][pos])
|
| 70 |
+
ts = sorted({0, *np.linspace(0, n - 1, a.queries).astype(int).tolist()})[:a.queries]
|
| 71 |
+
frames = {c: decode(dataset.video(ep, c), ts) for c in base.cameras}
|
| 72 |
+
hw = base.image_hw
|
| 73 |
+
maps = {c: np.zeros((lowdim['lengths'].sum(), *hw, 3), np.uint8) for c in base.cameras}
|
| 74 |
+
for t in ts:
|
| 75 |
+
for c in base.cameras:
|
| 76 |
+
maps[c][s + t] = resize_frame(frames[c][t], hw) # the frame cache's resize of the same frame
|
| 77 |
+
f = policy.flash
|
| 78 |
+
H_ext = f['poly_prefix'] + f['n_action'] + f['poly_suffix'] + 2 * f['fit_pad']
|
| 79 |
+
offsets = (np.arange(H_ext) - (f['fit_pad'] + f['poly_prefix'])) * f['stride']
|
| 80 |
+
ds = FlashChunkDataset(lowdim, {}, base.cameras, hw, [pos], offsets=offsets, stride=f['stride'],
|
| 81 |
+
n_history=f['n_history'], rows=f['rows'], with_dense=True)
|
| 82 |
+
ds._maps, ds._pid = maps, __import__('os').getpid()
|
| 83 |
+
for t in ts:
|
| 84 |
+
k = int(np.nonzero(ds.index == s + t)[0][0])
|
| 85 |
+
images, state, _, hist, has, dense, dense_valid = ds[k]
|
| 86 |
+
idx = np.arange(t - HISTORY_ROWS, t)
|
| 87 |
+
past = lowdim['action'][s + np.clip(idx, 0, n - 1)].astype(np.float32)
|
| 88 |
+
valid = (idx >= 0).astype(np.float32)
|
| 89 |
+
past[idx < 0] = 0.0
|
| 90 |
+
obs = dict(images={c: frames[c][t] for c in base.cameras}, state=lowdim['state'][s + t],
|
| 91 |
+
past_actions=past, history_valid=valid, seed=0, frame=t, history_frame=t)
|
| 92 |
+
a_chunk = adapter.get_action(obs)['action']
|
| 93 |
+
with torch.inference_mode():
|
| 94 |
+
img = images[None].to(a.device).permute(0, 1, 4, 2, 3).float().div_(255.)
|
| 95 |
+
b_chunk, _ = policy.predict(img, state[None].to(a.device), hist[None].to(a.device),
|
| 96 |
+
has[None].to(a.device))
|
| 97 |
+
b_chunk = b_chunk[0].float().cpu().numpy()
|
| 98 |
+
diff = float(np.abs(a_chunk - b_chunk).max())
|
| 99 |
+
worst = max(worst, diff)
|
| 100 |
+
nrm = policy.action_norm
|
| 101 |
+
err = (nrm.normalize(torch.from_numpy(a_chunk).to(a.device)) -
|
| 102 |
+
nrm.normalize(dense.to(a.device))).pow(2).cpu().numpy()[dense_valid.numpy()]
|
| 103 |
+
report.append(dict(episode=ep, t=t, has_history=bool(has), max_abs_diff=diff,
|
| 104 |
+
nmse_vs_recorded=float(err.mean()),
|
| 105 |
+
token_cos_row0=float(np.dot(a_chunk[0, :64], dense[0, :64].numpy()) /
|
| 106 |
+
(np.linalg.norm(a_chunk[0, :64]) *
|
| 107 |
+
np.linalg.norm(dense[0, :64].numpy()) + 1e-12))))
|
| 108 |
+
ok = worst == 0.0
|
| 109 |
+
print(json.dumps(dict(ok=ok, max_abs_diff=worst, checkpoint=str(a.checkpoint), queries=report), indent=1))
|
| 110 |
+
sys.exit(0 if ok else 1)
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
if __name__ == '__main__':
|
| 114 |
+
main()
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_parity.py
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Check the FLASH port (evaluation/baselines/flash.py) against the upstream policy, on the CPU:
|
| 2 |
+
|
| 3 |
+
<baselines env>/bin/python -I evaluation/baselines/check_flash_parity.py --upstream <FLASH-Policy checkout>
|
| 4 |
+
|
| 5 |
+
Upstream is NTUMARS/FLASH-Policy @ f47e490 (roboverse_learn/il/...); its `zarr` and `einops` imports are shimmed
|
| 6 |
+
when the environment lacks them (only the parts used here run). Compared, for flash.yaml's settings with n_obs_steps =
|
| 7 |
+
n_history (8), n_action_steps 8, horizon 16:
|
| 8 |
+
|
| 9 |
+
- the polynomial buffers: least-squares matrix, coefficient scales, Tikhonov history fit, KKT boundary-constraint
|
| 10 |
+
matrices and pinned indices;
|
| 11 |
+
- target coefficients (least squares + boundary constraint) and history coefficients on random normalized
|
| 12 |
+
trajectories (identity normalizers on both sides);
|
| 13 |
+
- the DiT: upstream FlowTransformer's weights loaded strictly into FlashFlowTransformer, same outputs;
|
| 14 |
+
- the image encoder: upstream MultiImageObsEncoder (two rgb keys, agent_pos) with this port's weights, same features
|
| 15 |
+
(upstream concatenates its rgb keys in sorted order);
|
| 16 |
+
- the 30 Hz output rows: at multiples of the stride they equal upstream's trajectory points from the anchor.
|
| 17 |
+
Prints one JSON line with the largest differences; exits 1 when one exceeds its tolerance.
|
| 18 |
+
"""
|
| 19 |
+
from __future__ import annotations
|
| 20 |
+
|
| 21 |
+
import argparse
|
| 22 |
+
import json
|
| 23 |
+
from pathlib import Path
|
| 24 |
+
import sys
|
| 25 |
+
import types
|
| 26 |
+
|
| 27 |
+
import torch
|
| 28 |
+
|
| 29 |
+
HERE = Path(__file__).resolve().parent
|
| 30 |
+
if str(HERE.parent) not in sys.path:
|
| 31 |
+
sys.path.insert(0, str(HERE.parent))
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def shim_upstream_imports():
|
| 35 |
+
try:
|
| 36 |
+
import zarr # noqa: F401
|
| 37 |
+
except ImportError:
|
| 38 |
+
zarr = types.ModuleType('zarr')
|
| 39 |
+
zarr.Array = type('Array', (), {})
|
| 40 |
+
sys.modules['zarr'] = zarr
|
| 41 |
+
try:
|
| 42 |
+
import einops # noqa: F401
|
| 43 |
+
except ImportError:
|
| 44 |
+
einops = types.ModuleType('einops')
|
| 45 |
+
einops.reduce = lambda x, pattern, op: x.reshape(x.shape[0], -1) # "b ... -> b (...)" (no reduced axis)
|
| 46 |
+
sys.modules['einops'] = einops
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def main():
|
| 50 |
+
p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
| 51 |
+
p.add_argument('--upstream', type=Path, required=True, help='FLASH-Policy checkout (commit f47e490)')
|
| 52 |
+
p.add_argument('--stride', type=int, default=2)
|
| 53 |
+
a = p.parse_args()
|
| 54 |
+
shim_upstream_imports()
|
| 55 |
+
sys.path.insert(0, str(a.upstream.resolve()))
|
| 56 |
+
from roboverse_learn.il.policies.flash.flash_policy import FlashDiTImagePolicy
|
| 57 |
+
from roboverse_learn.il.utils.models.flow_net import FlowTransformer
|
| 58 |
+
from roboverse_learn.il.utils.vision.model_getter import get_resnet
|
| 59 |
+
from roboverse_learn.il.utils.vision.multi_image_obs_encoder import MultiImageObsEncoder
|
| 60 |
+
from baselines.flash import FLASH_DEFAULTS, FLASH_POLICY_FIELDS, FlashFlowTransformer
|
| 61 |
+
from baselines.policies import PolicyConfig, build_policy
|
| 62 |
+
|
| 63 |
+
torch.manual_seed(0)
|
| 64 |
+
Da, Ds, H, W = 76, 44, 48, 64
|
| 65 |
+
f = dict(FLASH_DEFAULTS, stride=a.stride)
|
| 66 |
+
cfg = PolicyConfig.from_dict(dict(policy='flash', n_cameras=2, state_dim=Ds, action_dim=Da, horizon=f['rows'],
|
| 67 |
+
**FLASH_POLICY_FIELDS, extra=dict(flash=f)))
|
| 68 |
+
ours = build_policy(cfg, pretrained=False).eval()
|
| 69 |
+
shape_meta = dict(obs=dict(ego_view=dict(shape=[3, H, W], type='rgb'), chest=dict(shape=[3, H, W], type='rgb'),
|
| 70 |
+
agent_pos=dict(shape=[Ds], type='low_dim')), action=dict(shape=[Da]))
|
| 71 |
+
enc = MultiImageObsEncoder(shape_meta=shape_meta, rgb_model=get_resnet('resnet18', weights=None),
|
| 72 |
+
resize_shape=None, crop_shape=None, random_crop=True, use_group_norm=True,
|
| 73 |
+
share_rgb_model=False, imagenet_norm=True)
|
| 74 |
+
up = FlashDiTImagePolicy(shape_meta=shape_meta, obs_encoder=enc, horizon=f['n_history'] + f['n_action'],
|
| 75 |
+
n_action_steps=f['n_action'], n_obs_steps=f['n_history'], num_inference_steps=1,
|
| 76 |
+
obs_as_global_cond=True, diffusion_step_embed_dim=256, hidden_dim=512, num_layers=4,
|
| 77 |
+
num_heads=8, mlp_ratio=4, dropout=0.0, poly_order=f['poly_order'], basis_type='legendre',
|
| 78 |
+
fit_pad=f['fit_pad'], boundary_constraint=f['boundary_constraint'],
|
| 79 |
+
history_noise_std=f['history_noise_std'], history_reg_lambda=f['history_reg_lambda'],
|
| 80 |
+
consistency_weight=f['consistency_weight'], flash_solver='euler',
|
| 81 |
+
poly_prefix=f['poly_prefix'], poly_suffix=f['poly_suffix']).eval()
|
| 82 |
+
res, tol = {}, {}
|
| 83 |
+
|
| 84 |
+
def diff(name, x, y, t):
|
| 85 |
+
res[name] = float((x.double() - y.double()).abs().max())
|
| 86 |
+
tol[name] = t
|
| 87 |
+
|
| 88 |
+
for b in ('_lstsq_matrix', '_coeff_scale', '_history_lstsq_matrix', '_bc_eval_pos', '_bc_eval_vel',
|
| 89 |
+
'_bc_correction'):
|
| 90 |
+
diff(b, getattr(ours, b), getattr(up, b), 1e-6)
|
| 91 |
+
res['_bc_pos_indices_equal'] = bool(torch.equal(ours._bc_pos_indices, up._bc_pos_indices))
|
| 92 |
+
|
| 93 |
+
# identity normalizers on both sides: compare the polynomial algebra itself
|
| 94 |
+
B = 6
|
| 95 |
+
traj = torch.randn(B, ours.H_ext, Da)
|
| 96 |
+
hist = torch.randn(B, f['n_history'], Da)
|
| 97 |
+
with torch.no_grad():
|
| 98 |
+
t_up = up._apply_boundary_constraint(up._trajectory_to_coefficients(traj), traj)
|
| 99 |
+
t_ours = ours._apply_boundary_constraint(ours._to_coeff(traj), traj)
|
| 100 |
+
diff('target_coeff', t_ours, t_up, 1e-4)
|
| 101 |
+
h_up = up._history_to_coefficients(hist)
|
| 102 |
+
h_ours = torch.einsum('ch,bhd->bcd', ours._history_lstsq_matrix, hist) / ours._coeff_scale
|
| 103 |
+
diff('history_coeff', h_ours, h_up, 1e-5)
|
| 104 |
+
|
| 105 |
+
# DiT: upstream weights into the port
|
| 106 |
+
dit_up = FlowTransformer(input_dim=Da, condition_dim=300, hidden_dim=512, output_dim=Da, num_layers=4,
|
| 107 |
+
num_heads=8, mlp_ratio=4, dropout=0.0, time_embed_dim=256).eval()
|
| 108 |
+
dit_ours = FlashFlowTransformer(input_dim=Da, condition_dim=300, hidden_dim=512, output_dim=Da, num_layers=4,
|
| 109 |
+
num_heads=8, mlp_ratio=4, dropout=0.0, time_embed_dim=256).eval()
|
| 110 |
+
dit_ours.load_state_dict(dit_up.state_dict(), strict=True)
|
| 111 |
+
x, t, c = torch.randn(B, ours.num_coeff, Da), torch.rand(B), torch.randn(B, 300)
|
| 112 |
+
diff('dit', dit_ours(x, t, c), dit_up(x, t, c), 1e-5)
|
| 113 |
+
|
| 114 |
+
# encoder: the port's ResNets into upstream's per-key models (sorted keys: chest, ego_view)
|
| 115 |
+
for i, cam in enumerate(('ego_view', 'chest')):
|
| 116 |
+
enc.key_model_map[cam].load_state_dict(ours.obs_encoder.rgb[i].state_dict(), strict=True)
|
| 117 |
+
imgs, state_n = torch.rand(B, 2, 3, H, W), torch.rand(B, Ds) * 2 - 1
|
| 118 |
+
f_ours = ours.obs_encoder(imgs, state_n)
|
| 119 |
+
f_up = enc({'ego_view': imgs[:, 0] * 2 - 1, 'chest': imgs[:, 1] * 2 - 1, 'agent_pos': state_n})
|
| 120 |
+
n = 512
|
| 121 |
+
f_up_reordered = torch.cat([f_up[:, n:2 * n], f_up[:, :n], f_up[:, 2 * n:]], dim=-1) # chest|ego -> ego|chest
|
| 122 |
+
diff('encoder', f_ours, f_up_reordered, 1e-4)
|
| 123 |
+
|
| 124 |
+
# 30 Hz rows from the anchor vs upstream's points: identity normalizer on ours
|
| 125 |
+
ours.action_norm.scale.fill_(1.0)
|
| 126 |
+
ours.action_norm.offset.zero_()
|
| 127 |
+
coeff = torch.randn(B, ours.num_coeff, Da)
|
| 128 |
+
dense = ours.dense_from_coeff(coeff)
|
| 129 |
+
sparse = up._coefficients_to_trajectory(coeff) # (B, H_poly, Da), anchor at up._anchor_idx
|
| 130 |
+
k = torch.arange(0, ours.rows, a.stride)
|
| 131 |
+
j = up._anchor_idx + k // a.stride
|
| 132 |
+
diff('dense_vs_upstream_points', dense[:, k], sparse[:, j], 1e-4)
|
| 133 |
+
bad = {k: v for k, v in res.items() if k in tol and v > tol[k]}
|
| 134 |
+
ok = not bad and res['_bc_pos_indices_equal']
|
| 135 |
+
print(json.dumps(dict(ok=ok, max_abs_diff=res, tolerance=tol, stride=a.stride,
|
| 136 |
+
upstream_anchor_idx=int(up._anchor_idx), port_anchor=int(ours.anchor))), flush=True)
|
| 137 |
+
sys.exit(0 if ok else 1)
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
if __name__ == '__main__':
|
| 141 |
+
main()
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/data.py
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Training data of the baselines: a task's LeRobot v2.1 expert dataset read through a robot contract.
|
| 2 |
+
|
| 3 |
+
A contract names the cameras and which dataset columns form the policy state and the action rows, the same layouts
|
| 4 |
+
the registered GR00T / Psi0 checkpoints were trained on:
|
| 5 |
+
|
| 6 |
+
- `g1_sonic_dfx6` (G1 + INSPIRE, the evaluation/README.md interface; ego_view, chest): state44 =
|
| 7 |
+
`observation.state[0:29]` body, measured `observation.inspire_{left,right}_hand_state`,
|
| 8 |
+
`observation.projected_gravity`; action76 (`sonic_dfx6`) = `action.motion_token` 64 and the measured DFX6 of the
|
| 9 |
+
same row (row 0 = the current opening);
|
| 10 |
+
- `h2_sharpa` (H2 + Sharpa, debug/newton/h2_sharpa_policy_eval.py; head, chest): state78 = `observation.state` 75,
|
| 11 |
+
`observation.projected_gravity` 3; action75 = `action.body_target` 31, `action.hands` 44 (absolute targets);
|
| 12 |
+
- `h2_sharpa_planner` (H2 + Sharpa a14 v2, h2_policy_planner_eval.py; head, chest): state78; action82 = action75 +
|
| 13 |
+
`action.planner` 7.
|
| 14 |
+
|
| 15 |
+
Frames: every camera's video is decoded once (PyAV), each frame resized with `resize_frame` (OpenCV INTER_AREA, the
|
| 16 |
+
same function the policy runtime applies to live frames) and stored as a uint8 memory map in a cache directory keyed by
|
| 17 |
+
the dataset, episodes, camera and size. A training sample is the frame t of an episode: the cameras and the state at t,
|
| 18 |
+
and the action rows t..t+horizon-1 (rows past the episode's end repeat its last row, as DextraVerse's windows).
|
| 19 |
+
"""
|
| 20 |
+
from __future__ import annotations
|
| 21 |
+
|
| 22 |
+
from dataclasses import dataclass
|
| 23 |
+
import hashlib
|
| 24 |
+
import json
|
| 25 |
+
import os
|
| 26 |
+
from pathlib import Path
|
| 27 |
+
import sys
|
| 28 |
+
|
| 29 |
+
import numpy as np
|
| 30 |
+
|
| 31 |
+
CACHE_VERSION = 1
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@dataclass(frozen=True)
|
| 35 |
+
class Contract:
|
| 36 |
+
name: str
|
| 37 |
+
robot: str
|
| 38 |
+
cameras: tuple
|
| 39 |
+
state: tuple # ((column, start, end), ...) concatenated in order
|
| 40 |
+
action: tuple
|
| 41 |
+
action_space: str | None = None # the G1 evaluation interface's action space, if any
|
| 42 |
+
body_dims: int = 0 # leading raw-radian body joint angles of the state (augmentation spec v2 perturbs these)
|
| 43 |
+
|
| 44 |
+
@property
|
| 45 |
+
def state_dim(self) -> int:
|
| 46 |
+
return sum(end - start for _, start, end in self.state)
|
| 47 |
+
|
| 48 |
+
@property
|
| 49 |
+
def action_dim(self) -> int:
|
| 50 |
+
return sum(end - start for _, start, end in self.action)
|
| 51 |
+
|
| 52 |
+
def to_dict(self, cameras=None) -> dict:
|
| 53 |
+
return dict(name=self.name, robot=self.robot, cameras=list(cameras or self.cameras),
|
| 54 |
+
state=[list(s) for s in self.state], action=[list(a) for a in self.action],
|
| 55 |
+
state_dim=self.state_dim, action_dim=self.action_dim, action_space=self.action_space,
|
| 56 |
+
body_dims=self.body_dims)
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
_G1_HANDS = (('observation.inspire_left_hand_state', 0, 6), ('observation.inspire_right_hand_state', 0, 6))
|
| 60 |
+
_H2_STATE = (('observation.state', 0, 75), ('observation.projected_gravity', 0, 3))
|
| 61 |
+
_H2_ACTION = (('action.body_target', 0, 31), ('action.hands', 0, 44))
|
| 62 |
+
# body_dims: G1 observation.state[0:29] are the 29 body joints; H2 observation.state[0:31] are legs 6+6, waist 3,
|
| 63 |
+
# head 2, arms 7+7 (docs/unitree_h2_sharpa.md), then the Sharpa hands.
|
| 64 |
+
CONTRACTS = {c.name: c for c in (
|
| 65 |
+
Contract('g1_sonic_dfx6', 'g1', ('ego_view', 'chest'),
|
| 66 |
+
(('observation.state', 0, 29), *_G1_HANDS, ('observation.projected_gravity', 0, 3)),
|
| 67 |
+
(('action.motion_token', 0, 64), *_G1_HANDS), action_space='sonic_dfx6', body_dims=29),
|
| 68 |
+
Contract('h2_sharpa', 'h2_sharpa', ('head', 'chest'), _H2_STATE, _H2_ACTION, body_dims=31),
|
| 69 |
+
Contract('h2_sharpa_planner', 'h2_sharpa', ('head', 'chest'), _H2_STATE,
|
| 70 |
+
(*_H2_ACTION, ('action.planner', 0, 7)), body_dims=31),
|
| 71 |
+
)}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def augmentation_module():
|
| 75 |
+
"""evaluation/augmentation: the augmentation spec v2 shared by every model's training (imported on demand)."""
|
| 76 |
+
evaluation = str(Path(__file__).resolve().parents[1])
|
| 77 |
+
if evaluation not in sys.path:
|
| 78 |
+
sys.path.insert(0, evaluation)
|
| 79 |
+
import augmentation
|
| 80 |
+
return augmentation
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def resize_frame(frame: np.ndarray, hw) -> np.ndarray:
|
| 84 |
+
"""(H, W, 3) uint8 RGB -> (h, w, 3) uint8, OpenCV INTER_AREA (training cache and live frames alike)."""
|
| 85 |
+
import cv2
|
| 86 |
+
frame = np.ascontiguousarray(frame, dtype=np.uint8)
|
| 87 |
+
if frame.ndim != 3 or frame.shape[2] != 3:
|
| 88 |
+
raise ValueError(f'expected an (H, W, 3) RGB frame, got {frame.shape}')
|
| 89 |
+
h, w = int(hw[0]), int(hw[1])
|
| 90 |
+
if frame.shape[:2] == (h, w):
|
| 91 |
+
return frame
|
| 92 |
+
return cv2.resize(frame, (w, h), interpolation=cv2.INTER_AREA)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
class LeRobotDataset:
|
| 96 |
+
"""A LeRobot v2.1 dataset directory (meta/info.json, meta/episodes.jsonl, data/, videos/)."""
|
| 97 |
+
|
| 98 |
+
def __init__(self, root):
|
| 99 |
+
self.root = Path(root).expanduser().resolve()
|
| 100 |
+
self.info = json.loads((self.root / 'meta/info.json').read_text())
|
| 101 |
+
if self.info.get('codebase_version') != 'v2.1':
|
| 102 |
+
raise ValueError(f"{self.root}: LeRobot {self.info.get('codebase_version')}, expected v2.1")
|
| 103 |
+
rows = [json.loads(line) for line in (self.root / 'meta/episodes.jsonl').read_text().splitlines() if line]
|
| 104 |
+
self.lengths = {int(r['episode_index']): int(r['length']) for r in rows}
|
| 105 |
+
tasks = [json.loads(line) for line in (self.root / 'meta/tasks.jsonl').read_text().splitlines() if line]
|
| 106 |
+
self.tasks = {int(t['task_index']): t['task'] for t in tasks}
|
| 107 |
+
self.fps = float(self.info['fps'])
|
| 108 |
+
|
| 109 |
+
@property
|
| 110 |
+
def name(self) -> str:
|
| 111 |
+
"""The dataset's folder name (its parent's for an export folder named `lerobot`)."""
|
| 112 |
+
return self.root.parent.name if self.root.name == 'lerobot' else self.root.name
|
| 113 |
+
|
| 114 |
+
def chunk(self, episode: int) -> int:
|
| 115 |
+
return episode // int(self.info['chunks_size'])
|
| 116 |
+
|
| 117 |
+
def parquet(self, episode: int) -> Path:
|
| 118 |
+
return self.root / self.info['data_path'].format(episode_chunk=self.chunk(episode), episode_index=episode)
|
| 119 |
+
|
| 120 |
+
def video(self, episode: int, camera: str) -> Path:
|
| 121 |
+
return self.root / self.info['video_path'].format(episode_chunk=self.chunk(episode), episode_index=episode,
|
| 122 |
+
video_key=f'observation.images.{camera}')
|
| 123 |
+
|
| 124 |
+
def check_contract(self, contract: Contract, cameras):
|
| 125 |
+
features = self.info['features']
|
| 126 |
+
for column, start, end in (*contract.state, *contract.action):
|
| 127 |
+
if column not in features:
|
| 128 |
+
raise KeyError(f'{self.root.name}: no column {column!r} (contract {contract.name})')
|
| 129 |
+
width = int(np.prod(features[column]['shape']))
|
| 130 |
+
if end > width:
|
| 131 |
+
raise ValueError(f'{column} has {width} values; the contract reads {start}:{end}')
|
| 132 |
+
for camera in cameras:
|
| 133 |
+
key = f'observation.images.{camera}'
|
| 134 |
+
if features.get(key, {}).get('dtype') != 'video':
|
| 135 |
+
raise KeyError(f'{self.root.name}: no video {key!r}')
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
def parse_episodes(spec: str | None, available) -> list:
|
| 139 |
+
"""'0:100', '0,3,7' or None (all), restricted to the dataset's episodes, sorted."""
|
| 140 |
+
available = sorted(available)
|
| 141 |
+
if not spec:
|
| 142 |
+
return available
|
| 143 |
+
chosen = set()
|
| 144 |
+
for part in spec.split(','):
|
| 145 |
+
if ':' in part:
|
| 146 |
+
lo, hi = part.split(':')
|
| 147 |
+
chosen.update(range(int(lo or 0), int(hi) if hi else available[-1] + 1))
|
| 148 |
+
else:
|
| 149 |
+
chosen.add(int(part))
|
| 150 |
+
missing = sorted(chosen - set(available))
|
| 151 |
+
if missing:
|
| 152 |
+
raise ValueError(f'episodes not in the dataset: {missing[:10]}')
|
| 153 |
+
return sorted(chosen)
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
def load_lowdim(dataset: LeRobotDataset, contract: Contract, episodes) -> dict:
|
| 157 |
+
"""State (N, state_dim) and action (N, action_dim) float32 of the episodes in order, plus each episode's start
|
| 158 |
+
row, length and task text."""
|
| 159 |
+
import pyarrow.parquet as pq
|
| 160 |
+
columns = sorted({c for c, _, _ in (*contract.state, *contract.action)} | {'frame_index', 'task_index'})
|
| 161 |
+
states, actions, starts, lengths, tasks, offset = [], [], [], [], set(), 0
|
| 162 |
+
for episode in episodes:
|
| 163 |
+
table = pq.read_table(dataset.parquet(episode), columns=columns)
|
| 164 |
+
data = {c: np.asarray(table.column(c).to_pylist(), dtype=np.float64) for c in columns}
|
| 165 |
+
n = len(data['frame_index'])
|
| 166 |
+
if n != dataset.lengths[episode] or not np.array_equal(data['frame_index'], np.arange(n)):
|
| 167 |
+
raise ValueError(f'episode {episode}: {n} rows / frame_index differ from episodes.jsonl')
|
| 168 |
+
|
| 169 |
+
def pick(spec):
|
| 170 |
+
return np.concatenate([data[c].reshape(n, -1)[:, s:e] for c, s, e in spec], axis=1).astype(np.float32)
|
| 171 |
+
|
| 172 |
+
states.append(pick(contract.state))
|
| 173 |
+
actions.append(pick(contract.action))
|
| 174 |
+
tasks.update(dataset.tasks[int(i)] for i in np.unique(data['task_index']))
|
| 175 |
+
starts.append(offset)
|
| 176 |
+
lengths.append(n)
|
| 177 |
+
offset += n
|
| 178 |
+
state, action = np.concatenate(states), np.concatenate(actions)
|
| 179 |
+
if not (np.isfinite(state).all() and np.isfinite(action).all()):
|
| 180 |
+
raise ValueError('non-finite state or action values')
|
| 181 |
+
return dict(state=state, action=action, starts=np.asarray(starts), lengths=np.asarray(lengths),
|
| 182 |
+
episodes=list(episodes), tasks=sorted(tasks))
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
def statistics(lowdim: dict, rows: np.ndarray, quantiles: bool = False) -> dict:
|
| 186 |
+
"""min / max / mean / std of state and action over `rows`; with `quantiles` also their q01 / q99 (the ODE
|
| 187 |
+
policies' normalization bounds, as ODE Policy's G1 port fits them)."""
|
| 188 |
+
out = {}
|
| 189 |
+
for key in ('state', 'action'):
|
| 190 |
+
x = lowdim[key][rows].astype(np.float64)
|
| 191 |
+
out[key] = dict(min=x.min(0).tolist(), max=x.max(0).tolist(), mean=x.mean(0).tolist(), std=x.std(0).tolist())
|
| 192 |
+
if quantiles:
|
| 193 |
+
q01, q99 = np.quantile(x, [0.01, 0.99], axis=0)
|
| 194 |
+
out[key].update(q01=q01.tolist(), q99=q99.tolist())
|
| 195 |
+
return out
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
# Columns recorded in physical [0, 1] (the INSPIRE DFX6 openings): the ODE policies normalize them with these fixed
|
| 199 |
+
# bounds instead of the data's, as ODE Policy's G1 port does.
|
| 200 |
+
UNIT_RANGE_COLUMNS = ('observation.inspire_left_hand_state', 'observation.inspire_right_hand_state')
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
def unit_range_dims(contract: Contract) -> dict:
|
| 204 |
+
"""{'state': [...], 'action': [...]}: the positions of the UNIT_RANGE_COLUMNS values in the contract's layouts."""
|
| 205 |
+
out = {}
|
| 206 |
+
for key, spec in (('state', contract.state), ('action', contract.action)):
|
| 207 |
+
dims, offset = [], 0
|
| 208 |
+
for column, start, end in spec:
|
| 209 |
+
if column in UNIT_RANGE_COLUMNS:
|
| 210 |
+
dims.extend(range(offset, offset + end - start))
|
| 211 |
+
offset += end - start
|
| 212 |
+
out[key] = dims
|
| 213 |
+
return out
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
# -- frame cache --------------------------------------------------------------------------------------------------
|
| 217 |
+
def _decode_into(job):
|
| 218 |
+
path, out_path, total, start, length, hw = job
|
| 219 |
+
import av
|
| 220 |
+
frames = np.memmap(out_path, dtype=np.uint8, mode='r+', shape=(total, hw[0], hw[1], 3))
|
| 221 |
+
count = 0
|
| 222 |
+
with av.open(str(path)) as container:
|
| 223 |
+
stream = container.streams.video[0]
|
| 224 |
+
stream.thread_type = 'AUTO'
|
| 225 |
+
for frame in container.decode(stream):
|
| 226 |
+
if count < length:
|
| 227 |
+
frames[start + count] = resize_frame(frame.to_ndarray(format='rgb24'), hw)
|
| 228 |
+
count += 1
|
| 229 |
+
frames.flush()
|
| 230 |
+
del frames
|
| 231 |
+
if count != length:
|
| 232 |
+
raise ValueError(f'{path}: {count} video frames, {length} data rows')
|
| 233 |
+
return length
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
def frame_cache(dataset: LeRobotDataset, lowdim: dict, cameras, hw, cache_root, workers=8) -> dict:
|
| 237 |
+
"""{camera: path of the (N, h, w, 3) uint8 memory map} for the episodes of `lowdim`, decoded once and reused."""
|
| 238 |
+
from multiprocessing import get_context
|
| 239 |
+
total = int(lowdim['lengths'].sum())
|
| 240 |
+
paths = {}
|
| 241 |
+
for camera in cameras:
|
| 242 |
+
key = json.dumps(dict(version=CACHE_VERSION, root=str(dataset.root), episodes=lowdim['episodes'],
|
| 243 |
+
lengths=lowdim['lengths'].tolist(), camera=camera, hw=list(hw)), sort_keys=True)
|
| 244 |
+
digest = hashlib.sha256(key.encode()).hexdigest()[:16]
|
| 245 |
+
folder = Path(cache_root).expanduser() / f'{dataset.name}_{camera}_{hw[0]}x{hw[1]}_{digest}'
|
| 246 |
+
folder.mkdir(parents=True, exist_ok=True)
|
| 247 |
+
out, meta = folder / 'frames.u8', folder / 'meta.json'
|
| 248 |
+
if meta.exists() and json.loads(meta.read_text()).get('complete'):
|
| 249 |
+
paths[camera] = out
|
| 250 |
+
continue
|
| 251 |
+
np.memmap(out, dtype=np.uint8, mode='w+', shape=(total, hw[0], hw[1], 3)).flush()
|
| 252 |
+
jobs = [(dataset.video(e, camera), out, total, int(s), int(n), tuple(hw))
|
| 253 |
+
for e, s, n in zip(lowdim['episodes'], lowdim['starts'], lowdim['lengths'])]
|
| 254 |
+
with get_context('spawn').Pool(max(1, int(workers))) as pool: # the caller may hold torch threads
|
| 255 |
+
for done, _ in enumerate(pool.imap_unordered(_decode_into, jobs), 1):
|
| 256 |
+
if done % 20 == 0 or done == len(jobs):
|
| 257 |
+
print(json.dumps(dict(event='frame_cache', camera=camera, episodes=done, of=len(jobs))),
|
| 258 |
+
flush=True)
|
| 259 |
+
meta.write_text(json.dumps(dict(json.loads(key), frames=total, complete=True), indent=1))
|
| 260 |
+
paths[camera] = out
|
| 261 |
+
return paths
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
class ChunkDataset:
|
| 265 |
+
"""torch-style dataset of (images (n_cameras, h, w, 3) uint8, state (state_dim,), action (horizon, action_dim))
|
| 266 |
+
over the frames of the selected episodes (positions into lowdim['episodes']). Memory maps open lazily per
|
| 267 |
+
process (DataLoader workers).
|
| 268 |
+
|
| 269 |
+
`body_dims` > 0 turns on the training augmentation (docs/augmentation_v2.md, evaluation/augmentation): per item,
|
| 270 |
+
the cached frames of all cameras get one hb_aug_v2.augment call (one time step, no future targets) and the first
|
| 271 |
+
`body_dims` state values the per-sample joint bias + noise; the action rows are never touched. 0 (evaluation,
|
| 272 |
+
offline checks) returns the cached frames and the recorded state unchanged, deterministically.
|
| 273 |
+
|
| 274 |
+
`lead` > 0 prepends that many rows before t to the action rows (lead + horizon rows, t-lead..t+horizon-1) and
|
| 275 |
+
adds a fourth item, the rows' validity (lead + horizon,) float: 0 for a row before the episode's first or past its
|
| 276 |
+
last (whose values repeat the nearest row); the ODE policies start from the row before t, or from their BOS where
|
| 277 |
+
it is invalid, and leave invalid future rows out of the loss (policies.ODEPolicy).
|
| 278 |
+
|
| 279 |
+
aug_seed (HumanWAM hb_training/REPRODUCIBILITY.md section 3; the training seed, `HB_AUG_SEED`): an item asked for
|
| 280 |
+
as (k, draw) (train.EpochSampler, 2026-11-27) is augmented with numpy default_rng([aug_seed, draw]), draw being its
|
| 281 |
+
position in the run's sample stream: the same seed and step give the same augmentations whatever the worker count
|
| 282 |
+
and across an interrupted run's --resume. A plain index k (the preflight) uses the per-worker stream
|
| 283 |
+
default_rng([aug_seed, torch.initial_seed(), worker id]) of the runs trained before; None the shared worker_rng
|
| 284 |
+
(pid + urandom: not reproducible)."""
|
| 285 |
+
|
| 286 |
+
def __init__(self, lowdim: dict, frames: dict, cameras, hw, horizon: int, positions, body_dims: int = 0,
|
| 287 |
+
lead: int = 0, aug_seed=None):
|
| 288 |
+
self.lowdim, self.paths, self.cameras, self.hw, self.horizon = lowdim, frames, list(cameras), tuple(hw), horizon
|
| 289 |
+
self.positions, self.body_dims, self.lead = list(positions), int(body_dims), int(lead)
|
| 290 |
+
self.aug_seed = aug_seed
|
| 291 |
+
self._rng_key, self._rng_obj = None, None
|
| 292 |
+
if self.body_dims:
|
| 293 |
+
augmentation_module() # asserts the spec version before any worker starts
|
| 294 |
+
self.total = int(lowdim['lengths'].sum())
|
| 295 |
+
index, begin, end = [], np.zeros(self.total, np.int64), np.zeros(self.total, np.int64)
|
| 296 |
+
for p in positions:
|
| 297 |
+
s, n = int(lowdim['starts'][p]), int(lowdim['lengths'][p])
|
| 298 |
+
index.append(np.arange(s, s + n))
|
| 299 |
+
begin[s:s + n] = s
|
| 300 |
+
end[s:s + n] = s + n
|
| 301 |
+
self.index, self.begin, self.end = np.concatenate(index), begin, end
|
| 302 |
+
self._maps, self._pid = None, None
|
| 303 |
+
|
| 304 |
+
def __len__(self):
|
| 305 |
+
return len(self.index)
|
| 306 |
+
|
| 307 |
+
def _frames(self):
|
| 308 |
+
if self._maps is None or self._pid != os.getpid():
|
| 309 |
+
self._maps = {c: np.memmap(self.paths[c], dtype=np.uint8, mode='r', shape=(self.total, *self.hw, 3))
|
| 310 |
+
for c in self.cameras}
|
| 311 |
+
self._pid = os.getpid()
|
| 312 |
+
return self._maps
|
| 313 |
+
|
| 314 |
+
def rows(self, i: int) -> np.ndarray:
|
| 315 |
+
return np.clip(np.arange(i - self.lead, i + self.horizon), self.begin[i], self.end[i] - 1)
|
| 316 |
+
|
| 317 |
+
def valid(self, i: int) -> np.ndarray:
|
| 318 |
+
rows = np.arange(i - self.lead, i + self.horizon)
|
| 319 |
+
return ((rows >= self.begin[i]) & (rows < self.end[i])).astype(np.float32)
|
| 320 |
+
|
| 321 |
+
def plain(self):
|
| 322 |
+
"""The same items without augmentation (the preflight's reference read)."""
|
| 323 |
+
return ChunkDataset(self.lowdim, self.paths, self.cameras, self.hw, self.horizon, self.positions,
|
| 324 |
+
lead=self.lead)
|
| 325 |
+
|
| 326 |
+
def _rng(self):
|
| 327 |
+
if self.aug_seed is None or not self.body_dims:
|
| 328 |
+
return None
|
| 329 |
+
import torch
|
| 330 |
+
info = torch.utils.data.get_worker_info()
|
| 331 |
+
wid = info.id if info is not None else 0
|
| 332 |
+
key = (os.getpid(), wid)
|
| 333 |
+
if self._rng_key != key:
|
| 334 |
+
self._rng_obj = np.random.default_rng([int(self.aug_seed), int(torch.initial_seed()), int(wid)])
|
| 335 |
+
self._rng_key = key
|
| 336 |
+
return self._rng_obj
|
| 337 |
+
|
| 338 |
+
def _key(self, k):
|
| 339 |
+
"""(item index, augmentation rng) of a sampler key: (k, draw) or a plain k (class docstring)."""
|
| 340 |
+
if isinstance(k, (tuple, list)):
|
| 341 |
+
k, draw = k
|
| 342 |
+
if self.aug_seed is not None and self.body_dims:
|
| 343 |
+
return int(k), np.random.default_rng([int(self.aug_seed), int(draw)])
|
| 344 |
+
return int(k), self._rng()
|
| 345 |
+
|
| 346 |
+
def _observation(self, i: int, rng=None):
|
| 347 |
+
"""The cameras (n_cameras, h, w, 3) uint8 and the state of frame i, augmented when body_dims > 0."""
|
| 348 |
+
import torch
|
| 349 |
+
maps = self._frames()
|
| 350 |
+
images = torch.from_numpy(np.stack([maps[c][i] for c in self.cameras]))
|
| 351 |
+
state = self.lowdim['state'][i]
|
| 352 |
+
if self.body_dims:
|
| 353 |
+
augmentation = augmentation_module()
|
| 354 |
+
images, _ = augmentation.augment_frames_uint8(images, rng=rng)
|
| 355 |
+
state = augmentation.perturb_body(state, self.body_dims, rng=rng)
|
| 356 |
+
return images, torch.from_numpy(np.asarray(state, dtype=np.float32))
|
| 357 |
+
|
| 358 |
+
def __getitem__(self, k):
|
| 359 |
+
import torch
|
| 360 |
+
k, rng = self._key(k)
|
| 361 |
+
i = int(self.index[k])
|
| 362 |
+
images, state = self._observation(i, rng=rng)
|
| 363 |
+
item = images, state, torch.from_numpy(self.lowdim['action'][self.rows(i)])
|
| 364 |
+
return (*item, torch.from_numpy(self.valid(i))) if self.lead else item
|
| 365 |
+
|
| 366 |
+
|
| 367 |
+
class FlashChunkDataset(ChunkDataset):
|
| 368 |
+
"""FLASH training items (evaluation/baselines/flash.py) over every frame of the selected episodes as the anchor:
|
| 369 |
+
(images, state, poly, history, has_history[, dense, dense_valid]).
|
| 370 |
+
|
| 371 |
+
- images, state: the anchor frame's cameras and state44, augmented as ChunkDataset (spec v2) when body_dims > 0;
|
| 372 |
+
- poly (H_ext, action_dim): the action rows at `offsets` frames from the anchor (the polynomial's extended grid,
|
| 373 |
+
`stride` frames apart), clamped to the episode (FLASH's edge padding);
|
| 374 |
+
- history (n_history, action_dim), has_history: flash.history_rows over the `span` executed rows before the anchor
|
| 375 |
+
(rows before the episode start invalid), the same function the adapter applies to past_actions;
|
| 376 |
+
- dense (rows, action_dim), dense_valid: the recorded 30 Hz rows from the anchor (offline check only).
|
| 377 |
+
|
| 378 |
+
aug_seed: as ChunkDataset (the same seeded stream)."""
|
| 379 |
+
|
| 380 |
+
def __init__(self, lowdim, frames, cameras, hw, positions, *, offsets, stride, n_history, rows, body_dims=0,
|
| 381 |
+
aug_seed=None, with_dense=False):
|
| 382 |
+
super().__init__(lowdim, frames, cameras, hw, rows, positions, body_dims=body_dims)
|
| 383 |
+
self.offsets = np.asarray(offsets, dtype=np.int64)
|
| 384 |
+
self.stride, self.n_history, self.n_rows = int(stride), int(n_history), int(rows)
|
| 385 |
+
self.span = (self.n_history - 1) * self.stride + 1
|
| 386 |
+
self.aug_seed, self.with_dense = aug_seed, bool(with_dense)
|
| 387 |
+
start = np.zeros(self.total, np.int64)
|
| 388 |
+
for p in positions:
|
| 389 |
+
s, n = int(lowdim['starts'][p]), int(lowdim['lengths'][p])
|
| 390 |
+
start[s:s + n] = s
|
| 391 |
+
self.start = start
|
| 392 |
+
|
| 393 |
+
def plain(self):
|
| 394 |
+
return FlashChunkDataset(self.lowdim, self.paths, self.cameras, self.hw, self.positions, offsets=self.offsets,
|
| 395 |
+
stride=self.stride, n_history=self.n_history, rows=self.n_rows,
|
| 396 |
+
with_dense=self.with_dense)
|
| 397 |
+
|
| 398 |
+
def __getitem__(self, k):
|
| 399 |
+
import torch
|
| 400 |
+
from .flash import history_rows
|
| 401 |
+
k, rng = self._key(k)
|
| 402 |
+
i = int(self.index[k])
|
| 403 |
+
s0, e1 = int(self.start[i]), int(self.end[i])
|
| 404 |
+
images, state = self._observation(i, rng=rng)
|
| 405 |
+
action = self.lowdim['action']
|
| 406 |
+
poly = action[np.clip(i + self.offsets, s0, e1 - 1)]
|
| 407 |
+
past = i - self.span + np.arange(self.span)
|
| 408 |
+
history, has = history_rows(action[np.maximum(past, s0)], past >= s0, self.stride, self.n_history)
|
| 409 |
+
out = [images, state, torch.from_numpy(np.ascontiguousarray(poly)), torch.from_numpy(history),
|
| 410 |
+
torch.tensor(bool(has))]
|
| 411 |
+
if self.with_dense:
|
| 412 |
+
idx = i + np.arange(self.n_rows)
|
| 413 |
+
out += [torch.from_numpy(np.ascontiguousarray(action[np.minimum(idx, e1 - 1)])),
|
| 414 |
+
torch.from_numpy(idx < e1)]
|
| 415 |
+
return tuple(out)
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/flash.py
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FLASH (Bai et al., "FLASH: Efficient Visuomotor Policy via Sparse Sampling", NeurIPS 2026) behind the baselines
|
| 2 |
+
contract: history-to-future polynomial flow matching with a DiT backbone and one Euler step at inference.
|
| 3 |
+
|
| 4 |
+
Ported from NTUMARS/FLASH-Policy @ f47e490 (Apache-2.0): `roboverse_learn/il/policies/flash/flash_policy.py`
|
| 5 |
+
(`FlashDiTImagePolicy`: basis, least-squares and Tikhonov history fits, KKT C1 boundary constraint, loss, sampler),
|
| 6 |
+
`utils/models/flow_net.py` + `policies/dp/models/diffusion/positional_embedding.py` (the DiT and its torchtune RoPE,
|
| 7 |
+
which differs from the DextraVerse RoPE of nets.py), `utils/vision/multi_image_obs_encoder.py` (one ResNet18 per
|
| 8 |
+
camera, GroupNorm, ImageNet normalization of the range-normalized image) and `configs/policy_config/flash.yaml` +
|
| 9 |
+
`configs/train_config/default_train.yaml` (the defaults below). Architecture, initialization and loss are unchanged.
|
| 10 |
+
|
| 11 |
+
What the humanoid interface changes (owner decisions 2026-11-24, recorded in every checkpoint's config):
|
| 12 |
+
|
| 13 |
+
- **Action space and history.** FLASH fits its flow start to the measured history of the action quantity (Franka
|
| 14 |
+
joint positions). The G1 action76 is the SONIC motion token (64, a latent with no measured counterpart) plus the
|
| 15 |
+
measured INSPIRE openings (12). The history is therefore the *executed* action rows - the token sent at each frame
|
| 16 |
+
and the opening measured at it, the interface's `past_actions` - ending one frame before the query (row t-1: the
|
| 17 |
+
token of frame t is what the policy is asked for). Training reads the same dataset rows. `n_history` points at the
|
| 18 |
+
sampling stride; rows before the episode start repeat its first row (FLASH's edge padding); with no row at all (the
|
| 19 |
+
episode's first frame) the flow starts from the zero coefficients, in training as at deployment.
|
| 20 |
+
- **Sampling stride.** The model's points are `stride` dataset frames apart (30 Hz data: stride 2 = 67 ms, the paper's
|
| 21 |
+
4 x 15 ms = 60 ms). Every dataset frame is an anchor (FLASH's converter keeps only every stride-th frame: one phase
|
| 22 |
+
of the same sparse data).
|
| 23 |
+
- **Observation.** The current ego_view and chest frames and state44 condition the DiT (n_obs 1); FLASH's 8-frame
|
| 24 |
+
observation history is not rendered by the benchmark runners. state44 is the low-dim encoder input as agent_pos is.
|
| 25 |
+
- **Output.** The polynomial is evaluated at every 30 Hz frame from the anchor (`rows` rows, row 0 = the query frame),
|
| 26 |
+
the analytic form of FLASH's continuous-time resampling, at exact frame times. FLASH's velocity feed-forward has no
|
| 27 |
+
channel in the interface (SONIC takes tokens) and is not produced.
|
| 28 |
+
- Polynomial fits run in float32 outside autocast (FLASH runs them inside its bf16 autocast); the encoder and the
|
| 29 |
+
DiT run under the trainer's bf16 autocast as upstream.
|
| 30 |
+
- Augmentation spec v2 replaces the native image augmentation (FLASH's random_crop is configured but inert without
|
| 31 |
+
crop_shape).
|
| 32 |
+
"""
|
| 33 |
+
from __future__ import annotations
|
| 34 |
+
|
| 35 |
+
import copy
|
| 36 |
+
|
| 37 |
+
import numpy as np
|
| 38 |
+
import torch
|
| 39 |
+
import torch.nn as nn
|
| 40 |
+
import torch.nn.functional as F
|
| 41 |
+
import torchvision
|
| 42 |
+
|
| 43 |
+
from .nets import IMAGENET_MEAN, IMAGENET_STD, Mlp, SinusoidalPosEmb, replace_batchnorm_with_groupnorm
|
| 44 |
+
|
| 45 |
+
# configs/policy_config/flash.yaml (+ default_runner.yaml horizon 16 / n_obs 8 / n_action 8), owner 2026-11-24 stride 2
|
| 46 |
+
FLASH_DEFAULTS = dict(stride=2, n_history=8, n_action=8, rows=16, poly_order=6, fit_pad=1, boundary_constraint=True,
|
| 47 |
+
poly_prefix=1, poly_suffix=1, history_noise_std=0.5, history_reg_lambda=0.1,
|
| 48 |
+
consistency_weight=1.0, solver='euler')
|
| 49 |
+
# PolicyConfig fields of a FLASH run (flash.yaml + default_train.yaml): DiT 512 x 4 x 8, dropout 0, time embedding
|
| 50 |
+
# 256, one inference step, ResNet18 from scratch with GroupNorm, one per camera
|
| 51 |
+
FLASH_POLICY_FIELDS = dict(hidden_dim=512, num_layers=4, num_heads=8, mlp_ratio=4.0, dropout=0.0, time_embed_dim=256,
|
| 52 |
+
num_inference_steps=1, backbone='resnet18', backbone_weights=None, backbone_norm='group')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def flash_settings(cfg) -> dict:
|
| 56 |
+
"""The FLASH settings of a PolicyConfig (cfg.extra['flash'] over the defaults); unknown keys are an error."""
|
| 57 |
+
given = dict((cfg.extra or {}).get('flash', {}))
|
| 58 |
+
unknown = sorted(set(given) - set(FLASH_DEFAULTS))
|
| 59 |
+
if unknown:
|
| 60 |
+
raise KeyError(f'unknown FLASH settings {unknown}; known: {sorted(FLASH_DEFAULTS)}')
|
| 61 |
+
out = dict(FLASH_DEFAULTS, **given)
|
| 62 |
+
if out['solver'] not in ('euler', 'midpoint'):
|
| 63 |
+
raise ValueError(f"solver {out['solver']!r}")
|
| 64 |
+
if out['poly_prefix'] is None or int(out['poly_prefix']) < 0:
|
| 65 |
+
raise ValueError('this port implements poly_prefix >= 0 (flash.yaml: 1)')
|
| 66 |
+
return out
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
# --- networks: utils/models/flow_net.py and positional_embedding.py of FLASH-Policy ------------------------------
|
| 70 |
+
class RotaryPosEmbFlash(nn.Module):
|
| 71 |
+
"""torchtune RoPE as FLASH builds it: `dim` = the model width, its dim/2 frequencies split over the heads, pairs
|
| 72 |
+
interleaved (x[..., 0::2], x[..., 1::2])."""
|
| 73 |
+
|
| 74 |
+
def __init__(self, dim: int, max_seq_len: int = 256, base: int = 10_000):
|
| 75 |
+
super().__init__()
|
| 76 |
+
self.dim, self.base, self.max_seq_len = dim, base, max_seq_len
|
| 77 |
+
theta = 1.0 / (base ** (torch.arange(0, dim, 2)[: (dim // 2)].float() / dim))
|
| 78 |
+
self.register_buffer('theta', theta, persistent=False)
|
| 79 |
+
seq_idx = torch.arange(max_seq_len, dtype=theta.dtype)
|
| 80 |
+
idx_theta = torch.einsum('i, j -> ij', seq_idx, theta).float()
|
| 81 |
+
self.register_buffer('cache', torch.stack([torch.cos(idx_theta), torch.sin(idx_theta)], dim=-1),
|
| 82 |
+
persistent=False)
|
| 83 |
+
|
| 84 |
+
def forward(self, x): # x: (B, heads, S, head_dim)
|
| 85 |
+
x = x.permute(0, 2, 1, 3)
|
| 86 |
+
B, S, heads, head_dim = x.size()
|
| 87 |
+
rope = self.cache[:S].view(1, S, heads, head_dim // 2, 2)
|
| 88 |
+
xs = x.float().reshape(*x.shape[:-1], head_dim // 2, 2)
|
| 89 |
+
out = torch.stack([xs[..., 0] * rope[..., 0] - xs[..., 1] * rope[..., 1],
|
| 90 |
+
xs[..., 1] * rope[..., 0] + xs[..., 0] * rope[..., 1]], -1)
|
| 91 |
+
return out.flatten(3).permute(0, 2, 1, 3).type_as(x)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
class FlashAttention(nn.Module):
|
| 95 |
+
def __init__(self, dim, num_heads=8, qkv_bias=True, attn_drop=0.0, proj_drop=0.0, max_seq_len=256, qk_norm=True):
|
| 96 |
+
super().__init__()
|
| 97 |
+
assert dim % num_heads == 0, 'dim should be divisible by num_heads'
|
| 98 |
+
self.num_heads, self.head_dim = num_heads, dim // num_heads
|
| 99 |
+
self.attn_drop = attn_drop
|
| 100 |
+
self.proj_drop = nn.Dropout(proj_drop)
|
| 101 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
| 102 |
+
self.q_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 103 |
+
self.k_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 104 |
+
self.proj = nn.Linear(dim, dim)
|
| 105 |
+
self.rope = RotaryPosEmbFlash(dim, max_seq_len=max_seq_len)
|
| 106 |
+
|
| 107 |
+
def forward(self, x):
|
| 108 |
+
B, S, C = x.shape
|
| 109 |
+
q, k, v = self.qkv(x).reshape(B, S, 3, self.num_heads, self.head_dim).permute(2, 0, 3, 1, 4).unbind(0)
|
| 110 |
+
q, k = self.rope(self.q_norm(q)), self.rope(self.k_norm(k))
|
| 111 |
+
x = F.scaled_dot_product_attention(q, k, v, dropout_p=self.attn_drop if self.training else 0.0)
|
| 112 |
+
return self.proj_drop(self.proj(x.transpose(1, 2).reshape(B, S, C)))
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
class FlashAdaLNBlock(nn.Module):
|
| 116 |
+
def __init__(self, dim, num_heads, mlp_ratio=4.0, dropout=0.0, max_seq_len=256):
|
| 117 |
+
super().__init__()
|
| 118 |
+
self.norm1 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 119 |
+
self.attn = FlashAttention(dim, num_heads=num_heads, attn_drop=dropout, proj_drop=dropout,
|
| 120 |
+
max_seq_len=max_seq_len)
|
| 121 |
+
self.norm2 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 122 |
+
self.mlp = Mlp(in_features=dim, hidden_features=int(dim * mlp_ratio),
|
| 123 |
+
act_layer=lambda: nn.GELU(approximate='tanh'), drop=0)
|
| 124 |
+
self.ada_ln = nn.Sequential(nn.SiLU(), nn.Linear(dim, 6 * dim))
|
| 125 |
+
self.dim = dim
|
| 126 |
+
nn.init.constant_(self.ada_ln[-1].weight, 0)
|
| 127 |
+
nn.init.constant_(self.ada_ln[-1].bias, 0)
|
| 128 |
+
|
| 129 |
+
def forward(self, x, t, c):
|
| 130 |
+
B = x.shape[0]
|
| 131 |
+
gamma1, gamma2, scale1, scale2, shift1, shift2 = self.ada_ln(F.silu(t + c)).view(B, 6, 1, self.dim).unbind(1)
|
| 132 |
+
x = x + self.attn(self.norm1(x).mul(scale1.add(1)).add_(shift1)).mul_(gamma1)
|
| 133 |
+
return x + self.mlp(self.norm2(x).mul(scale2.add(1)).add_(shift2)).mul_(gamma2)
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
class FlashFlowTransformer(nn.Module):
|
| 137 |
+
"""FLASH's FlowTransformer: AdaLN DiT over the C coefficient rows (tokens of width action_dim)."""
|
| 138 |
+
|
| 139 |
+
def __init__(self, input_dim, condition_dim, hidden_dim, output_dim, num_layers, num_heads, mlp_ratio=4.0,
|
| 140 |
+
dropout=0.1, time_embed_dim=256, max_seq_len=256):
|
| 141 |
+
super().__init__()
|
| 142 |
+
self.input_proj = nn.Linear(input_dim, hidden_dim)
|
| 143 |
+
self.time_embed = nn.Sequential(SinusoidalPosEmb(time_embed_dim), nn.Linear(time_embed_dim, time_embed_dim * 4),
|
| 144 |
+
nn.Mish(), nn.Linear(time_embed_dim * 4, hidden_dim))
|
| 145 |
+
self.cond_embed = nn.Linear(condition_dim, hidden_dim)
|
| 146 |
+
self.transformer_blocks = nn.ModuleList(
|
| 147 |
+
[FlashAdaLNBlock(hidden_dim, num_heads, mlp_ratio=mlp_ratio, dropout=dropout, max_seq_len=max_seq_len)
|
| 148 |
+
for _ in range(num_layers)])
|
| 149 |
+
self.norm = nn.LayerNorm(hidden_dim)
|
| 150 |
+
self.out_proj = nn.Linear(hidden_dim, output_dim)
|
| 151 |
+
|
| 152 |
+
def basic_init(module):
|
| 153 |
+
if isinstance(module, nn.Linear):
|
| 154 |
+
nn.init.xavier_uniform_(module.weight)
|
| 155 |
+
if module.bias is not None:
|
| 156 |
+
nn.init.constant_(module.bias, 0)
|
| 157 |
+
|
| 158 |
+
self.apply(basic_init)
|
| 159 |
+
nn.init.normal_(self.time_embed[1].weight, std=0.02)
|
| 160 |
+
nn.init.normal_(self.time_embed[3].weight, std=0.02)
|
| 161 |
+
|
| 162 |
+
def forward(self, x, t, global_cond):
|
| 163 |
+
if not torch.is_tensor(t):
|
| 164 |
+
t = torch.tensor(t, device=x.device)
|
| 165 |
+
if t.ndim == 0:
|
| 166 |
+
t = t.expand(x.shape[0])
|
| 167 |
+
x = self.input_proj(x)
|
| 168 |
+
t = self.time_embed(t)
|
| 169 |
+
c = self.cond_embed(global_cond)
|
| 170 |
+
for block in self.transformer_blocks:
|
| 171 |
+
x = block(x, t, c)
|
| 172 |
+
return self.out_proj(self.norm(x))
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
class FlashObsEncoder(nn.Module):
|
| 176 |
+
"""FLASH's MultiImageObsEncoder (share_rgb_model False, use_group_norm, imagenet_norm, no resize / crop): one
|
| 177 |
+
torchvision ResNet (classifier removed) per camera, every copy deep-copied from one initialization, BatchNorm
|
| 178 |
+
replaced by GroupNorm(C // 16) after the copy; each [0, 1] image goes through FLASH's range normalizer (x 2 - 1)
|
| 179 |
+
and then torchvision's ImageNet Normalize, as upstream composes them. Output: the cameras' pooled features in the
|
| 180 |
+
contract's camera order, then the normalized state. (B, n_cameras * 512 + state_dim)."""
|
| 181 |
+
|
| 182 |
+
def __init__(self, n_cameras, state_dim, backbone='resnet18', weights=None):
|
| 183 |
+
super().__init__()
|
| 184 |
+
base = getattr(torchvision.models, backbone)(weights=weights)
|
| 185 |
+
base.fc = nn.Identity()
|
| 186 |
+
self.rgb = nn.ModuleList([replace_batchnorm_with_groupnorm(copy.deepcopy(base)) for _ in range(n_cameras)])
|
| 187 |
+
self.n_cameras, self.state_dim = int(n_cameras), int(state_dim)
|
| 188 |
+
self.register_buffer('mean', torch.tensor(IMAGENET_MEAN).view(1, 3, 1, 1), persistent=False)
|
| 189 |
+
self.register_buffer('std', torch.tensor(IMAGENET_STD).view(1, 3, 1, 1), persistent=False)
|
| 190 |
+
self.feature_dim = self.n_cameras * (512 if backbone in ('resnet18', 'resnet34') else 2048) + self.state_dim
|
| 191 |
+
|
| 192 |
+
def forward(self, images, state):
|
| 193 |
+
"""images (B, n_cameras, 3, H, W) in [0, 1]; state (B, state_dim) normalized."""
|
| 194 |
+
x = images * 2.0 - 1.0 # get_image_range_normalizer: [0, 1] -> [-1, 1]
|
| 195 |
+
feats = [net((x[:, i] - self.mean) / self.std) for i, net in enumerate(self.rgb)]
|
| 196 |
+
return torch.cat([*feats, state], dim=-1)
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
# --- the policy ---------------------------------------------------------------------------------------------------
|
| 200 |
+
def legendre_basis(s: torch.Tensor, degree: int):
|
| 201 |
+
"""Shifted Legendre basis on s in [0, 1] and its first / second derivatives (FLASH's _build_legendre_basis)."""
|
| 202 |
+
x = 2 * s - 1
|
| 203 |
+
H, C = len(s), degree + 1
|
| 204 |
+
P = torch.zeros(H, C, dtype=s.dtype)
|
| 205 |
+
dP = torch.zeros(H, C, dtype=s.dtype)
|
| 206 |
+
d2P = torch.zeros(H, C, dtype=s.dtype)
|
| 207 |
+
P[:, 0] = 1.0
|
| 208 |
+
if C > 1:
|
| 209 |
+
P[:, 1] = x
|
| 210 |
+
dP[:, 1] = 1.0
|
| 211 |
+
for n in range(1, C - 1):
|
| 212 |
+
P[:, n + 1] = ((2 * n + 1) * x * P[:, n] - n * P[:, n - 1]) / (n + 1)
|
| 213 |
+
dP[:, n + 1] = ((2 * n + 1) * (P[:, n] + x * dP[:, n]) - n * dP[:, n - 1]) / (n + 1)
|
| 214 |
+
d2P[:, n + 1] = ((2 * n + 1) * (2 * dP[:, n] + x * d2P[:, n]) - n * d2P[:, n - 1]) / (n + 1)
|
| 215 |
+
return P, 2 * dP, 4 * d2P
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
def history_rows(rows, valid, stride: int, n_history: int):
|
| 219 |
+
"""The FLASH history of one query from its executed rows.
|
| 220 |
+
|
| 221 |
+
rows (N, D) and valid (N,): consecutive frames ending at the frame before the query (row N - 1 = t - 1), a valid
|
| 222 |
+
contiguous suffix (the interface's past_actions / history_valid; the dataset's rows before an anchor). Returns
|
| 223 |
+
(history (n_history, D) float32 at frames t-1-(n_history-1-j)*stride, has_history bool): a point before the first
|
| 224 |
+
valid row repeats that row (FLASH's edge padding); with no valid row has_history is False (zero start)."""
|
| 225 |
+
rows = np.asarray(rows, dtype=np.float32)
|
| 226 |
+
valid = np.asarray(valid, dtype=bool).reshape(-1)
|
| 227 |
+
span = (n_history - 1) * stride + 1
|
| 228 |
+
if len(rows) < span or len(valid) != len(rows):
|
| 229 |
+
raise ValueError(f'need >= {span} history rows (stride {stride} x {n_history} points), got {rows.shape}')
|
| 230 |
+
if not valid.any():
|
| 231 |
+
return np.zeros((n_history, rows.shape[1]), np.float32), False
|
| 232 |
+
first = int(np.argmax(valid))
|
| 233 |
+
if not valid[first:].all():
|
| 234 |
+
raise ValueError('history_valid must be a contiguous suffix')
|
| 235 |
+
idx = len(rows) - 1 - (n_history - 1 - np.arange(n_history)) * stride
|
| 236 |
+
return rows[np.maximum(idx, first)].copy(), True
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
class FlashPolicy(nn.Module):
|
| 240 |
+
"""FLASH (FlashDiTImagePolicy) on the baselines contract.
|
| 241 |
+
|
| 242 |
+
Training: compute_loss(images, state, poly, history, has_history) with poly (B, H_ext, Da) the physical action
|
| 243 |
+
rows at the polynomial's extended grid (anchor index fit_pad + poly_prefix, `stride` frames apart, clamped at the
|
| 244 |
+
episode's ends), history (B, n_history, Da) from history_rows. Inference: predict(images, state, history,
|
| 245 |
+
has_history) -> the physical (B, rows, Da) chunk at 30 Hz from the query frame, and the normalized coefficients."""
|
| 246 |
+
name = 'flash'
|
| 247 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 248 |
+
|
| 249 |
+
def __init__(self, cfg, init_weights=None):
|
| 250 |
+
super().__init__()
|
| 251 |
+
from .policies import Normalizer
|
| 252 |
+
self.cfg = cfg
|
| 253 |
+
self.state_norm = Normalizer(cfg.state_dim)
|
| 254 |
+
self.action_norm = Normalizer(cfg.action_dim)
|
| 255 |
+
f = self.flash = flash_settings(cfg)
|
| 256 |
+
self.stride, self.n_history, self.n_action = int(f['stride']), int(f['n_history']), int(f['n_action'])
|
| 257 |
+
self.rows, self.poly_order, self.fit_pad = int(f['rows']), int(f['poly_order']), int(f['fit_pad'])
|
| 258 |
+
self.prefix, self.suffix = int(f['poly_prefix']), int(f['poly_suffix'])
|
| 259 |
+
self.boundary_constraint = bool(f['boundary_constraint'])
|
| 260 |
+
self.history_noise_std = float(f['history_noise_std'])
|
| 261 |
+
self.history_reg_lambda = float(f['history_reg_lambda'])
|
| 262 |
+
self.consistency_weight = float(f['consistency_weight'])
|
| 263 |
+
self.solver = f['solver']
|
| 264 |
+
if cfg.horizon != self.rows:
|
| 265 |
+
raise ValueError(f'PolicyConfig.horizon {cfg.horizon} must equal the FLASH output rows {self.rows}')
|
| 266 |
+
C = self.num_coeff = self.poly_order + 1
|
| 267 |
+
H_poly = self.H_poly = self.prefix + self.n_action + self.suffix
|
| 268 |
+
H_ext = self.H_ext = H_poly + 2 * self.fit_pad
|
| 269 |
+
self.anchor = self.fit_pad + self.prefix # anchor index in the extended grid
|
| 270 |
+
last_dense = (self.rows - 1) / self.stride
|
| 271 |
+
if self.prefix + last_dense > H_poly - 1 + 1e-9:
|
| 272 |
+
raise ValueError(f'{self.rows} rows at stride {self.stride} reach past the fitted polynomial')
|
| 273 |
+
|
| 274 |
+
s_ext = torch.linspace(0.0, 1.0, H_ext, dtype=torch.float64)
|
| 275 |
+
s_mid = s_ext[self.fit_pad:self.fit_pad + H_poly] if self.fit_pad > 0 else s_ext
|
| 276 |
+
eval_ext, d1_ext, _ = legendre_basis(s_ext, self.poly_order)
|
| 277 |
+
StS = eval_ext.T @ eval_ext
|
| 278 |
+
lstsq = torch.linalg.solve(StS, eval_ext.T)
|
| 279 |
+
eval_mid, _, _ = legendre_basis(s_mid, self.poly_order)
|
| 280 |
+
coeff_scale = torch.norm(lstsq, dim=1).clamp(min=1e-8)
|
| 281 |
+
self.register_buffer('_lstsq_matrix', lstsq.float())
|
| 282 |
+
self.register_buffer('_coeff_scale', coeff_scale.float().view(1, -1, 1))
|
| 283 |
+
# history fit (flash_policy.py, poly_prefix branch): the first n_history rows of the core grid, Tikhonov
|
| 284 |
+
S_hist = eval_mid.double() if H_poly == self.n_history else eval_mid[:self.n_history, :].double()
|
| 285 |
+
StS_hist = S_hist.T @ S_hist
|
| 286 |
+
if self.history_reg_lambda > 0:
|
| 287 |
+
StS_hist = StS_hist + self.history_reg_lambda * torch.eye(C, dtype=torch.float64)
|
| 288 |
+
self.register_buffer('_history_lstsq_matrix', torch.linalg.solve(StS_hist, S_hist.T).float())
|
| 289 |
+
if self.boundary_constraint: # KKT C1 at the execution start and the next window's start
|
| 290 |
+
idx = [self.fit_pad + self.prefix, self.fit_pad + self.prefix + self.n_action]
|
| 291 |
+
if idx[1] >= H_ext:
|
| 292 |
+
raise ValueError(f'bc_overlap {idx[1]} >= H_ext {H_ext}: increase fit_pad')
|
| 293 |
+
A_pos, A_vel = eval_ext[idx, :], d1_ext[idx, :]
|
| 294 |
+
A = torch.cat([A_pos, A_vel], dim=0)
|
| 295 |
+
StS_inv_AT = torch.linalg.solve(StS, torch.eye(C, dtype=torch.float64)) @ A.T
|
| 296 |
+
self.register_buffer('_bc_eval_pos', A_pos.float())
|
| 297 |
+
self.register_buffer('_bc_eval_vel', A_vel.float())
|
| 298 |
+
self.register_buffer('_bc_correction', (StS_inv_AT @ torch.linalg.inv(A @ StS_inv_AT)).float())
|
| 299 |
+
self.register_buffer('_bc_pos_indices', torch.tensor(idx, dtype=torch.long))
|
| 300 |
+
# the 30 Hz output rows: frame k after the anchor sits at grid index anchor + k / stride
|
| 301 |
+
s_dense = torch.tensor([(self.anchor + k / self.stride) / (H_ext - 1) for k in range(self.rows)],
|
| 302 |
+
dtype=torch.float64)
|
| 303 |
+
self.register_buffer('_dense_eval_matrix', legendre_basis(s_dense, self.poly_order)[0].float())
|
| 304 |
+
|
| 305 |
+
self.obs_encoder = FlashObsEncoder(cfg.n_cameras, cfg.state_dim, backbone=cfg.backbone, weights=init_weights)
|
| 306 |
+
self.model = FlashFlowTransformer(input_dim=cfg.action_dim, condition_dim=self.obs_encoder.feature_dim,
|
| 307 |
+
hidden_dim=cfg.hidden_dim, output_dim=cfg.action_dim,
|
| 308 |
+
num_layers=cfg.num_layers, num_heads=cfg.num_heads, mlp_ratio=cfg.mlp_ratio,
|
| 309 |
+
dropout=cfg.dropout, time_embed_dim=cfg.time_embed_dim)
|
| 310 |
+
|
| 311 |
+
def fit_normalizers(self, stats: dict):
|
| 312 |
+
self.state_norm.fit(stats['state']['min'], stats['state']['max'])
|
| 313 |
+
self.action_norm.fit(stats['action']['min'], stats['action']['max'])
|
| 314 |
+
|
| 315 |
+
@property
|
| 316 |
+
def sampling_steps(self) -> int:
|
| 317 |
+
return int(self.cfg.num_inference_steps or 1)
|
| 318 |
+
|
| 319 |
+
@property
|
| 320 |
+
def history_span(self) -> int:
|
| 321 |
+
"""Executed rows a query needs: (n_history - 1) * stride + 1."""
|
| 322 |
+
return (self.n_history - 1) * self.stride + 1
|
| 323 |
+
|
| 324 |
+
def extended_offsets(self) -> np.ndarray:
|
| 325 |
+
"""Frame offsets from the anchor of the extended polynomial grid (for the training targets)."""
|
| 326 |
+
return (np.arange(self.H_ext) - self.anchor) * self.stride
|
| 327 |
+
|
| 328 |
+
# polynomial operations, float32 and outside autocast ----------------------------------------------------------
|
| 329 |
+
def _to_coeff(self, traj_n):
|
| 330 |
+
return torch.einsum('ch,bhd->bcd', self._lstsq_matrix, traj_n) / self._coeff_scale
|
| 331 |
+
|
| 332 |
+
def _history_coeff(self, history, has_history):
|
| 333 |
+
with torch.autocast(history.device.type, enabled=False):
|
| 334 |
+
h = torch.einsum('ch,bhd->bcd', self._history_lstsq_matrix, self.action_norm.normalize(history.float()))
|
| 335 |
+
h = h / self._coeff_scale
|
| 336 |
+
return torch.where(has_history.view(-1, 1, 1).bool(), h, torch.zeros_like(h))
|
| 337 |
+
|
| 338 |
+
def _apply_boundary_constraint(self, norm_coeff, traj_n):
|
| 339 |
+
raw = norm_coeff * self._coeff_scale
|
| 340 |
+
idx, H = self._bc_pos_indices, traj_n.shape[1]
|
| 341 |
+
cur_pos = torch.einsum('kc,bcd->bkd', self._bc_eval_pos, raw)
|
| 342 |
+
tgt_pos = traj_n[:, idx, :]
|
| 343 |
+
vel = []
|
| 344 |
+
for i in idx.tolist():
|
| 345 |
+
if i + 1 < H:
|
| 346 |
+
v = (traj_n[:, i + 1] - traj_n[:, i - 1]) * (H - 1) / 2
|
| 347 |
+
elif i >= 2:
|
| 348 |
+
v = (3 * traj_n[:, i] - 4 * traj_n[:, i - 1] + traj_n[:, i - 2]) * (H - 1) / 2
|
| 349 |
+
else:
|
| 350 |
+
v = (traj_n[:, i] - traj_n[:, i - 1]) * (H - 1)
|
| 351 |
+
vel.append(v)
|
| 352 |
+
tgt_vel = torch.stack(vel, dim=1)
|
| 353 |
+
cur_vel = torch.einsum('kc,bcd->bkd', self._bc_eval_vel, raw)
|
| 354 |
+
residual = torch.cat([cur_pos - tgt_pos, cur_vel - tgt_vel], dim=1)
|
| 355 |
+
return (raw - torch.einsum('ck,bkd->bcd', self._bc_correction, residual)) / self._coeff_scale
|
| 356 |
+
|
| 357 |
+
def target_coeff(self, poly):
|
| 358 |
+
with torch.autocast(poly.device.type, enabled=False):
|
| 359 |
+
traj_n = self.action_norm.normalize(poly.float())
|
| 360 |
+
coeff = self._to_coeff(traj_n)
|
| 361 |
+
if self.boundary_constraint:
|
| 362 |
+
coeff = self._apply_boundary_constraint(coeff, traj_n)
|
| 363 |
+
return coeff
|
| 364 |
+
|
| 365 |
+
def dense_from_coeff(self, norm_coeff):
|
| 366 |
+
"""(B, rows, Da) physical actions at the 30 Hz frames from the anchor."""
|
| 367 |
+
with torch.autocast(norm_coeff.device.type, enabled=False):
|
| 368 |
+
raw = norm_coeff.float() * self._coeff_scale
|
| 369 |
+
return self.action_norm.unnormalize(torch.einsum('hc,bcd->bhd', self._dense_eval_matrix, raw))
|
| 370 |
+
|
| 371 |
+
def condition(self, images, state):
|
| 372 |
+
return self.obs_encoder(images, self.state_norm.normalize(state))
|
| 373 |
+
|
| 374 |
+
# training and inference ------------------------------------------------------------------------------------------
|
| 375 |
+
def compute_loss(self, images, state, poly, history, has_history):
|
| 376 |
+
target = self.target_coeff(poly)
|
| 377 |
+
hist = self._history_coeff(history, has_history)
|
| 378 |
+
if self.training and self.history_noise_std > 0:
|
| 379 |
+
hist = hist + torch.randn_like(hist) * self.history_noise_std
|
| 380 |
+
cond = self.condition(images, state)
|
| 381 |
+
t = torch.rand(target.shape[0], device=target.device)
|
| 382 |
+
te = t.view(-1, 1, 1)
|
| 383 |
+
x_t = (1 - te) * hist + te * target
|
| 384 |
+
loss_fm = F.mse_loss(self.model(x_t, t, cond).float(), target - hist)
|
| 385 |
+
loss, metrics = loss_fm, dict(fm=float(loss_fm.detach()))
|
| 386 |
+
if self.consistency_weight > 0:
|
| 387 |
+
v0 = self.model(hist, torch.zeros_like(t), cond).float()
|
| 388 |
+
loss_c = F.mse_loss(hist + v0, target)
|
| 389 |
+
loss = loss + self.consistency_weight * loss_c
|
| 390 |
+
metrics['consistency'] = float(loss_c.detach())
|
| 391 |
+
return loss, metrics
|
| 392 |
+
|
| 393 |
+
@torch.no_grad()
|
| 394 |
+
def predict_coeff(self, images, state, history, has_history):
|
| 395 |
+
cond = self.condition(images, state)
|
| 396 |
+
x = self._history_coeff(history, has_history)
|
| 397 |
+
times = torch.linspace(0, 1.0, self.sampling_steps + 1)
|
| 398 |
+
for i in range(self.sampling_steps):
|
| 399 |
+
t0 = times[i].view(1).expand(x.shape[0]).to(x.device)
|
| 400 |
+
t1 = times[i + 1].view(1).expand(x.shape[0]).to(x.device)
|
| 401 |
+
dt = (t1 - t0).view(-1, 1, 1)
|
| 402 |
+
if self.solver == 'euler':
|
| 403 |
+
x = x + dt * self.model(x, t0, cond).float()
|
| 404 |
+
else:
|
| 405 |
+
x_mid = x + self.model(x, t0, cond).float() * dt / 2
|
| 406 |
+
x = x + dt * self.model(x_mid, t0 + (t1 - t0) / 2, cond).float()
|
| 407 |
+
return x
|
| 408 |
+
|
| 409 |
+
@torch.no_grad()
|
| 410 |
+
def predict(self, images, state, history, has_history, generator=None): # noqa: ARG002 - deterministic
|
| 411 |
+
coeff = self.predict_coeff(images, state, history, has_history)
|
| 412 |
+
return self.dense_from_coeff(coeff), coeff
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FM-DiT v2: the flow-matching DiT of NTUMARS/FLASH-Policy @ f47e490 behind the baselines contract (owner 2026-11-25).
|
| 2 |
+
|
| 3 |
+
Not the `fm_dit` baseline of policies.py (FM-DiT v1, ported from DextraVerse's IL core), which stays unchanged for the
|
| 4 |
+
checkpoints trained with it. The owner asked for this second implementation after the v1 checkpoints reached 1 success
|
| 5 |
+
in all their closed-loop evaluations; if v2 scores higher under the same training and evaluation, v1 is retired.
|
| 6 |
+
|
| 7 |
+
Ported from `roboverse_learn/il/policies/fm/fm_dit_image_policy.py` (`FlowMatchingDiTImagePolicy`) with
|
| 8 |
+
`configs/policy_config/fm_dit.yaml` and `configs/train_config/default_train.yaml`, FLASH-Policy's own FM-DiT baseline.
|
| 9 |
+
Its network is FLASH's (flow_net.FlowTransformer with the torchtune RoPE, MultiImageObsEncoder), so this module
|
| 10 |
+
reuses flash.py's port of them; only the flow and the sampler differ from FLASH:
|
| 11 |
+
|
| 12 |
+
- loss: x_t = (1 - t) noise + t a with t ~ U(0, 1) and noise ~ N(0, I) over the whole normalized chunk; MSE of the
|
| 13 |
+
DiT's output against a - noise (obs_as_global_cond: no inpainting mask, every element counts);
|
| 14 |
+
- sampling: num_inference_steps 10 midpoint steps from noise (20 DiT calls), t = 0 -> 1;
|
| 15 |
+
- fm_dit.yaml: DiT 512 wide, 4 blocks, 8 heads, mlp ratio 4, dropout 0.1, time embedding 256; one ResNet18 per camera
|
| 16 |
+
from scratch with GroupNorm, ImageNet normalization of the range-normalized image; the state joins the image
|
| 17 |
+
features as the low-dim input (agent_pos), as in FLASH's encoder;
|
| 18 |
+
- default_train.yaml: seed 42, AdamW lr 1e-4 (betas 0.95 / 0.999, weight decay 1e-6), 500 warm-up steps then
|
| 19 |
+
diffusers' cosine, Diffusion Policy's EMAModel (power 0.75, max 0.9999), the encoder at the full learning rate
|
| 20 |
+
(train.py FM_DIT_V2_TRAINING).
|
| 21 |
+
|
| 22 |
+
What the humanoid interface changes, as for FLASH (flash.py, owner 2026-11-24/25: aligned with FLASH's port):
|
| 23 |
+
one observation frame (the current ego_view and chest frames and state44; the runners render no 8-frame history),
|
| 24 |
+
16 rows of action76 at 30 Hz from the query frame (row 0 = the query frame, the LeRobot rows t..t+15, as every
|
| 25 |
+
baseline), the augmentation spec v2 in place of the native random_crop (inert upstream without crop_shape), the
|
| 26 |
+
benchmark's batch 512 on one GPU. The runners re-query after at most 12 rows (FLASH-Policy executes 8 of 16).
|
| 27 |
+
"""
|
| 28 |
+
from __future__ import annotations
|
| 29 |
+
|
| 30 |
+
import torch
|
| 31 |
+
import torch.nn as nn
|
| 32 |
+
import torch.nn.functional as F
|
| 33 |
+
|
| 34 |
+
from .flash import FlashFlowTransformer, FlashObsEncoder
|
| 35 |
+
|
| 36 |
+
# fm_dit.yaml: the PolicyConfig fields of an FM-DiT v2 run
|
| 37 |
+
FM_DIT_V2_POLICY_FIELDS = dict(hidden_dim=512, num_layers=4, num_heads=8, mlp_ratio=4.0, dropout=0.1,
|
| 38 |
+
time_embed_dim=256, num_inference_steps=10, backbone='resnet18',
|
| 39 |
+
backbone_weights=None, backbone_norm='group')
|
| 40 |
+
UPSTREAM = 'NTUMARS/FLASH-Policy@f47e490 roboverse_learn/il/policies/fm/fm_dit_image_policy.py (fm_dit.yaml)'
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
class FMDiTv2Policy(nn.Module):
|
| 44 |
+
"""FLASH-Policy's FlowMatchingDiTImagePolicy on the baselines contract (module docstring). The policies.BasePolicy
|
| 45 |
+
contract (an nn.Module, as flash.FlashPolicy, so that policies.py can register it without an import cycle)."""
|
| 46 |
+
name = 'fm_dit_v2'
|
| 47 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 48 |
+
lead_rows = 0
|
| 49 |
+
|
| 50 |
+
def __init__(self, cfg, init_weights=None):
|
| 51 |
+
super().__init__()
|
| 52 |
+
from .policies import Normalizer
|
| 53 |
+
self.cfg = cfg
|
| 54 |
+
self.state_norm = Normalizer(cfg.state_dim)
|
| 55 |
+
self.action_norm = Normalizer(cfg.action_dim)
|
| 56 |
+
self.obs_encoder = FlashObsEncoder(cfg.n_cameras, cfg.state_dim, backbone=cfg.backbone, weights=init_weights)
|
| 57 |
+
# fm_dit_image_policy.py: max_seq_len = horizon (the RoPE cache covers the action tokens)
|
| 58 |
+
self.model = FlashFlowTransformer(input_dim=cfg.action_dim, condition_dim=self.obs_encoder.feature_dim,
|
| 59 |
+
hidden_dim=cfg.hidden_dim, output_dim=cfg.action_dim,
|
| 60 |
+
num_layers=cfg.num_layers, num_heads=cfg.num_heads,
|
| 61 |
+
mlp_ratio=cfg.mlp_ratio, dropout=cfg.dropout,
|
| 62 |
+
time_embed_dim=cfg.time_embed_dim, max_seq_len=cfg.horizon)
|
| 63 |
+
|
| 64 |
+
def fit_normalizers(self, stats: dict):
|
| 65 |
+
"""LinearNormalizer 'limits' (upstream's default): state and action min / max to [-1, 1]."""
|
| 66 |
+
self.state_norm.fit(stats['state']['min'], stats['state']['max'])
|
| 67 |
+
self.action_norm.fit(stats['action']['min'], stats['action']['max'])
|
| 68 |
+
|
| 69 |
+
@property
|
| 70 |
+
def sampling_steps(self) -> int:
|
| 71 |
+
return int(self.cfg.num_inference_steps or 10)
|
| 72 |
+
|
| 73 |
+
def condition(self, images, state):
|
| 74 |
+
return self.obs_encoder(images, self.state_norm.normalize(state))
|
| 75 |
+
|
| 76 |
+
def compute_loss(self, images, state, action):
|
| 77 |
+
cond = self.condition(images, state)
|
| 78 |
+
target = self.action_norm.normalize(action.float())
|
| 79 |
+
noise = torch.randn_like(target)
|
| 80 |
+
t = torch.rand(target.shape[0], device=target.device)
|
| 81 |
+
te = t.view(-1, 1, 1)
|
| 82 |
+
x_t = (1 - te) * noise + te * target
|
| 83 |
+
loss = F.mse_loss(self.model(x_t, t, cond).float(), target - noise)
|
| 84 |
+
return loss, dict(fm=float(loss.detach()))
|
| 85 |
+
|
| 86 |
+
@torch.no_grad()
|
| 87 |
+
def predict(self, images, state, generator=None):
|
| 88 |
+
cond = self.condition(images, state)
|
| 89 |
+
B, steps = images.shape[0], self.sampling_steps
|
| 90 |
+
x = torch.randn((B, self.cfg.horizon, self.cfg.action_dim), device=images.device, dtype=torch.float32,
|
| 91 |
+
generator=generator)
|
| 92 |
+
times = torch.linspace(0, 1.0, steps + 1)
|
| 93 |
+
for i in range(steps): # conditional_sample: the midpoint rule
|
| 94 |
+
t0 = times[i].view(1).expand(B).to(images.device)
|
| 95 |
+
t1 = times[i + 1].view(1).expand(B).to(images.device)
|
| 96 |
+
dt = (t1 - t0).view(-1, 1, 1)
|
| 97 |
+
x_mid = x + self.model(x, t0, cond).float() * dt / 2
|
| 98 |
+
x = x + dt * self.model(x_mid, t0 + (t1 - t0) / 2, cond).float()
|
| 99 |
+
return self.action_norm.unnormalize(x), x
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/inloop.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""In-training open-loop action MSE of the baselines (owner 2026-11-22: every training of every model measures it while
|
| 2 |
+
it trains; HumanWAM `hb_training/REPRODUCIBILITY.md` section 6).
|
| 3 |
+
|
| 4 |
+
The protocol code is HumanWAM's `hb_training/eval-action-mse` (`hb_inloop_core.InLoop` and `hb_eval_common`), used
|
| 5 |
+
unmodified from the directory given to train.py as --inloop-code; its cache lives under $HB_EVAL_CACHE (default
|
| 6 |
+
$G/eval-action-mse/cache) and is built by its `build_cache.py <task> train10`. Per evaluation: the queries every 16
|
| 7 |
+
frames of the task's `heldout` episodes (`train10` when it has none), the first 16 predicted rows against the
|
| 8 |
+
recorded ones, nMSE over the training-frame std (constant dims excluded), batches of 8 queries seeded
|
| 9 |
+
1234 + 1000 rank + batch index, every HB_INLOOP_EVERY (250) steps; one json line per evaluation in
|
| 10 |
+
<run>/logs/inloop-mse.jsonl and `HB_INLOOP` lines in the log. Training RNG and module modes are restored after each.
|
| 11 |
+
|
| 12 |
+
The evaluated weights are the ones the run saves (the EMA). Inputs as at deployment: each camera resized like the
|
| 13 |
+
training cache (data.resize_frame), state44, and for FLASH the cached past actions (the up to 16 recorded rows before
|
| 14 |
+
the query: the eval protocol's `past_action`) through the same history rule as the adapter (runtime.BaselinePolicy).
|
| 15 |
+
Before the first step the cache is checked against the run's data: the cached state and action rows of every cached
|
| 16 |
+
episode that the run loaded must equal the run's rows bit for bit.
|
| 17 |
+
"""
|
| 18 |
+
from __future__ import annotations
|
| 19 |
+
|
| 20 |
+
import os
|
| 21 |
+
from pathlib import Path
|
| 22 |
+
import sys
|
| 23 |
+
|
| 24 |
+
import numpy as np
|
| 25 |
+
|
| 26 |
+
from .data import resize_frame
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def install(code_dir, task, run_dir, get_model, contract, cameras, hw, lowdim, policy_name, lowdim_loader=None):
|
| 30 |
+
"""The InLoop object of this run (its evaluate(step, model) is called by train.py), after the cache check."""
|
| 31 |
+
code_dir = Path(code_dir).expanduser().resolve()
|
| 32 |
+
if not (code_dir / 'hb_inloop_core.py').exists():
|
| 33 |
+
raise FileNotFoundError(f'{code_dir}: no hb_inloop_core.py (HumanWAM hb_training/eval-action-mse)')
|
| 34 |
+
if str(code_dir) not in sys.path:
|
| 35 |
+
sys.path.insert(0, str(code_dir))
|
| 36 |
+
import hb_inloop_core as core
|
| 37 |
+
E = core.E
|
| 38 |
+
if core.EVERY <= 0:
|
| 39 |
+
print(f'HB_INLOOP {policy_name} disabled: HB_INLOOP_EVERY={core.EVERY}', flush=True)
|
| 40 |
+
return None
|
| 41 |
+
if task not in E.TASKS:
|
| 42 |
+
raise KeyError(f'task {task!r} is not registered in {code_dir}/hb_eval_common.py TASKS')
|
| 43 |
+
split = core.pick_split(task)
|
| 44 |
+
meta = E.load_meta(task, split)
|
| 45 |
+
lay = E.LAYOUTS[meta['layout']]
|
| 46 |
+
if (lay['state_dim'], lay['action_dim']) != (contract.state_dim, contract.action_dim):
|
| 47 |
+
raise ValueError(f"eval layout {meta['layout']} {lay['state_dim']}/{lay['action_dim']} vs contract "
|
| 48 |
+
f'{contract.name} {contract.state_dim}/{contract.action_dim}')
|
| 49 |
+
missing = [c for c in cameras if c not in meta['cams']]
|
| 50 |
+
if missing:
|
| 51 |
+
raise KeyError(f"cameras {missing} not in the eval cache {meta['cams']}")
|
| 52 |
+
def check(rows, what):
|
| 53 |
+
done = []
|
| 54 |
+
for ep in meta['episodes']: # the cache holds this run's data
|
| 55 |
+
if ep not in rows['episodes']:
|
| 56 |
+
continue
|
| 57 |
+
p = rows['episodes'].index(ep)
|
| 58 |
+
s, n = int(rows['starts'][p]), int(rows['lengths'][p])
|
| 59 |
+
with np.load(E.split_dir(task, split) / f'ep_{ep:06d}.npz') as z:
|
| 60 |
+
same = (np.array_equal(z['state'], rows['state'][s:s + n])
|
| 61 |
+
and np.array_equal(z['action'], rows['action'][s:s + n]))
|
| 62 |
+
if not same:
|
| 63 |
+
raise ValueError(f'eval cache {task}/{split} episode {ep} differs from {what} '
|
| 64 |
+
f'(cache source {meta.get("source")})')
|
| 65 |
+
done.append(ep)
|
| 66 |
+
return done
|
| 67 |
+
|
| 68 |
+
checked = check(lowdim, 'the training data')
|
| 69 |
+
if not checked and lowdim_loader is not None:
|
| 70 |
+
# a held-out split: its episodes are not trained on, so they are checked against the same dataset read
|
| 71 |
+
# through the same contract (2026-11-24, B7 black lead-drop b7td: train 0-99, held out 100-106)
|
| 72 |
+
checked = check(lowdim_loader(list(meta['episodes'])), "this run's dataset (held-out episodes)")
|
| 73 |
+
if not checked:
|
| 74 |
+
raise ValueError(f'no cached episode of {task}/{split} is in this run\'s data: cannot check the cache')
|
| 75 |
+
|
| 76 |
+
import torch
|
| 77 |
+
|
| 78 |
+
def predict(batch, seed):
|
| 79 |
+
model = get_model()
|
| 80 |
+
device = next(model.parameters()).device
|
| 81 |
+
frames = np.stack([np.stack([resize_frame(q['images'][c], hw) for c in cameras]) for q in batch])
|
| 82 |
+
images = torch.from_numpy(frames).to(device).permute(0, 1, 4, 2, 3).float().div_(255.)
|
| 83 |
+
state = torch.from_numpy(np.stack([q['state'] for q in batch]).astype(np.float32)).to(device)
|
| 84 |
+
generator = torch.Generator(device=device)
|
| 85 |
+
generator.manual_seed(int(seed))
|
| 86 |
+
extra = ()
|
| 87 |
+
if policy_name == 'flash':
|
| 88 |
+
from .flash import history_rows
|
| 89 |
+
span, hist, has = model.history_span, [], []
|
| 90 |
+
for q in batch:
|
| 91 |
+
past = np.asarray(q['past_action'], np.float32).reshape(-1, contract.action_dim)
|
| 92 |
+
rows = np.zeros((max(span, len(past)), contract.action_dim), np.float32)
|
| 93 |
+
valid = np.zeros(len(rows), bool)
|
| 94 |
+
if len(past):
|
| 95 |
+
rows[-len(past):], valid[-len(past):] = past, True
|
| 96 |
+
h, ok = history_rows(rows[-span:], valid[-span:], model.stride, model.n_history)
|
| 97 |
+
hist.append(h)
|
| 98 |
+
has.append(ok)
|
| 99 |
+
extra = (torch.from_numpy(np.stack(hist)).to(device), torch.tensor(has, device=device))
|
| 100 |
+
kwargs = {}
|
| 101 |
+
if getattr(model, 'lead_rows', 0): # the ODE policies start from the executed row before (BOS without one)
|
| 102 |
+
prev = [np.asarray(q.get('past_action', ()), np.float32).reshape(-1, contract.action_dim) for q in batch]
|
| 103 |
+
kwargs = dict(previous=torch.from_numpy(np.stack([p[-1] if len(p) else np.zeros(contract.action_dim,
|
| 104 |
+
np.float32)
|
| 105 |
+
for p in prev])).to(device),
|
| 106 |
+
has_previous=torch.tensor([len(p) > 0 for p in prev], device=device))
|
| 107 |
+
pred, _ = model.predict(images, state, *extra, generator=generator, **kwargs)
|
| 108 |
+
return pred.float().cpu().numpy()
|
| 109 |
+
|
| 110 |
+
info = dict(weights='ema', policy=policy_name, cache_checked_episodes=checked,
|
| 111 |
+
inloop_code=str(code_dir), cache=str(E.split_dir(task, split)))
|
| 112 |
+
loop = core.InLoop(policy_name, task, split, Path(run_dir) / 'logs' / 'inloop-mse.jsonl', predict,
|
| 113 |
+
cams=list(cameras), info=info)
|
| 114 |
+
loop.every = core.EVERY
|
| 115 |
+
loop.say(f'{policy_name} installed: task {task} split {split}, every {core.EVERY} steps, cache checked on '
|
| 116 |
+
f'episodes {checked}, code {code_dir}, G={os.environ.get("G", "<default>")}')
|
| 117 |
+
return loop
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/nets.py
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Networks of the FM-DiT and DP (DDPM-DiT) baselines: the AdaLN DiT action backbone and the camera + state encoder.
|
| 2 |
+
|
| 3 |
+
Ported from DextraVerse's imitation-learning core (`dextraverse/algorithms/il/models/nets/dit.py`, `layers.py`,
|
| 4 |
+
`positional_embedding.py`, `vision/backbones.py`, `vision/encoder.py`), unchanged in architecture and initialization.
|
| 5 |
+
Left out: the ROVE improvement embedding, the spatial-softmax / R3M / tactile options and the inpainting path (the
|
| 6 |
+
baselines always condition through the global observation feature). Added: the ResNet's normalization choice
|
| 7 |
+
(`get_resnet`): DextraVerse's GroupNorm for a backbone trained from scratch, or BatchNorm frozen at the pretrained
|
| 8 |
+
statistics (the DETR / ACT practice) for an ImageNet-initialized backbone that is fine-tuned with the policy.
|
| 9 |
+
"""
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import math
|
| 13 |
+
|
| 14 |
+
import torch
|
| 15 |
+
import torch.nn as nn
|
| 16 |
+
import torch.nn.functional as F
|
| 17 |
+
import torchvision
|
| 18 |
+
|
| 19 |
+
IMAGENET_MEAN = (0.485, 0.456, 0.406)
|
| 20 |
+
IMAGENET_STD = (0.229, 0.224, 0.225)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class SinusoidalPosEmb(nn.Module):
|
| 24 |
+
def __init__(self, dim):
|
| 25 |
+
super().__init__()
|
| 26 |
+
self.dim = dim
|
| 27 |
+
|
| 28 |
+
def forward(self, x):
|
| 29 |
+
half_dim = self.dim // 2
|
| 30 |
+
emb = math.log(10000) / (half_dim - 1)
|
| 31 |
+
emb = torch.exp(torch.arange(half_dim, device=x.device) * -emb)
|
| 32 |
+
emb = x[:, None] * emb[None, :]
|
| 33 |
+
return torch.cat((emb.sin(), emb.cos()), dim=-1)
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
class RotaryPosEmb(nn.Module):
|
| 37 |
+
"""Rotary position embedding over each attention head's (S, head_dim) slice."""
|
| 38 |
+
|
| 39 |
+
def __init__(self, dim):
|
| 40 |
+
super().__init__()
|
| 41 |
+
self.dim = dim
|
| 42 |
+
self.register_buffer('inv_freq', 1.0 / (10000 ** (torch.arange(0, dim, 2).float() / dim)))
|
| 43 |
+
|
| 44 |
+
def forward(self, x): # x: (B, heads, S, head_dim)
|
| 45 |
+
t = torch.arange(x.shape[-2], device=x.device, dtype=self.inv_freq.dtype)
|
| 46 |
+
freqs = torch.outer(t, self.inv_freq.to(x.device))
|
| 47 |
+
emb = torch.cat([freqs, freqs], dim=-1)
|
| 48 |
+
cos, sin = emb.cos()[None, None], emb.sin()[None, None]
|
| 49 |
+
x1, x2 = x[..., : x.shape[-1] // 2], x[..., x.shape[-1] // 2:]
|
| 50 |
+
return x * cos + torch.cat([-x2, x1], dim=-1) * sin
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
class Mlp(nn.Module):
|
| 54 |
+
"""The ViT MLP (timm.layers.Mlp) as DextraVerse's nets/layers.py."""
|
| 55 |
+
|
| 56 |
+
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0):
|
| 57 |
+
super().__init__()
|
| 58 |
+
out_features = out_features or in_features
|
| 59 |
+
hidden_features = hidden_features or in_features
|
| 60 |
+
self.fc1 = nn.Linear(in_features, hidden_features)
|
| 61 |
+
self.act = act_layer()
|
| 62 |
+
self.drop1 = nn.Dropout(drop)
|
| 63 |
+
self.norm = nn.Identity()
|
| 64 |
+
self.fc2 = nn.Linear(hidden_features, out_features)
|
| 65 |
+
self.drop2 = nn.Dropout(drop)
|
| 66 |
+
|
| 67 |
+
def forward(self, x):
|
| 68 |
+
return self.drop2(self.fc2(self.norm(self.drop1(self.act(self.fc1(x))))))
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
class Attention(nn.Module):
|
| 72 |
+
def __init__(self, dim, num_heads=8, qkv_bias=True, attn_drop=0.0, proj_drop=0.0, qk_norm=True):
|
| 73 |
+
super().__init__()
|
| 74 |
+
assert dim % num_heads == 0, 'dim should be divisible by num_heads'
|
| 75 |
+
self.num_heads = num_heads
|
| 76 |
+
self.head_dim = dim // num_heads
|
| 77 |
+
self.attn_drop = attn_drop
|
| 78 |
+
self.proj_drop = nn.Dropout(proj_drop)
|
| 79 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
| 80 |
+
self.q_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 81 |
+
self.k_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 82 |
+
self.proj = nn.Linear(dim, dim)
|
| 83 |
+
self.rope = RotaryPosEmb(self.head_dim)
|
| 84 |
+
|
| 85 |
+
def forward(self, x):
|
| 86 |
+
B, S, C = x.shape
|
| 87 |
+
qkv = self.qkv(x).reshape(B, S, 3, self.num_heads, self.head_dim).permute(2, 0, 3, 1, 4)
|
| 88 |
+
q, k, v = qkv.unbind(0)
|
| 89 |
+
q, k = self.rope(self.q_norm(q)), self.rope(self.k_norm(k))
|
| 90 |
+
x = F.scaled_dot_product_attention(q, k, v, dropout_p=self.attn_drop if self.training else 0.0)
|
| 91 |
+
return self.proj_drop(self.proj(x.transpose(1, 2).reshape(B, S, C)))
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
class AdaLNBlock(nn.Module):
|
| 95 |
+
"""Adaptive-LayerNorm transformer block as in DiT (Peebles et al. 2022)."""
|
| 96 |
+
|
| 97 |
+
def __init__(self, dim, num_heads, mlp_ratio=4.0, dropout=0.0):
|
| 98 |
+
super().__init__()
|
| 99 |
+
self.norm1 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 100 |
+
self.attn = Attention(dim, num_heads=num_heads, attn_drop=dropout, proj_drop=dropout)
|
| 101 |
+
self.norm2 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 102 |
+
self.mlp = Mlp(in_features=dim, hidden_features=int(dim * mlp_ratio),
|
| 103 |
+
act_layer=lambda: nn.GELU(approximate='tanh'), drop=0)
|
| 104 |
+
self.ada_ln = nn.Sequential(nn.SiLU(), nn.Linear(dim, 6 * dim))
|
| 105 |
+
self.dim = dim
|
| 106 |
+
nn.init.constant_(self.ada_ln[-1].weight, 0)
|
| 107 |
+
nn.init.constant_(self.ada_ln[-1].bias, 0)
|
| 108 |
+
|
| 109 |
+
def forward(self, x, t, c):
|
| 110 |
+
B = x.shape[0]
|
| 111 |
+
gamma1, gamma2, scale1, scale2, shift1, shift2 = self.ada_ln(F.silu(t + c)).view(B, 6, 1, self.dim).unbind(1)
|
| 112 |
+
x = x + self.attn(self.norm1(x).mul(scale1.add(1)).add_(shift1)).mul_(gamma1)
|
| 113 |
+
return x + self.mlp(self.norm2(x).mul(scale2.add(1)).add_(shift2)).mul_(gamma2)
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
class FlowTransformer(nn.Module):
|
| 117 |
+
"""DiT action backbone: AdaLN blocks over the H action tokens, conditioned on time_embed(t) + cond_embed(obs).
|
| 118 |
+
|
| 119 |
+
As DextraVerse, the generic Xavier initialization runs after the blocks' zero init of their AdaLN projection, so
|
| 120 |
+
it is not the full AdaLN-Zero recipe (kept: it is the reference's training behaviour)."""
|
| 121 |
+
|
| 122 |
+
def __init__(self, input_dim, condition_dim, hidden_dim, output_dim, num_layers, num_heads, mlp_ratio=4.0,
|
| 123 |
+
dropout=0.1, time_embed_dim=256):
|
| 124 |
+
super().__init__()
|
| 125 |
+
self.input_proj = nn.Linear(input_dim, hidden_dim)
|
| 126 |
+
self.time_embed = nn.Sequential(SinusoidalPosEmb(time_embed_dim), nn.Linear(time_embed_dim, time_embed_dim * 4),
|
| 127 |
+
nn.Mish(), nn.Linear(time_embed_dim * 4, hidden_dim))
|
| 128 |
+
self.cond_embed = nn.Linear(condition_dim, hidden_dim)
|
| 129 |
+
self.transformer_blocks = nn.ModuleList(
|
| 130 |
+
[AdaLNBlock(hidden_dim, num_heads, mlp_ratio=mlp_ratio, dropout=dropout) for _ in range(num_layers)])
|
| 131 |
+
self.norm = nn.LayerNorm(hidden_dim)
|
| 132 |
+
self.out_proj = nn.Linear(hidden_dim, output_dim)
|
| 133 |
+
|
| 134 |
+
def basic_init(module):
|
| 135 |
+
if isinstance(module, nn.Linear):
|
| 136 |
+
nn.init.xavier_uniform_(module.weight)
|
| 137 |
+
if module.bias is not None:
|
| 138 |
+
nn.init.constant_(module.bias, 0)
|
| 139 |
+
|
| 140 |
+
self.apply(basic_init)
|
| 141 |
+
nn.init.normal_(self.time_embed[1].weight, std=0.02)
|
| 142 |
+
nn.init.normal_(self.time_embed[3].weight, std=0.02)
|
| 143 |
+
|
| 144 |
+
def forward(self, x, t, global_cond):
|
| 145 |
+
if not torch.is_tensor(t):
|
| 146 |
+
t = torch.tensor(t, device=x.device)
|
| 147 |
+
if t.ndim == 0:
|
| 148 |
+
t = t.expand(x.shape[0])
|
| 149 |
+
x = self.input_proj(x)
|
| 150 |
+
t = self.time_embed(t)
|
| 151 |
+
c = self.cond_embed(global_cond)
|
| 152 |
+
for block in self.transformer_blocks:
|
| 153 |
+
x = block(x, t, c)
|
| 154 |
+
return self.out_proj(self.norm(x))
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
def replace_batchnorm_with_groupnorm(module: nn.Module) -> nn.Module:
|
| 158 |
+
"""DextraVerse's use_group_norm: every BatchNorm2d becomes GroupNorm(num_features // 16 groups)."""
|
| 159 |
+
for name, child in module.named_children():
|
| 160 |
+
if isinstance(child, nn.BatchNorm2d):
|
| 161 |
+
setattr(module, name, nn.GroupNorm(num_groups=child.num_features // 16, num_channels=child.num_features))
|
| 162 |
+
else:
|
| 163 |
+
replace_batchnorm_with_groupnorm(child)
|
| 164 |
+
return module
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
NORMS = ('group', 'frozen_bn')
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
def get_resnet(name='resnet18', weights=None, norm='group') -> nn.Module:
|
| 171 |
+
"""A torchvision ResNet with its classifier removed: (N, 3, H, W) -> (N, 512) globally pooled.
|
| 172 |
+
|
| 173 |
+
weights: torchvision weights name (e.g. 'IMAGENET1K_V1') to initialize from, or None (random initialization;
|
| 174 |
+
a checkpoint load supplies every weight). norm: 'group' replaces every BatchNorm with GroupNorm (DextraVerse's
|
| 175 |
+
use_group_norm, for training from scratch: pretrained BatchNorm statistics and affine are dropped); 'frozen_bn'
|
| 176 |
+
keeps BatchNorm frozen at its (pretrained) running statistics and affine, the convolutions fine-tune."""
|
| 177 |
+
if norm == 'frozen_bn':
|
| 178 |
+
from .act_nets import FrozenBatchNorm2d
|
| 179 |
+
resnet = getattr(torchvision.models, name)(weights=weights, norm_layer=FrozenBatchNorm2d)
|
| 180 |
+
elif norm == 'group':
|
| 181 |
+
resnet = replace_batchnorm_with_groupnorm(getattr(torchvision.models, name)(weights=weights))
|
| 182 |
+
else:
|
| 183 |
+
raise ValueError(f'norm must be one of {NORMS}, got {norm!r}')
|
| 184 |
+
resnet.fc = nn.Identity()
|
| 185 |
+
return resnet
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
class ImageStateEncoder(nn.Module):
|
| 189 |
+
"""DextraVerse MultiImageObsEncoder as configured for FM-DiT / DDPM-DiT: one ResNet shared by every camera
|
| 190 |
+
(share_rgb_model; `get_resnet` weights and norm), ImageNet normalization of the [0, 1] images, the pooled features
|
| 191 |
+
of each camera in the contract's camera order, then the normalized state. shared=False gives every camera its own
|
| 192 |
+
ResNet (share_rgb_model False, the ODE policy's encoder; `rgb` is then a ModuleList in camera order).
|
| 193 |
+
Output (B, n_cameras * 512 + state_dim)."""
|
| 194 |
+
|
| 195 |
+
def __init__(self, n_cameras, state_dim, backbone='resnet18', weights=None, norm='group', shared=True):
|
| 196 |
+
super().__init__()
|
| 197 |
+
self.n_cameras, self.state_dim, self.shared = int(n_cameras), int(state_dim), bool(shared)
|
| 198 |
+
self.rgb = (get_resnet(backbone, weights=weights, norm=norm) if self.shared else
|
| 199 |
+
nn.ModuleList([get_resnet(backbone, weights=weights, norm=norm) for _ in range(self.n_cameras)]))
|
| 200 |
+
self.register_buffer('mean', torch.tensor(IMAGENET_MEAN).view(1, 3, 1, 1), persistent=False)
|
| 201 |
+
self.register_buffer('std', torch.tensor(IMAGENET_STD).view(1, 3, 1, 1), persistent=False)
|
| 202 |
+
self.feature_dim = self.n_cameras * (512 if backbone in ('resnet18', 'resnet34') else 2048) + self.state_dim
|
| 203 |
+
|
| 204 |
+
def forward(self, images, state):
|
| 205 |
+
"""images (B, n_cameras, 3, H, W) in [0, 1]; state (B, state_dim) normalized."""
|
| 206 |
+
B = images.shape[0]
|
| 207 |
+
if self.shared:
|
| 208 |
+
x = (images.flatten(0, 1) - self.mean) / self.std
|
| 209 |
+
features = self.rgb(x).reshape(B, -1) # camera features side by side, in camera order
|
| 210 |
+
else:
|
| 211 |
+
features = torch.cat([net((images[:, i] - self.mean) / self.std) for i, net in enumerate(self.rgb)], dim=-1)
|
| 212 |
+
return torch.cat([features, state], dim=-1)
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/ode_nets.py
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Vector fields of the ODE policy baselines (ODE-MLP, ODE-DiT).
|
| 2 |
+
|
| 3 |
+
Ported from ODE Policy (Jindou Jia et al., https://github.com/NTUMARS/ODE-POLICY, branch main @cea26d94, Apache-2.0):
|
| 4 |
+
`ode_policy/policies/ode/ode_image_policy.py` (`_FiLMLayer`, `VectorField`, `DiTVectorField`) and the DiT parts it
|
| 5 |
+
uses, `ode_policy/utils/models/flow_net.py` (`Attention`, `AdaLNBlock`), `ode_policy/utils/models/layers.py` (`Mlp`)
|
| 6 |
+
and `ode_policy/policies/dp/models/diffusion/positional_embedding.py` (`RotaryPosEmb`, torchtune's interleaved RoPE
|
| 7 |
+
over the full width, which differs from the DextraVerse RoPE of nets.py). Architectures and initializations are
|
| 8 |
+
unchanged. Left out: the gripper-only dropout pass (`drop_first`; the benchmark's actions have no binary gripper).
|
| 9 |
+
|
| 10 |
+
Both fields are autonomous (no time input): f(a, s | c) depends only on where the action state `a` is, the
|
| 11 |
+
proprioception `s` (when the field reads it) and the per-chunk condition `c`; the output layer starts at zero, so an
|
| 12 |
+
untrained policy holds its start action.
|
| 13 |
+
"""
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import torch
|
| 17 |
+
import torch.nn as nn
|
| 18 |
+
import torch.nn.functional as F
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class FiLMLayer(nn.Module):
|
| 22 |
+
def __init__(self, dim, cond_dim):
|
| 23 |
+
super().__init__()
|
| 24 |
+
self.lin = nn.Linear(dim, dim)
|
| 25 |
+
self.film = nn.Linear(cond_dim, 2 * dim)
|
| 26 |
+
|
| 27 |
+
def forward(self, h, c=None, gb=None):
|
| 28 |
+
g, b = gb if gb is not None else self.film(c).chunk(2, dim=-1)
|
| 29 |
+
return h + F.silu(self.lin(h) * (1 + g) + b)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class VectorField(nn.Module):
|
| 33 |
+
"""ODE-MLP: f(a, s | c), a FiLM-modulated residual MLP. Training-only dropout on the hidden units keeps one mask
|
| 34 |
+
per sample for every field call until reset_dropout(), so a whole integrated chunk sees one thinned field."""
|
| 35 |
+
|
| 36 |
+
def __init__(self, cond_dim, state_dim, hidden_dim, num_layers, out_dim, pose_dim, dropout=0.0):
|
| 37 |
+
super().__init__()
|
| 38 |
+
self.dropout, self._masks = float(dropout), None
|
| 39 |
+
self.inp = nn.Linear(pose_dim + state_dim, hidden_dim)
|
| 40 |
+
self.layers = nn.ModuleList([FiLMLayer(hidden_dim, cond_dim) for _ in range(num_layers)])
|
| 41 |
+
self.out = nn.Linear(hidden_dim, out_dim)
|
| 42 |
+
self.feat_dim = hidden_dim
|
| 43 |
+
nn.init.zeros_(self.out.weight)
|
| 44 |
+
nn.init.zeros_(self.out.bias)
|
| 45 |
+
|
| 46 |
+
def precompute(self, c):
|
| 47 |
+
"""FiLM scale/shift depend on c only; computed once per integration."""
|
| 48 |
+
return [layer.film(c).chunk(2, dim=-1) for layer in self.layers]
|
| 49 |
+
|
| 50 |
+
def reset_dropout(self):
|
| 51 |
+
self._masks = None
|
| 52 |
+
|
| 53 |
+
def forward(self, a, s, c, film=None):
|
| 54 |
+
drop = self.training and self.dropout > 0
|
| 55 |
+
h = self.inp(torch.cat([a, s], dim=-1))
|
| 56 |
+
if drop and (self._masks is None or self._masks[0].shape != h.shape):
|
| 57 |
+
keep = 1.0 - self.dropout
|
| 58 |
+
self._masks = [torch.bernoulli(torch.full_like(h, keep)) / keep for _ in self.layers]
|
| 59 |
+
for i, layer in enumerate(self.layers):
|
| 60 |
+
h = layer(h, c, None if film is None else film[i])
|
| 61 |
+
if drop:
|
| 62 |
+
h = h * self._masks[i]
|
| 63 |
+
return self.out(h)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
class RotaryPosEmb(nn.Module):
|
| 67 |
+
"""Rotary positional embedding (torchtune), built over the full width `dim` and applied to the heads' slices."""
|
| 68 |
+
|
| 69 |
+
def __init__(self, dim: int, max_seq_len: int = 256, base: int = 10_000):
|
| 70 |
+
super().__init__()
|
| 71 |
+
self.dim, self.base, self.max_seq_len = dim, base, max_seq_len
|
| 72 |
+
theta = 1.0 / (base ** (torch.arange(0, dim, 2)[: (dim // 2)].float() / dim))
|
| 73 |
+
self.register_buffer('theta', theta, persistent=False)
|
| 74 |
+
seq_idx = torch.arange(max_seq_len, dtype=theta.dtype)
|
| 75 |
+
idx_theta = torch.einsum('i, j -> ij', seq_idx, theta).float()
|
| 76 |
+
self.register_buffer('cache', torch.stack([torch.cos(idx_theta), torch.sin(idx_theta)], dim=-1),
|
| 77 |
+
persistent=False)
|
| 78 |
+
|
| 79 |
+
def forward(self, x):
|
| 80 |
+
"""x (B, num_heads, S, head_dim) -> the same shape."""
|
| 81 |
+
x = x.permute(0, 2, 1, 3) # (B, S, num_heads, head_dim)
|
| 82 |
+
B, S, num_heads, head_dim = x.size()
|
| 83 |
+
rope_cache = self.cache[:S]
|
| 84 |
+
xshaped = x.float().reshape(*x.shape[:-1], head_dim // 2, 2)
|
| 85 |
+
rope_cache = rope_cache.view(1, S, num_heads, head_dim // 2, 2)
|
| 86 |
+
x_out = torch.stack([xshaped[..., 0] * rope_cache[..., 0] - xshaped[..., 1] * rope_cache[..., 1],
|
| 87 |
+
xshaped[..., 1] * rope_cache[..., 0] + xshaped[..., 0] * rope_cache[..., 1]], -1)
|
| 88 |
+
return x_out.flatten(3).permute(0, 2, 1, 3).type_as(x)
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
class Attention(nn.Module):
|
| 92 |
+
def __init__(self, dim, num_heads=8, qkv_bias=True, attn_drop=0., proj_drop=0., max_seq_len=64, qk_norm=True):
|
| 93 |
+
super().__init__()
|
| 94 |
+
assert dim % num_heads == 0, 'dim should be divisible by num_heads'
|
| 95 |
+
self.num_heads = num_heads
|
| 96 |
+
self.head_dim = dim // num_heads
|
| 97 |
+
self.attn_drop = attn_drop
|
| 98 |
+
self.proj_drop = nn.Dropout(proj_drop)
|
| 99 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
| 100 |
+
self.q_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 101 |
+
self.k_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 102 |
+
self.proj = nn.Linear(dim, dim)
|
| 103 |
+
self.rope = RotaryPosEmb(dim, max_seq_len=max_seq_len)
|
| 104 |
+
|
| 105 |
+
def forward(self, x, mask=None):
|
| 106 |
+
B, S, C = x.shape
|
| 107 |
+
qkv = self.qkv(x).reshape(B, S, 3, self.num_heads, self.head_dim).permute(2, 0, 3, 1, 4)
|
| 108 |
+
q, k, v = qkv.unbind(0)
|
| 109 |
+
q, k = self.rope(self.q_norm(q)), self.rope(self.k_norm(k))
|
| 110 |
+
if self.training:
|
| 111 |
+
x = F.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=self.attn_drop)
|
| 112 |
+
else:
|
| 113 |
+
x = F.scaled_dot_product_attention(q, k, v)
|
| 114 |
+
return self.proj_drop(self.proj(x.transpose(1, 2).reshape(B, S, C)))
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
class Mlp(nn.Module):
|
| 118 |
+
"""The ViT MLP (timm.layers.Mlp) as ODE Policy's utils/models/layers.py, linear layers only."""
|
| 119 |
+
|
| 120 |
+
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
|
| 121 |
+
super().__init__()
|
| 122 |
+
out_features = out_features or in_features
|
| 123 |
+
hidden_features = hidden_features or in_features
|
| 124 |
+
self.fc1 = nn.Linear(in_features, hidden_features)
|
| 125 |
+
self.act = act_layer()
|
| 126 |
+
self.drop1 = nn.Dropout(drop)
|
| 127 |
+
self.norm = nn.Identity()
|
| 128 |
+
self.fc2 = nn.Linear(hidden_features, out_features)
|
| 129 |
+
self.drop2 = nn.Dropout(drop)
|
| 130 |
+
|
| 131 |
+
def forward(self, x):
|
| 132 |
+
return self.drop2(self.fc2(self.norm(self.drop1(self.act(self.fc1(x))))))
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
class AdaLNBlock(nn.Module):
|
| 136 |
+
"""Adaptive-LayerNorm transformer block as in DiT (Peebles et al. 2022); ada_ln starts at zero (adaLN-zero)."""
|
| 137 |
+
|
| 138 |
+
def __init__(self, dim, num_heads, mlp_ratio=4., dropout=0.):
|
| 139 |
+
super().__init__()
|
| 140 |
+
self.norm1 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 141 |
+
self.attn = Attention(dim, num_heads=num_heads, attn_drop=dropout, proj_drop=dropout)
|
| 142 |
+
self.norm2 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 143 |
+
self.mlp = Mlp(in_features=dim, hidden_features=int(dim * mlp_ratio),
|
| 144 |
+
act_layer=lambda: nn.GELU(approximate='tanh'), drop=0)
|
| 145 |
+
self.ada_ln = nn.Sequential(nn.SiLU(), nn.Linear(dim, 6 * dim))
|
| 146 |
+
self.dim = dim
|
| 147 |
+
nn.init.constant_(self.ada_ln[-1].weight, 0)
|
| 148 |
+
nn.init.constant_(self.ada_ln[-1].bias, 0)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
class DiTVectorField(nn.Module):
|
| 152 |
+
"""ODE-DiT: the vector field built from DiT blocks. [a, s] is projected to n_tokens tokens; every block's
|
| 153 |
+
LayerNorm scales/shifts/gates are regressed from the condition c (no time input: the field is autonomous); the
|
| 154 |
+
tokens are pooled for the output. Same interface and zero-initialized output as VectorField."""
|
| 155 |
+
|
| 156 |
+
def __init__(self, cond_dim, state_dim, hidden_dim, num_layers, out_dim, pose_dim, num_heads=8, n_tokens=4,
|
| 157 |
+
mlp_ratio=4.0):
|
| 158 |
+
super().__init__()
|
| 159 |
+
self.n_tokens, self.hidden_dim, self.feat_dim = n_tokens, hidden_dim, hidden_dim
|
| 160 |
+
self.inp = nn.Linear(pose_dim + state_dim, n_tokens * hidden_dim)
|
| 161 |
+
self.pos = nn.Parameter(torch.zeros(1, n_tokens, hidden_dim))
|
| 162 |
+
self.cond = nn.Linear(cond_dim, hidden_dim)
|
| 163 |
+
self.blocks = nn.ModuleList([AdaLNBlock(hidden_dim, num_heads, mlp_ratio) for _ in range(num_layers)])
|
| 164 |
+
self.norm = nn.LayerNorm(hidden_dim)
|
| 165 |
+
self.out = nn.Linear(hidden_dim, out_dim)
|
| 166 |
+
nn.init.zeros_(self.out.weight)
|
| 167 |
+
nn.init.zeros_(self.out.bias)
|
| 168 |
+
|
| 169 |
+
def precompute(self, c):
|
| 170 |
+
"""The adaLN scales/shifts/gates depend on c only: computed once per integration."""
|
| 171 |
+
cc = F.silu(self.cond(c))
|
| 172 |
+
return [blk.ada_ln(cc).view(c.shape[0], 6, 1, self.hidden_dim).unbind(1) for blk in self.blocks]
|
| 173 |
+
|
| 174 |
+
def forward(self, a, s, c, film=None):
|
| 175 |
+
B = a.shape[0]
|
| 176 |
+
x = self.inp(torch.cat([a, s], dim=-1)).view(B, self.n_tokens, self.hidden_dim) + self.pos
|
| 177 |
+
mods = self.precompute(c) if film is None else film
|
| 178 |
+
for blk, (g1, g2, sc1, sc2, sh1, sh2) in zip(self.blocks, mods):
|
| 179 |
+
x = x + blk.attn(blk.norm1(x) * (1 + sc1) + sh1) * g1
|
| 180 |
+
x = x + blk.mlp(blk.norm2(x) * (1 + sc2) + sh2) * g2
|
| 181 |
+
return self.out(self.norm(x).mean(dim=1))
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/policies.py
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The baseline policies behind one contract; the first three ported from DextraVerse's imitation-learning core:
|
| 2 |
+
|
| 3 |
+
- `fm_dit`, `FMDiTPolicy` (reference: dextraverse/algorithms/il/models/fm_dit.py + fm_base.py): flow matching, MSE on
|
| 4 |
+
the velocity `a - noise`; sampled with 10 midpoint steps from noise (20 DiT calls);
|
| 5 |
+
- `dp`, `DPPolicy` (ddpm_dit.py + ddpm_base.py: Diffusion Policy with a DiT backbone): DDPM epsilon MSE over 100
|
| 6 |
+
steps; sampled with the 100 DDPM steps;
|
| 7 |
+
- `act`, `ACTPolicy` (act.py + nets/act/): L1 + `kl_weight` x KL of the CVAE; decoded from the zero latent in one pass;
|
| 8 |
+
- `flash`, `flash.FlashPolicy` (NTUMARS/FLASH-Policy @ f47e490): polynomial-coefficient flow from the fitted history
|
| 9 |
+
of the executed actions to the future, one Euler step; its contract adds the history (flash.py's docstring).
|
| 10 |
+
- `fm_dit_v2`, `fm_dit_v2.FMDiTv2Policy` (FLASH-Policy @ f47e490's own FM-DiT, owner 2026-11-25): flow matching from
|
| 11 |
+
noise as `fm_dit`, on FLASH's networks (DiT 512, one from-scratch GroupNorm ResNet18 per camera) and recipe; a
|
| 12 |
+
separate entry: `fm_dit` (v1) keeps its checkpoints and behaviour (fm_dit_v2.py's docstring).
|
| 13 |
+
|
| 14 |
+
Two follow ODE Policy's G1 port (Jia et al., github.com/NTUMARS/ODE-POLICY branch real-g1 @fd8bec47, maintained in
|
| 15 |
+
HumanWAM as packages/ode_g1: model.py `SonicLatentODE`, data.py), with its GR00T backbone replaced by ODE Policy's own
|
| 16 |
+
image encoder (ode_policy main @cea26d94, ode.yaml), each in its authors' configuration (not aligned with the others):
|
| 17 |
+
|
| 18 |
+
- `ode_mlp`, `ODEPolicy`: the body part of the action (G1: the SONIC motion token) is an ODE state, db/dt =
|
| 19 |
+
f(b, s | c) with a FiLM residual MLP field, integrated with Euler one row per step from the body row executed at t-1;
|
| 20 |
+
the hands are decoded from c; masked MSE of the integrated path and the hands;
|
| 21 |
+
- `ode_dit`, `ODEDiTPolicy`: the same with ODE Policy's DiT (adaLN) field (ode_dit.yaml).
|
| 22 |
+
|
| 23 |
+
Contract (every policy): `compute_loss(images, state, action) -> (loss, metrics)` and
|
| 24 |
+
`predict(images, state, generator) -> (action, normalized action)`; images (B, n_cameras, 3, H, W) float in [0, 1],
|
| 25 |
+
state (B, state_dim) and action (B, lead_rows + horizon, action_dim) in physical units. Each policy owns its
|
| 26 |
+
`Normalizer` (DextraVerse's LinearNormalizer 'limits' mode: state and action to [-1, 1] per dimension, constant
|
| 27 |
+
dimensions shifted to 0), saved in its state dict. One observation frame (n_obs_steps 1: the current images and
|
| 28 |
+
state); the chunk's row 0 is the action of the observation's own frame (the LeRobot rows t..t+horizon-1). A policy
|
| 29 |
+
with `lead_rows` 1 (the ODE policies) also reads the row before, t-1, and the rows' validity (ChunkDataset `lead`),
|
| 30 |
+
and its `predict` takes `previous`, the action row executed at t-1. The ODE policies normalize with their own bounds
|
| 31 |
+
(q01 / q99, the DFX6 hands fixed at [0, 1], clipped to [-5, 5]). The configuration that builds a policy is a plain
|
| 32 |
+
dict (`PolicyConfig` fields), stored in the checkpoint.
|
| 33 |
+
|
| 34 |
+
The ResNet18 of FM-DiT, DP and ACT starts from torchvision's ImageNet-1k weights (`backbone_weights` 'IMAGENET1K_V1',
|
| 35 |
+
the default since 2026-11-16) and is fine-tuned with the policy, its BatchNorm frozen at the pretrained statistics
|
| 36 |
+
(`backbone_norm` 'frozen_bn', as ACT always does); `backbone_weights` None trains from scratch with DextraVerse's
|
| 37 |
+
GroupNorm encoder (FM-DiT, DP) or ACT's frozen-BatchNorm one. The ODE policies default to ODE Policy's encoder: one
|
| 38 |
+
ResNet18 per camera, from scratch, GroupNorm. A checkpoint load builds the structure without fetching any weights.
|
| 39 |
+
"""
|
| 40 |
+
from __future__ import annotations
|
| 41 |
+
|
| 42 |
+
from dataclasses import asdict, dataclass, field, replace
|
| 43 |
+
|
| 44 |
+
import torch
|
| 45 |
+
import torch.nn as nn
|
| 46 |
+
import torch.nn.functional as F
|
| 47 |
+
|
| 48 |
+
from .act_nets import DETRVAE, Transformer, build_backbone, build_style_encoder, kl_divergence
|
| 49 |
+
from .nets import IMAGENET_MEAN, IMAGENET_STD, FlowTransformer, ImageStateEncoder
|
| 50 |
+
from .ode_nets import DiTVectorField, VectorField
|
| 51 |
+
|
| 52 |
+
ODE_POLICIES = ('ode_mlp', 'ode_dit')
|
| 53 |
+
# Defaults that differ by policy. horizon and backbone_weights resolve in PolicyConfig; backbone_lr_scale (and amp)
|
| 54 |
+
# are the training script's. The ODE policies: 16-row chunks (the G1 port's H16; its deployment re-plans about 4 rows
|
| 55 |
+
# before a chunk ends, as the benchmark clients' query every 12 rows), ODE Policy's encoder from scratch at the full
|
| 56 |
+
# learning rate (ode.yaml, default_train.yaml). Mixed precision as the G1 port: the encoder under bf16 autocast, the
|
| 57 |
+
# ODE head in FP32.
|
| 58 |
+
# The training recipe of ODE Policy's default_train.yaml (the same NTUMARS trainer as FLASH's): seed 42, lr 1e-4 at
|
| 59 |
+
# the benchmark's batch 512 without batch scaling (as every model of the protocol, HumanWAM REPRODUCIBILITY.md
|
| 60 |
+
# section 4), 500-step warm-up then diffusers' cosine, Diffusion Policy's EMAModel as upstream counts it.
|
| 61 |
+
POLICY_DEFAULTS = {name: dict(horizon=16, backbone_weights=None, backbone_lr_scale=1.0, seed=42,
|
| 62 |
+
schedule='diffusers_cosine', ema_schedule='diffusion_policy_emamodel')
|
| 63 |
+
for name in ODE_POLICIES}
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@dataclass
|
| 67 |
+
class PolicyConfig:
|
| 68 |
+
"""Everything that builds a policy (stored in the checkpoint's config.json). Model defaults are DextraVerse's
|
| 69 |
+
configs/algorithm/il/model/{fm_dit,ddpm_dit,act}.yaml and, for the ODE policies (`ode_*` fields), ODE Policy's G1
|
| 70 |
+
port (HumanWAM packages/ode_g1 configs/g1.yaml `head`) and ode_dit.yaml for the DiT field."""
|
| 71 |
+
policy: str
|
| 72 |
+
n_cameras: int
|
| 73 |
+
state_dim: int
|
| 74 |
+
action_dim: int
|
| 75 |
+
horizon: int | None = None # None: the policy's default (POLICY_DEFAULTS, else 16)
|
| 76 |
+
backbone: str = 'resnet18'
|
| 77 |
+
# torchvision weights to initialize from; None = from scratch; 'default': IMAGENET1K_V1, the ODE policies None
|
| 78 |
+
backbone_weights: str | None = 'default'
|
| 79 |
+
backbone_norm: str | None = None # 'frozen_bn' or 'group'; None: frozen_bn when pretrained or ACT, else group
|
| 80 |
+
# FM-DiT / DP (DiT backbone)
|
| 81 |
+
hidden_dim: int = 384
|
| 82 |
+
num_layers: int = 4
|
| 83 |
+
num_heads: int = 8
|
| 84 |
+
mlp_ratio: float = 4.0
|
| 85 |
+
dropout: float = 0.1
|
| 86 |
+
time_embed_dim: int = 128
|
| 87 |
+
num_inference_steps: int | None = None # None: FM-DiT 10 midpoint steps, DP every training timestep (100)
|
| 88 |
+
# DP noise schedule (diffusers DDPMScheduler)
|
| 89 |
+
num_train_timesteps: int = 100
|
| 90 |
+
beta_schedule: str = 'squaredcos_cap_v2'
|
| 91 |
+
prediction_type: str = 'epsilon'
|
| 92 |
+
clip_sample: bool = True
|
| 93 |
+
# ACT
|
| 94 |
+
act_hidden_dim: int = 512
|
| 95 |
+
dim_feedforward: int = 3200
|
| 96 |
+
enc_layers: int = 4
|
| 97 |
+
dec_layers: int = 7
|
| 98 |
+
nheads: int = 8
|
| 99 |
+
latent_dim: int = 32
|
| 100 |
+
kl_weight: float = 10.0
|
| 101 |
+
# ODE policies (G1 port, configs/g1.yaml head: width 512, 4 FiLM layers, cond 512, field_scale 1). ode_body_dim:
|
| 102 |
+
# the leading action columns integrated as the ODE state, the rest decoded from the condition (G1: the token 64 and
|
| 103 |
+
# the DFX6 12; train.py sets it to the contract's first action group, H2: body_target 31). ODE-DiT: ODE Policy's
|
| 104 |
+
# DiT field, 512 wide, 4 blocks, 8 heads, 4 tokens (ode_dit.yaml).
|
| 105 |
+
ode_body_dim: int | None = None
|
| 106 |
+
ode_width: int = 512
|
| 107 |
+
ode_layers: int = 4
|
| 108 |
+
ode_cond_dim: int = 512
|
| 109 |
+
ode_field_scale: float = 1.0
|
| 110 |
+
ode_dit_hidden: int = 512
|
| 111 |
+
ode_dit_layers: int = 4
|
| 112 |
+
ode_dit_heads: int = 8
|
| 113 |
+
ode_dit_tokens: int = 4
|
| 114 |
+
extra: dict = field(default_factory=dict)
|
| 115 |
+
|
| 116 |
+
def __post_init__(self):
|
| 117 |
+
defaults = POLICY_DEFAULTS.get(self.policy, {})
|
| 118 |
+
if self.horizon is None:
|
| 119 |
+
self.horizon = int(defaults.get('horizon', 16))
|
| 120 |
+
if self.backbone_weights == 'default':
|
| 121 |
+
self.backbone_weights = defaults.get('backbone_weights', 'IMAGENET1K_V1')
|
| 122 |
+
if self.backbone_norm is None:
|
| 123 |
+
self.backbone_norm = 'frozen_bn' if self.backbone_weights or self.policy == 'act' else 'group'
|
| 124 |
+
if self.policy == 'act' and self.backbone_norm != 'frozen_bn':
|
| 125 |
+
raise ValueError("ACT's backbone keeps frozen BatchNorm (backbone_norm 'frozen_bn')")
|
| 126 |
+
|
| 127 |
+
@classmethod
|
| 128 |
+
def from_dict(cls, data: dict) -> PolicyConfig:
|
| 129 |
+
known = {k: v for k, v in data.items() if k in cls.__dataclass_fields__}
|
| 130 |
+
return cls(**known)
|
| 131 |
+
|
| 132 |
+
def to_dict(self) -> dict:
|
| 133 |
+
return asdict(self)
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
class Normalizer(nn.Module):
|
| 137 |
+
"""Per-dimension affine map to [-1, 1] from the training data's min/max (DextraVerse LinearNormalizer, mode
|
| 138 |
+
'limits', fit_offset, range_eps 1e-4): x_n = x * scale + offset; a dimension whose range is below range_eps gets
|
| 139 |
+
scale 1 and maps its value to 0."""
|
| 140 |
+
|
| 141 |
+
def __init__(self, dim: int):
|
| 142 |
+
super().__init__()
|
| 143 |
+
self.register_buffer('scale', torch.ones(dim))
|
| 144 |
+
self.register_buffer('offset', torch.zeros(dim))
|
| 145 |
+
|
| 146 |
+
@torch.no_grad()
|
| 147 |
+
def fit(self, minimum, maximum, range_eps=1e-4):
|
| 148 |
+
lo = torch.as_tensor(minimum, dtype=torch.float32)
|
| 149 |
+
hi = torch.as_tensor(maximum, dtype=torch.float32)
|
| 150 |
+
span = hi - lo
|
| 151 |
+
ignore = span < range_eps
|
| 152 |
+
span[ignore] = 2.0
|
| 153 |
+
scale = 2.0 / span
|
| 154 |
+
offset = -1.0 - scale * lo
|
| 155 |
+
offset[ignore] = -lo[ignore]
|
| 156 |
+
self.scale.copy_(scale)
|
| 157 |
+
self.offset.copy_(offset)
|
| 158 |
+
|
| 159 |
+
def normalize(self, x):
|
| 160 |
+
return x * self.scale + self.offset
|
| 161 |
+
|
| 162 |
+
def unnormalize(self, x):
|
| 163 |
+
return (x - self.offset) / self.scale
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
class BasePolicy(nn.Module):
|
| 167 |
+
name = ''
|
| 168 |
+
backbone_prefix = '' # state-dict prefix of the image backbone (its own learning rate in training)
|
| 169 |
+
lead_rows = 0 # action rows before the observation's frame that a training item carries (ODE: 1, the start)
|
| 170 |
+
|
| 171 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 172 |
+
super().__init__()
|
| 173 |
+
self.cfg = cfg
|
| 174 |
+
self.state_norm = Normalizer(cfg.state_dim)
|
| 175 |
+
self.action_norm = Normalizer(cfg.action_dim)
|
| 176 |
+
|
| 177 |
+
def fit_normalizers(self, stats: dict):
|
| 178 |
+
self.state_norm.fit(stats['state']['min'], stats['state']['max'])
|
| 179 |
+
self.action_norm.fit(stats['action']['min'], stats['action']['max'])
|
| 180 |
+
|
| 181 |
+
@property
|
| 182 |
+
def sampling_steps(self) -> int:
|
| 183 |
+
return 1
|
| 184 |
+
|
| 185 |
+
def compute_loss(self, images, state, action):
|
| 186 |
+
raise NotImplementedError
|
| 187 |
+
|
| 188 |
+
def predict(self, images, state, generator=None):
|
| 189 |
+
raise NotImplementedError
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
class DiTPolicy(BasePolicy):
|
| 193 |
+
"""Shared by FM-DiT and DP: the shared-ResNet image + state encoder and the AdaLN DiT over the action chunk
|
| 194 |
+
(global observation conditioning, DextraVerse obs_as_global_cond)."""
|
| 195 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 196 |
+
|
| 197 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 198 |
+
super().__init__(cfg)
|
| 199 |
+
self.obs_encoder = ImageStateEncoder(cfg.n_cameras, cfg.state_dim, backbone=cfg.backbone,
|
| 200 |
+
weights=init_weights, norm=cfg.backbone_norm)
|
| 201 |
+
self.model = FlowTransformer(input_dim=cfg.action_dim, condition_dim=self.obs_encoder.feature_dim,
|
| 202 |
+
hidden_dim=cfg.hidden_dim, output_dim=cfg.action_dim, num_layers=cfg.num_layers,
|
| 203 |
+
num_heads=cfg.num_heads, mlp_ratio=cfg.mlp_ratio, dropout=cfg.dropout,
|
| 204 |
+
time_embed_dim=cfg.time_embed_dim)
|
| 205 |
+
|
| 206 |
+
def condition(self, images, state):
|
| 207 |
+
return self.obs_encoder(images, self.state_norm.normalize(state))
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
class FMDiTPolicy(DiTPolicy):
|
| 211 |
+
"""Flow-matching DiT (DextraVerse FlowMatchingDiTImagePolicy): x_t = (1 - t) noise + t a, t ~ U(0, 1), the DiT
|
| 212 |
+
regresses the velocity a - noise; sampling integrates t = 0 -> 1 with the midpoint rule."""
|
| 213 |
+
name = 'fm_dit'
|
| 214 |
+
|
| 215 |
+
@property
|
| 216 |
+
def sampling_steps(self) -> int:
|
| 217 |
+
return int(self.cfg.num_inference_steps or 10)
|
| 218 |
+
|
| 219 |
+
def compute_loss(self, images, state, action):
|
| 220 |
+
cond = self.condition(images, state)
|
| 221 |
+
target = self.action_norm.normalize(action)
|
| 222 |
+
noise = torch.randn_like(target)
|
| 223 |
+
t = torch.rand(target.shape[0], device=target.device)
|
| 224 |
+
te = t.view(-1, 1, 1)
|
| 225 |
+
x_t = (1 - te) * noise + te * target
|
| 226 |
+
loss = F.mse_loss(self.model(x_t, t, cond), target - noise)
|
| 227 |
+
return loss, dict(fm=float(loss.detach()))
|
| 228 |
+
|
| 229 |
+
@torch.no_grad()
|
| 230 |
+
def predict(self, images, state, generator=None):
|
| 231 |
+
cond = self.condition(images, state)
|
| 232 |
+
B, steps = images.shape[0], self.sampling_steps
|
| 233 |
+
x = torch.randn((B, self.cfg.horizon, self.cfg.action_dim), device=cond.device, dtype=cond.dtype,
|
| 234 |
+
generator=generator)
|
| 235 |
+
times = torch.linspace(0, 1.0, steps + 1, device=cond.device)
|
| 236 |
+
for i in range(steps):
|
| 237 |
+
t0 = times[i].view(1).expand(B)
|
| 238 |
+
t1 = times[i + 1].view(1).expand(B)
|
| 239 |
+
dt = (t1 - t0).view(-1, 1, 1)
|
| 240 |
+
x_mid = x + self.model(x, t0, cond) * dt / 2
|
| 241 |
+
x = x + dt * self.model(x_mid, t0 + (t1 - t0) / 2, cond)
|
| 242 |
+
return self.action_norm.unnormalize(x), x
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
class DPPolicy(DiTPolicy):
|
| 246 |
+
"""Diffusion Policy with the DiT backbone (DextraVerse DiffusionDiTImagePolicy, ddpm_dit.yaml): DDPM with 100
|
| 247 |
+
training steps, squaredcos_cap_v2 betas, fixed_small variance, clipped samples, epsilon prediction; sampled with
|
| 248 |
+
every training step (100 DiT calls)."""
|
| 249 |
+
name = 'dp'
|
| 250 |
+
|
| 251 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 252 |
+
super().__init__(cfg, init_weights)
|
| 253 |
+
from diffusers.schedulers.scheduling_ddpm import DDPMScheduler
|
| 254 |
+
self.noise_scheduler = DDPMScheduler(num_train_timesteps=cfg.num_train_timesteps, beta_start=0.0001,
|
| 255 |
+
beta_end=0.02, beta_schedule=cfg.beta_schedule,
|
| 256 |
+
variance_type='fixed_small', clip_sample=cfg.clip_sample,
|
| 257 |
+
prediction_type=cfg.prediction_type)
|
| 258 |
+
|
| 259 |
+
@property
|
| 260 |
+
def sampling_steps(self) -> int:
|
| 261 |
+
return int(self.cfg.num_inference_steps or self.cfg.num_train_timesteps)
|
| 262 |
+
|
| 263 |
+
def compute_loss(self, images, state, action):
|
| 264 |
+
cond = self.condition(images, state)
|
| 265 |
+
target = self.action_norm.normalize(action)
|
| 266 |
+
noise = torch.randn_like(target)
|
| 267 |
+
t = torch.randint(0, self.noise_scheduler.config.num_train_timesteps, (target.shape[0],),
|
| 268 |
+
device=target.device).long()
|
| 269 |
+
noisy = self.noise_scheduler.add_noise(target, noise, t)
|
| 270 |
+
pred = self.model(noisy, t, cond)
|
| 271 |
+
goal = noise if self.cfg.prediction_type == 'epsilon' else target
|
| 272 |
+
loss = F.mse_loss(pred, goal)
|
| 273 |
+
return loss, dict(ddpm=float(loss.detach()))
|
| 274 |
+
|
| 275 |
+
@torch.no_grad()
|
| 276 |
+
def predict(self, images, state, generator=None):
|
| 277 |
+
cond = self.condition(images, state)
|
| 278 |
+
scheduler = self.noise_scheduler
|
| 279 |
+
x = torch.randn((images.shape[0], self.cfg.horizon, self.cfg.action_dim), device=cond.device,
|
| 280 |
+
dtype=cond.dtype, generator=generator)
|
| 281 |
+
scheduler.set_timesteps(self.sampling_steps, device=cond.device)
|
| 282 |
+
for t in scheduler.timesteps:
|
| 283 |
+
x = scheduler.step(self.model(x, t.to(cond.device), cond), t, x, generator=generator).prev_sample
|
| 284 |
+
return self.action_norm.unnormalize(x), x
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
class ACTPolicy(BasePolicy):
|
| 288 |
+
"""ACT (DextraVerse ACTImagePolicy, act.yaml): ImageNet-normalized cameras through one ResNet with frozen
|
| 289 |
+
BatchNorm (spatial tokens, no pooling), the normalized state as qpos, a CVAE style encoder over the action chunk in
|
| 290 |
+
training, the DETR decoder with `horizon` queries; loss L1 + kl_weight x KL; inference decodes from the zero
|
| 291 |
+
latent (deterministic)."""
|
| 292 |
+
name = 'act'
|
| 293 |
+
backbone_prefix = 'model.backbone.'
|
| 294 |
+
|
| 295 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 296 |
+
super().__init__(cfg)
|
| 297 |
+
transformer = Transformer(d_model=cfg.act_hidden_dim, nhead=cfg.nheads, num_encoder_layers=cfg.enc_layers,
|
| 298 |
+
num_decoder_layers=cfg.dec_layers, dim_feedforward=cfg.dim_feedforward,
|
| 299 |
+
dropout=cfg.dropout, return_intermediate_dec=False)
|
| 300 |
+
self.model = DETRVAE(build_backbone(cfg.backbone, hidden_dim=cfg.act_hidden_dim, weights=init_weights),
|
| 301 |
+
transformer,
|
| 302 |
+
build_style_encoder(cfg.act_hidden_dim, cfg.nheads, cfg.dim_feedforward, cfg.enc_layers,
|
| 303 |
+
cfg.dropout),
|
| 304 |
+
qpos_dim=cfg.state_dim, action_dim=cfg.action_dim, num_queries=cfg.horizon,
|
| 305 |
+
latent_dim=cfg.latent_dim)
|
| 306 |
+
self.register_buffer('mean', torch.tensor(IMAGENET_MEAN).view(1, 1, 3, 1, 1), persistent=False)
|
| 307 |
+
self.register_buffer('std', torch.tensor(IMAGENET_STD).view(1, 1, 3, 1, 1), persistent=False)
|
| 308 |
+
|
| 309 |
+
def compute_loss(self, images, state, action):
|
| 310 |
+
target = self.action_norm.normalize(action)
|
| 311 |
+
a_hat, (mu, logvar) = self.model(self.state_norm.normalize(state), (images - self.mean) / self.std,
|
| 312 |
+
actions=target)
|
| 313 |
+
l1 = F.l1_loss(a_hat, target)
|
| 314 |
+
kl = kl_divergence(mu, logvar)
|
| 315 |
+
return l1 + self.cfg.kl_weight * kl, dict(l1=float(l1.detach()), kl=float(kl.detach()))
|
| 316 |
+
|
| 317 |
+
@torch.no_grad()
|
| 318 |
+
def predict(self, images, state, generator=None): # noqa: ARG002 - deterministic (zero latent)
|
| 319 |
+
a_hat, _ = self.model(self.state_norm.normalize(state), (images - self.mean) / self.std)
|
| 320 |
+
return self.action_norm.unnormalize(a_hat), a_hat
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
class ODEPolicy(BasePolicy):
|
| 324 |
+
"""ODE policy as ODE Policy's G1 port (`SonicLatentODE`): the body part b of the action row (the first
|
| 325 |
+
ode_body_dim columns; G1 the SONIC motion token 64) is integrated with Euler, one row per unit of time,
|
| 326 |
+
b_{k+1} = b_k + field_scale * f(b_k, s | c), from b_0 = the body row before the chunk; the remaining columns (G1:
|
| 327 |
+
the measured DFX6 12) are decoded from c for every row (linear, SiLU, linear; continuous, no sigmoid). c =
|
| 328 |
+
Linear(LayerNorm(image features)): one ResNet18 per view (ODE Policy's encoder, in place of the G1 port's GR00T
|
| 329 |
+
reader); the state enters the field only, never the condition or the hands.
|
| 330 |
+
|
| 331 |
+
Normalization (the G1 port's): per-dimension q01 / q99 of the training rows to [-1, 1], the UNIT_RANGE columns
|
| 332 |
+
(DFX6) fixed at [0, 1], constant dimensions shifted to 0, clipped to [-5, 5]; the executed body row at inference is
|
| 333 |
+
not clipped (a carried endpoint may leave the interval). Start: training teacher-forces b_0 = the recorded body row
|
| 334 |
+
t-1, the normalized-zero BOS at an episode's first frame; execution starts from the body part of the row executed
|
| 335 |
+
at t-1 (the interface's past_actions[-1]), BOS without one. Loss: masked MSE in normalized units (rows past the
|
| 336 |
+
episode's end left out), body and hands weighted by their widths. The ODE head runs in FP32 (the encoder under the
|
| 337 |
+
caller's autocast). Deterministic; no start perturbation (the G1 port's)."""
|
| 338 |
+
name = 'ode_mlp'
|
| 339 |
+
field_arch = 'mlp'
|
| 340 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 341 |
+
lead_rows = 1
|
| 342 |
+
CLIP = 5.0
|
| 343 |
+
|
| 344 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 345 |
+
super().__init__(cfg)
|
| 346 |
+
if cfg.ode_body_dim is None or not 0 < cfg.ode_body_dim <= cfg.action_dim:
|
| 347 |
+
raise ValueError(f'ode_body_dim must be in 1..{cfg.action_dim}, got {cfg.ode_body_dim}')
|
| 348 |
+
body, hands = cfg.ode_body_dim, cfg.action_dim - cfg.ode_body_dim
|
| 349 |
+
self.obs_encoder = ImageStateEncoder(cfg.n_cameras, 0, backbone=cfg.backbone, weights=init_weights,
|
| 350 |
+
norm=cfg.backbone_norm, shared=False) # images only
|
| 351 |
+
self.context_norm = nn.LayerNorm(self.obs_encoder.feature_dim)
|
| 352 |
+
self.context_proj = nn.Linear(self.obs_encoder.feature_dim, cfg.ode_cond_dim)
|
| 353 |
+
if self.field_arch == 'dit':
|
| 354 |
+
self.field = DiTVectorField(cfg.ode_cond_dim, cfg.state_dim, cfg.ode_dit_hidden, cfg.ode_dit_layers, body,
|
| 355 |
+
body, num_heads=cfg.ode_dit_heads, n_tokens=cfg.ode_dit_tokens)
|
| 356 |
+
else:
|
| 357 |
+
self.field = VectorField(cfg.ode_cond_dim, cfg.state_dim, cfg.ode_width, cfg.ode_layers, body, body)
|
| 358 |
+
self.hand_hidden = nn.Linear(cfg.ode_cond_dim, cfg.ode_cond_dim)
|
| 359 |
+
self.hand_output = nn.Linear(cfg.ode_cond_dim, cfg.horizon * hands) if hands else None
|
| 360 |
+
|
| 361 |
+
def fit_normalizers(self, stats: dict):
|
| 362 |
+
"""The G1 port's bounds: q01 / q99 (from stats, else min / max), the stats' unit_dims fixed at [0, 1]."""
|
| 363 |
+
for key, norm in (('state', self.state_norm), ('action', self.action_norm)):
|
| 364 |
+
entry = stats[key]
|
| 365 |
+
lo = torch.as_tensor(entry.get('q01', entry['min']), dtype=torch.float64).clone()
|
| 366 |
+
hi = torch.as_tensor(entry.get('q99', entry['max']), dtype=torch.float64).clone()
|
| 367 |
+
unit = torch.as_tensor(entry.get('unit_dims', []), dtype=torch.long)
|
| 368 |
+
lo[unit], hi[unit] = 0.0, 1.0
|
| 369 |
+
norm.fit(lo, hi)
|
| 370 |
+
|
| 371 |
+
@property
|
| 372 |
+
def sampling_steps(self) -> int:
|
| 373 |
+
"""Euler steps (field calls) per query."""
|
| 374 |
+
return int(self.cfg.horizon)
|
| 375 |
+
|
| 376 |
+
def features(self, images):
|
| 377 |
+
return self.obs_encoder(images, images.new_zeros(images.shape[0], 0))
|
| 378 |
+
|
| 379 |
+
def head(self, features, s, b0, n_steps):
|
| 380 |
+
"""FP32: (body path (B, n_steps, body), hands (B, n_steps, hands)) in normalized units."""
|
| 381 |
+
cfg = self.cfg
|
| 382 |
+
c = self.context_proj(self.context_norm(features.float()))
|
| 383 |
+
film = self.field.precompute(c) # c is fixed over the chunk
|
| 384 |
+
b, path = b0, []
|
| 385 |
+
for _ in range(n_steps): # Euler, dt = one row
|
| 386 |
+
b = b + cfg.ode_field_scale * self.field(b, s, c, film)
|
| 387 |
+
path.append(b)
|
| 388 |
+
path = torch.stack(path, dim=1)
|
| 389 |
+
hands = cfg.action_dim - cfg.ode_body_dim
|
| 390 |
+
if not hands:
|
| 391 |
+
return path, path[..., :0]
|
| 392 |
+
out = self.hand_output(F.silu(self.hand_hidden(c))).view(c.shape[0], cfg.horizon, hands)
|
| 393 |
+
return path, out[:, :n_steps]
|
| 394 |
+
|
| 395 |
+
def compute_loss(self, images, state, action, valid=None):
|
| 396 |
+
cfg = self.cfg
|
| 397 |
+
H, body = cfg.horizon, cfg.ode_body_dim
|
| 398 |
+
if action.shape[1] != H + 1:
|
| 399 |
+
raise ValueError(f'the ODE policy trains on the row before + {H} rows, got {action.shape[1]} rows')
|
| 400 |
+
valid = torch.ones(action.shape[:2], device=action.device) if valid is None else valid.to(action.device)
|
| 401 |
+
features = self.features(images)
|
| 402 |
+
with torch.autocast(device_type=images.device.type, enabled=False):
|
| 403 |
+
s = self.state_norm.normalize(state.float()).clamp(-self.CLIP, self.CLIP)
|
| 404 |
+
nact = self.action_norm.normalize(action.float()).clamp(-self.CLIP, self.CLIP)
|
| 405 |
+
b0 = nact[:, 0, :body] * valid[:, :1].float() # BOS (normalized zero) at an episode's first frame
|
| 406 |
+
path, hands = self.head(features, s, b0, H)
|
| 407 |
+
target, mask = nact[:, 1:], valid[:, 1:, None].float()
|
| 408 |
+
|
| 409 |
+
def masked(pred, goal):
|
| 410 |
+
m = mask.expand_as(goal)
|
| 411 |
+
return ((pred - goal).square() * m).sum() / m.sum().clamp_min(1)
|
| 412 |
+
|
| 413 |
+
body_loss = masked(path, target[..., :body])
|
| 414 |
+
hand_loss = masked(hands, target[..., body:]) if hands.shape[-1] else body_loss.new_zeros(())
|
| 415 |
+
loss = (body * body_loss + (cfg.action_dim - body) * hand_loss) / cfg.action_dim
|
| 416 |
+
return loss, dict(body=float(body_loss.detach()), hand=float(hand_loss.detach()))
|
| 417 |
+
|
| 418 |
+
@torch.no_grad()
|
| 419 |
+
def predict(self, images, state, generator=None, previous=None, has_previous=None): # noqa: ARG002
|
| 420 |
+
"""previous: (B, action_dim) physical, the row executed at t-1 (its body part is the start); None, or a False
|
| 421 |
+
in has_previous (B,), starts from the BOS."""
|
| 422 |
+
cfg = self.cfg
|
| 423 |
+
features = self.features(images)
|
| 424 |
+
with torch.autocast(device_type=images.device.type, enabled=False):
|
| 425 |
+
s = self.state_norm.normalize(state.float()).clamp(-self.CLIP, self.CLIP)
|
| 426 |
+
b0 = features.new_zeros(images.shape[0], cfg.ode_body_dim, dtype=torch.float32)
|
| 427 |
+
if previous is not None:
|
| 428 |
+
start = self.action_norm.normalize(previous.to(device=images.device, dtype=torch.float32))
|
| 429 |
+
keep = (torch.ones(images.shape[0], device=images.device) if has_previous is None else
|
| 430 |
+
has_previous.to(images.device).float())
|
| 431 |
+
b0 = start[:, :cfg.ode_body_dim] * keep[:, None] # unclipped carry
|
| 432 |
+
path, hands = self.head(features, s, b0, cfg.horizon)
|
| 433 |
+
raw = torch.cat([path, hands], dim=-1)
|
| 434 |
+
return self.action_norm.unnormalize(raw), raw
|
| 435 |
+
|
| 436 |
+
|
| 437 |
+
class ODEDiTPolicy(ODEPolicy):
|
| 438 |
+
"""ODE-DiT: the ODE policy with ODE Policy's DiT (adaLN) vector field (ode_dit.yaml) over [b, s]."""
|
| 439 |
+
name = 'ode_dit'
|
| 440 |
+
field_arch = 'dit'
|
| 441 |
+
|
| 442 |
+
|
| 443 |
+
from .flash import FlashPolicy # noqa: E402 - FLASH (flash.py) builds on this module's Normalizer and nets.py
|
| 444 |
+
from .fm_dit_v2 import FMDiTv2Policy # noqa: E402 - FM-DiT v2 (FLASH-Policy's FM-DiT) builds on flash.py's networks
|
| 445 |
+
|
| 446 |
+
POLICIES = {cls.name: cls for cls in (FMDiTPolicy, DPPolicy, ACTPolicy, FlashPolicy, ODEPolicy, ODEDiTPolicy,
|
| 447 |
+
FMDiTv2Policy)}
|
| 448 |
+
LABELS = {'fm_dit': 'FM-DiT', 'dp': 'DP (DDPM-DiT)', 'act': 'ACT', 'flash': 'FLASH', 'ode_mlp': 'ODE-MLP',
|
| 449 |
+
'ode_dit': 'ODE-DiT', 'fm_dit_v2': 'FM-DiT v2'}
|
| 450 |
+
|
| 451 |
+
|
| 452 |
+
def build_policy(cfg: PolicyConfig | dict, pretrained: bool = True) -> BasePolicy:
|
| 453 |
+
"""The policy of `cfg`; pretrained=True initializes the backbone from cfg.backbone_weights (training),
|
| 454 |
+
False builds the same structure with random weights (a checkpoint load, which must not download anything)."""
|
| 455 |
+
cfg = cfg if isinstance(cfg, PolicyConfig) else PolicyConfig.from_dict(cfg)
|
| 456 |
+
if cfg.policy not in POLICIES:
|
| 457 |
+
raise KeyError(f'unknown baseline {cfg.policy!r}; one of {sorted(POLICIES)}')
|
| 458 |
+
cfg = replace(cfg) # a copy (resolved backbone_norm)
|
| 459 |
+
return POLICIES[cfg.policy](cfg, init_weights=cfg.backbone_weights if pretrained else None)
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.lock.txt
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# pip freeze of the hb-baselines training environment (2026-11-27, Python 3.12.12, NAS
|
| 2 |
+
# preflight-20261104T1648Z/policies-20261109/envs/hb-baselines, used by the A800 trainings). The Aliyun DSW copy
|
| 3 |
+
# /root/.venvs/hb-baselines (Python 3.12.1, pillow 12.3.0) trained the 2026-11-24..26 DSW runs.
|
| 4 |
+
anyio==4.16.0
|
| 5 |
+
av==15.1.0
|
| 6 |
+
certifi==2026.11.20
|
| 7 |
+
charset-normalizer==3.5.3
|
| 8 |
+
click==8.5.1
|
| 9 |
+
diffusers==0.35.1
|
| 10 |
+
filelock==4.3.1
|
| 11 |
+
fsspec==2026.9.0
|
| 12 |
+
h11==0.16.0
|
| 13 |
+
hf-xet==1.8.0
|
| 14 |
+
httpcore2==2.16.2
|
| 15 |
+
httpx2==2.16.2
|
| 16 |
+
huggingface_hub==2.4.0
|
| 17 |
+
idna==3.20
|
| 18 |
+
importlib_metadata==10.2.0
|
| 19 |
+
iniconfig==2.3.1
|
| 20 |
+
Jinja2==3.1.6
|
| 21 |
+
lazy-importer==0.1.0
|
| 22 |
+
MarkupSafe==3.0.4
|
| 23 |
+
mpmath==1.3.0
|
| 24 |
+
networkx==3.7
|
| 25 |
+
numpy==2.2.6
|
| 26 |
+
nvidia-cublas-cu12==12.8.4.1
|
| 27 |
+
nvidia-cuda-cupti-cu12==12.8.90
|
| 28 |
+
nvidia-cuda-nvrtc-cu12==12.8.93
|
| 29 |
+
nvidia-cuda-runtime-cu12==12.8.90
|
| 30 |
+
nvidia-cudnn-cu12==9.10.2.21
|
| 31 |
+
nvidia-cufft-cu12==11.3.3.83
|
| 32 |
+
nvidia-cufile-cu12==1.13.1.3
|
| 33 |
+
nvidia-curand-cu12==10.3.9.90
|
| 34 |
+
nvidia-cusolver-cu12==11.7.3.90
|
| 35 |
+
nvidia-cusparse-cu12==12.5.8.93
|
| 36 |
+
nvidia-cusparselt-cu12==0.7.1
|
| 37 |
+
nvidia-nccl-cu12==2.27.5
|
| 38 |
+
nvidia-nvjitlink-cu12==12.8.93
|
| 39 |
+
nvidia-nvshmem-cu12==3.3.20
|
| 40 |
+
nvidia-nvtx-cu12==12.8.90
|
| 41 |
+
opencv-python-headless==4.11.0.86
|
| 42 |
+
packaging==26.4
|
| 43 |
+
pillow==13.0.0
|
| 44 |
+
pluggy==1.7.0
|
| 45 |
+
pyarrow==23.0.1
|
| 46 |
+
Pygments==2.21.0
|
| 47 |
+
pytest==8.4.2
|
| 48 |
+
PyYAML==6.0.4
|
| 49 |
+
regex==2026.11.19
|
| 50 |
+
requests==2.34.2
|
| 51 |
+
safetensors==0.8.0
|
| 52 |
+
setuptools==84.2.1
|
| 53 |
+
sympy==1.14.0
|
| 54 |
+
torch==2.9.0+cu128
|
| 55 |
+
torchvision==0.24.0+cu128
|
| 56 |
+
tqdm==4.70.1
|
| 57 |
+
triton==3.5.0
|
| 58 |
+
truststore==0.10.5
|
| 59 |
+
typing_extensions==4.16.0
|
| 60 |
+
urllib3==2.8.0
|
| 61 |
+
zipp==4.1.2
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.txt
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Environment of the FM-DiT / DP / ACT baselines (training and the policy server), Python 3.12, CUDA 12.8 wheels:
|
| 2 |
+
# uv venv <env> --python 3.12
|
| 3 |
+
# uv pip install --python <env>/bin/python -r evaluation/baselines/requirements.txt \
|
| 4 |
+
# --extra-index-url https://download.pytorch.org/whl/cu128 --index-strategy unsafe-best-match
|
| 5 |
+
# The full pinned set of the training environment (the A800 / NAS env, Python 3.12.12): requirements.lock.txt
|
| 6 |
+
# (HumanWAM hb_training/envs/hb-baselines.txt). Each run records its versions in config.json training.environment.
|
| 7 |
+
torch==2.9.0+cu128
|
| 8 |
+
torchvision==0.24.0+cu128
|
| 9 |
+
diffusers==0.35.1
|
| 10 |
+
av==15.1.0
|
| 11 |
+
pyarrow==23.0.1
|
| 12 |
+
numpy==2.2.6
|
| 13 |
+
opencv-python-headless==4.11.0.86
|
| 14 |
+
pytest==8.4.2
|
| 15 |
+
pillow==13.0.0 # the JPEG effect of the augmentation spec v2 depends on it (owner 2026-11-27: pin every version that changes the numerics)
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/runtime.py
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Checkpoints and inference of the baselines.
|
| 2 |
+
|
| 3 |
+
A checkpoint is a directory written by train.py (`<run>/checkpoints/step-NNNNNN/`, `final` links the last one):
|
| 4 |
+
|
| 5 |
+
- `model.pt`: torch.save of {format, config (the config.json text), state_dict}: the EMA weights (or the raw ones when
|
| 6 |
+
EMA is off) with the policy's state and action normalizers, loaded strictly with `weights_only=True`;
|
| 7 |
+
- `config.json`: the policy configuration, the contract (robot, cameras, state and action columns), the image size,
|
| 8 |
+
the training task text, dataset, episodes, recipe and statistics;
|
| 9 |
+
- `protocol.json`: model.pt's size and SHA-256.
|
| 10 |
+
|
| 11 |
+
`BaselinePolicy.predict` takes the live frames of the checkpoint's cameras (any size; resized with data.resize_frame,
|
| 12 |
+
as the training cache), the physical state of the contract, a seed and, for a policy that starts from it (the ODE
|
| 13 |
+
policies, `uses_previous`), the action row executed at the frame before; it returns the physical (horizon,
|
| 14 |
+
action_dim) chunk with its normalized form; row 0 is the action of the observation's frame.
|
| 15 |
+
"""
|
| 16 |
+
from __future__ import annotations
|
| 17 |
+
|
| 18 |
+
import hashlib
|
| 19 |
+
import json
|
| 20 |
+
from pathlib import Path
|
| 21 |
+
|
| 22 |
+
import numpy as np
|
| 23 |
+
|
| 24 |
+
FORMAT = 'hb_baselines/1'
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def sha256(path) -> str:
|
| 28 |
+
digest = hashlib.sha256()
|
| 29 |
+
with Path(path).open('rb') as stream:
|
| 30 |
+
for block in iter(lambda: stream.read(16 << 20), b''):
|
| 31 |
+
digest.update(block)
|
| 32 |
+
return digest.hexdigest()
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def save_checkpoint(folder, policy, config: dict):
|
| 36 |
+
"""Write model.pt, config.json and protocol.json of `policy` (an nn.Module) into `folder`."""
|
| 37 |
+
import torch
|
| 38 |
+
folder = Path(folder)
|
| 39 |
+
folder.mkdir(parents=True, exist_ok=True)
|
| 40 |
+
text = json.dumps(dict(config, format=FORMAT), indent=1)
|
| 41 |
+
state = {k: v.detach().cpu().contiguous() for k, v in policy.state_dict().items()}
|
| 42 |
+
torch.save(dict(format=FORMAT, config=text, state_dict=state), folder / 'model.pt.tmp')
|
| 43 |
+
(folder / 'model.pt.tmp').replace(folder / 'model.pt')
|
| 44 |
+
(folder / 'config.json').write_text(text)
|
| 45 |
+
tr, ds = config.get('training') or {}, config.get('dataset') or {}
|
| 46 |
+
# HumanWAM hb_training/REPRODUCIBILITY.md section 8 (2026-11-27): what the checkpoint is, beside config.json
|
| 47 |
+
summary = dict(task=config.get('task'), dataset_id=config.get('dataset_id'),
|
| 48 |
+
episodes=len(ds.get('train_episodes') or []), frames=ds.get('train_frames'), fps=ds.get('fps'),
|
| 49 |
+
steps=tr.get('steps'), total_steps=tr.get('total_steps'), save_steps=tr.get('save_steps'),
|
| 50 |
+
global_batch=tr.get('batch_size'), per_gpu_batch=tr.get('batch_size'), num_gpus=1,
|
| 51 |
+
gradient_accumulation_steps=1, lr=tr.get('lr'), warmup=tr.get('warmup'),
|
| 52 |
+
schedule=tr.get('schedule'), seed=tr.get('seed'), aug_seed=tr.get('aug_seed'),
|
| 53 |
+
code_commit=config.get('code_commit'), code_dirty=tr.get('code_dirty'),
|
| 54 |
+
environment=tr.get('environment'), continuation=tr.get('continuation'),
|
| 55 |
+
protocol_deviations=tr.get('protocol_deviations'), protocol_exceptions=tr.get('protocol_exceptions'))
|
| 56 |
+
(folder / 'protocol.json').write_text(json.dumps(dict(
|
| 57 |
+
format=FORMAT, step=config.get('step'), policy=config['policy']['policy'], **summary,
|
| 58 |
+
files={'model.pt': dict(bytes=(folder / 'model.pt').stat().st_size, sha256=sha256(folder / 'model.pt'))}),
|
| 59 |
+
indent=1, default=str))
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def load_checkpoint(folder, device='cpu', verify=True):
|
| 63 |
+
"""(policy in eval mode on `device`, config dict) of a checkpoint directory."""
|
| 64 |
+
import torch
|
| 65 |
+
from .policies import build_policy
|
| 66 |
+
folder = Path(folder)
|
| 67 |
+
if verify:
|
| 68 |
+
protocol = json.loads((folder / 'protocol.json').read_text())
|
| 69 |
+
entry = protocol['files']['model.pt']
|
| 70 |
+
if (folder / 'model.pt').stat().st_size != entry['bytes']:
|
| 71 |
+
raise ValueError(f'{folder}/model.pt differs from protocol.json')
|
| 72 |
+
payload = torch.load(folder / 'model.pt', map_location='cpu', weights_only=True)
|
| 73 |
+
if payload.get('format') != FORMAT:
|
| 74 |
+
raise ValueError(f"{folder}: format {payload.get('format')!r}, expected {FORMAT}")
|
| 75 |
+
config = json.loads(payload['config'])
|
| 76 |
+
if json.loads((folder / 'config.json').read_text()) != config:
|
| 77 |
+
raise ValueError(f'{folder}: config.json differs from the one inside model.pt')
|
| 78 |
+
policy = build_policy(config['policy'], pretrained=False) # every weight comes from model.pt
|
| 79 |
+
policy.load_state_dict(payload['state_dict'], strict=True)
|
| 80 |
+
return policy.to(device).eval(), config
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
class BaselinePolicy:
|
| 84 |
+
"""A loaded checkpoint for closed-loop inference (one request at a time)."""
|
| 85 |
+
|
| 86 |
+
def __init__(self, checkpoint, device='cuda:0', policy: str | None = None, robot: str | None = None):
|
| 87 |
+
import torch
|
| 88 |
+
self.torch = torch
|
| 89 |
+
self.device = torch.device(device)
|
| 90 |
+
self.model, self.config = load_checkpoint(checkpoint, device=self.device)
|
| 91 |
+
self.checkpoint = str(Path(checkpoint).resolve())
|
| 92 |
+
name, contract = self.config['policy']['policy'], self.config['contract']
|
| 93 |
+
if policy is not None and name != policy:
|
| 94 |
+
raise ValueError(f'{checkpoint} is a {name!r} checkpoint, not {policy!r}')
|
| 95 |
+
if robot is not None and contract['robot'] != robot:
|
| 96 |
+
raise ValueError(f"{checkpoint} was trained for {contract['robot']!r} ({contract['name']}), not {robot!r}")
|
| 97 |
+
self.name, self.contract = name, contract
|
| 98 |
+
self.cameras = tuple(contract['cameras'])
|
| 99 |
+
self.image_hw = tuple(self.config['image_hw'])
|
| 100 |
+
self.horizon = int(self.config['policy']['horizon'])
|
| 101 |
+
self.state_dim, self.action_dim = int(contract['state_dim']), int(contract['action_dim'])
|
| 102 |
+
self.sampling_steps = int(self.model.sampling_steps)
|
| 103 |
+
self.task_text = self.config.get('task_text')
|
| 104 |
+
self.uses_previous = bool(getattr(self.model, 'lead_rows', 0))
|
| 105 |
+
|
| 106 |
+
def info(self) -> dict:
|
| 107 |
+
out = dict(model=self.name, checkpoint=self.checkpoint, step=self.config.get('step'),
|
| 108 |
+
contract=self.contract['name'], views=list(self.cameras), image_hw=list(self.image_hw),
|
| 109 |
+
action_chunk=self.horizon, action_dim=self.action_dim, state_dim=self.state_dim,
|
| 110 |
+
sampling_steps=self.sampling_steps, task_text=self.task_text,
|
| 111 |
+
training_data=self.config.get('dataset', {}).get('name'))
|
| 112 |
+
if self.name == 'flash':
|
| 113 |
+
out['flash'] = dict(self.model.flash, history_rows=self.model.history_span)
|
| 114 |
+
if self.uses_previous:
|
| 115 |
+
out['starts_from'] = 'the body part of the row executed at t-1, else the normalized-zero BOS'
|
| 116 |
+
return out
|
| 117 |
+
|
| 118 |
+
def history(self, past_actions, history_valid):
|
| 119 |
+
"""FLASH: (history (1, n_history, Da), has_history (1,)) tensors from the executed rows before the query
|
| 120 |
+
(past_actions (N, Da) oldest first, row N-1 = frame t-1; history_valid (N,) a contiguous valid suffix)."""
|
| 121 |
+
from .flash import history_rows
|
| 122 |
+
torch, span = self.torch, self.model.history_span
|
| 123 |
+
rows = np.asarray(past_actions, np.float32)
|
| 124 |
+
valid = np.asarray(history_valid, np.float32).reshape(-1) > 0.5
|
| 125 |
+
if rows.ndim != 2 or rows.shape[1] != self.action_dim or len(valid) != len(rows):
|
| 126 |
+
raise ValueError(f'past_actions {rows.shape} / history_valid {valid.shape}: '
|
| 127 |
+
f'expected (N, {self.action_dim})')
|
| 128 |
+
if len(rows) < span: # fewer rows than the history reaches back: the missing older rows are invalid
|
| 129 |
+
pad = span - len(rows)
|
| 130 |
+
rows = np.concatenate([np.zeros((pad, rows.shape[1]), np.float32), rows])
|
| 131 |
+
valid = np.concatenate([np.zeros(pad, bool), valid])
|
| 132 |
+
hist, has = history_rows(rows[-span:], valid[-span:], self.model.stride, self.model.n_history)
|
| 133 |
+
return (torch.from_numpy(hist)[None].to(self.device),
|
| 134 |
+
torch.tensor([bool(has)], device=self.device))
|
| 135 |
+
|
| 136 |
+
def images_tensor(self, images: dict):
|
| 137 |
+
from .data import resize_frame
|
| 138 |
+
missing = [c for c in self.cameras if c not in images]
|
| 139 |
+
if missing:
|
| 140 |
+
raise KeyError(f'missing cameras {missing}; the checkpoint reads {list(self.cameras)}')
|
| 141 |
+
frames = np.stack([resize_frame(np.asarray(images[c]), self.image_hw) for c in self.cameras])
|
| 142 |
+
x = self.torch.from_numpy(frames).to(self.device).permute(0, 3, 1, 2).float().div_(255.)
|
| 143 |
+
return x.unsqueeze(0) # (1, n_cameras, 3, h, w)
|
| 144 |
+
|
| 145 |
+
def predict(self, images: dict, state, seed: int = 0, previous=None, past_actions=None, history_valid=None):
|
| 146 |
+
"""(action (horizon, action_dim) float32 physical, normalized form (FLASH: the polynomial coefficients)).
|
| 147 |
+
The ODE policies (`uses_previous`) start from `previous`, the physical action row executed at the frame before
|
| 148 |
+
(else the last row of past_actions when history_valid marks it; with neither, their BOS). FLASH needs
|
| 149 |
+
past_actions / history_valid (the interface's executed rows before the query). The others ignore all three."""
|
| 150 |
+
torch = self.torch
|
| 151 |
+
state = np.asarray(state, np.float32).reshape(-1)
|
| 152 |
+
if state.shape != (self.state_dim,) or not np.isfinite(state).all():
|
| 153 |
+
raise ValueError(f'expected a finite state of {self.state_dim} values, got {state.shape}')
|
| 154 |
+
args, kwargs = (), {}
|
| 155 |
+
if self.uses_previous:
|
| 156 |
+
if previous is None and past_actions is not None and history_valid is not None:
|
| 157 |
+
valid = np.asarray(history_valid, np.float32).reshape(-1)
|
| 158 |
+
if len(valid) and valid[-1] > 0.5:
|
| 159 |
+
previous = np.asarray(past_actions, np.float32)[-1]
|
| 160 |
+
if previous is not None:
|
| 161 |
+
previous = np.asarray(previous, np.float32).reshape(-1)
|
| 162 |
+
if previous.shape != (self.action_dim,) or not np.isfinite(previous).all():
|
| 163 |
+
raise ValueError(f'expected a finite previous action row of {self.action_dim} values, '
|
| 164 |
+
f'got {previous.shape}')
|
| 165 |
+
kwargs['previous'] = torch.from_numpy(previous)[None].to(self.device)
|
| 166 |
+
if self.name == 'flash':
|
| 167 |
+
if past_actions is None or history_valid is None:
|
| 168 |
+
raise ValueError('FLASH needs past_actions and history_valid (the executed rows before the query)')
|
| 169 |
+
args = self.history(past_actions, history_valid)
|
| 170 |
+
generator = torch.Generator(device=self.device)
|
| 171 |
+
generator.manual_seed(int(seed) % (2 ** 63 - 1))
|
| 172 |
+
with torch.inference_mode():
|
| 173 |
+
action, raw = self.model.predict(self.images_tensor(images),
|
| 174 |
+
torch.from_numpy(state)[None].to(self.device), *args,
|
| 175 |
+
generator=generator, **kwargs)
|
| 176 |
+
action = action[0].float().cpu().numpy()
|
| 177 |
+
if action.shape != (self.horizon, self.action_dim) or not np.isfinite(action).all():
|
| 178 |
+
raise ValueError(f'invalid prediction {action.shape}')
|
| 179 |
+
return np.ascontiguousarray(action, np.float32), raw[0].float().cpu().numpy().astype(np.float32)
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/baselines/train.py
ADDED
|
@@ -0,0 +1,923 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Train an FM-DiT, DP (DDPM-DiT), ACT, FLASH, ODE-MLP or ODE-DiT baseline on a task's LeRobot v2.1 expert dataset.
|
| 2 |
+
|
| 3 |
+
<baselines env>/bin/python -I evaluation/baselines/train.py --policy fm_dit --contract h2_sharpa \\
|
| 4 |
+
--dataset data/h2_pour_water/h2_pour_water_r1/lerobot --out <run dir> --steps 60000
|
| 5 |
+
|
| 6 |
+
The recipe is DextraVerse's shared IL recipe (configs/algorithm/il/train.yaml; runners/train_dex_flow_matching.py):
|
| 7 |
+
AdamW (lr 1e-4, betas 0.95/0.999, weight decay 1e-6), cosine decay (here after a 500-step linear warm-up, as
|
| 8 |
+
Diffusion Policy), whole-policy EMA (Diffusion Policy's warm-up schedule, max decay 0.9999) whose weights are the
|
| 9 |
+
saved checkpoint, batch 64, one observation frame and 16-row chunks. Added for the humanoid views: frames resized
|
| 10 |
+
to 168x224 (the 480x640 aspect). bf16 autocast on CUDA.
|
| 11 |
+
|
| 12 |
+
FM-DiT v2 (--policy fm_dit_v2, evaluation/baselines/fm_dit_v2.py; owner 2026-11-25) is FLASH-Policy's own FM-DiT:
|
| 13 |
+
fm_dit.yaml's networks and the FLASH recipe below (FM_DIT_V2_TRAINING), on the plain 16-row chunks of every baseline;
|
| 14 |
+
it requires the in-training MSE as FLASH does. `--policy fm_dit` (v1, DextraVerse's) is unchanged.
|
| 15 |
+
|
| 16 |
+
FLASH (--policy flash, evaluation/baselines/flash.py) keeps its upstream recipe (FLASH-Policy f47e490,
|
| 17 |
+
default_train.yaml + flash.yaml) where the defaults differ: seed 42 (upstream's; the protocol keeps each model's
|
| 18 |
+
official seed), ResNet18 from scratch with GroupNorm trained at the full learning rate (--backbone-weights none,
|
| 19 |
+
--backbone-lr-scale 1), diffusers' cosine schedule with a 500-step warm-up, Diffusion Policy's EMAModel decay as
|
| 20 |
+
upstream counts it, and its own items (FlashChunkDataset: the polynomial targets at the sampling stride, the executed
|
| 21 |
+
history). --flash KEY=VALUE changes a FLASH setting (flash.FLASH_DEFAULTS: stride, n_history, ...). Its augmentation
|
| 22 |
+
stream is seeded from the training seed, as every model's (ChunkDataset aug_seed; logged as HB_AUG_SEED=<seed>).
|
| 23 |
+
|
| 24 |
+
ODE-MLP / ODE-DiT (--policy ode_mlp / ode_dit, policies.ODEPolicy) keep their G1 port's choices
|
| 25 |
+
(policies.POLICY_DEFAULTS): 16-row chunks, the ODE head in FP32, their own normalization bounds (q01 / q99 of the
|
| 26 |
+
training rows, the DFX6 hands fixed at [0, 1]: stats q01 / q99 / unit_dims), the body part = the contract's first
|
| 27 |
+
action group, the encoder from scratch at the full learning rate, seed 42 (ODE Policy's default_train.yaml, whose
|
| 28 |
+
optimizer, schedule and EMA are the recipe above). Their items carry the row before t and the rows' validity
|
| 29 |
+
(ChunkDataset lead 1).
|
| 30 |
+
|
| 31 |
+
Augmentation (2026-11-16): the Humanoid Benchmark spec v2 (docs/augmentation_v2.md, evaluation/augmentation), the
|
| 32 |
+
same for every model of the benchmark, is on by default (--augmentation hb-v2): per training item one hb_aug_v2 call
|
| 33 |
+
on the cached 168x224 frames of all cameras (colour shared, geometry / light patches / white balance per camera, one
|
| 34 |
+
of the 15 effects boosted 1.5 x) and the per-sample joint bias (+-2 deg) + noise (0.25 deg, clipped 3 sigma) on the
|
| 35 |
+
body joint angles of the raw state (G1 29, H2 31), before the policy's normalizers; actions untouched. The native
|
| 36 |
+
random shift is off (--shift 0; a shift with hb-v2 is refused). Before the first step a preflight reads training items
|
| 37 |
+
through the augmented and the plain path and checks the state width (G1 44 / H2 78, no velocity), that only the body
|
| 38 |
+
joints move and by at most 2.75 deg, that the action rows (and FLASH's history) are bit-identical, that the images
|
| 39 |
+
change, and that the offline-check items are deterministic; it is stored in run.json (--preflight-only stops after it).
|
| 40 |
+
--augmentation none is an explicit exception to the spec, recorded in run.json and the checkpoints. The ResNet18
|
| 41 |
+
starts from torchvision's ImageNet-1k weights (--backbone-weights IMAGENET1K_V1, downloaded once to the torch hub
|
| 42 |
+
cache) and is fine-tuned at 0.1 x the learning rate (--backbone-lr-scale, the DETR practice) with its BatchNorm
|
| 43 |
+
frozen; --backbone-weights none trains it from scratch (DextraVerse's GroupNorm encoder for FM-DiT and DP).
|
| 44 |
+
|
| 45 |
+
In-training MSE (owner 2026-11-22, HumanWAM hb_training/REPRODUCIBILITY.md section 6): --inloop-task <key> with
|
| 46 |
+
--inloop-code <HumanWAM hb_training/eval-action-mse> evaluates the saved (EMA) weights every HB_INLOOP_EVERY (250)
|
| 47 |
+
steps on the protocol's cached episodes (inloop.py) into <out>/logs/inloop-mse.jsonl. FLASH refuses to train without
|
| 48 |
+
it unless --allow-no-inloop (an exception to the protocol, recorded in run.json); so do the ODE policies.
|
| 49 |
+
|
| 50 |
+
Writes into --out: run.json (arguments), train_log.jsonl, checkpoints/step-NNNNNN/ at the save points (runtime.py
|
| 51 |
+
format; owner 2026-11-27, every small model: 6 checkpoints spread evenly over the run's steps, each rounded to the
|
| 52 |
+
in-training MSE's 250-step grid, the last one at the end; save_points()), checkpoints/final -> the last one, and
|
| 53 |
+
train_state.pt (optimizer, schedule, EMA, step) that
|
| 54 |
+
--resume continues from (an interrupted run: the same schedule, not a continuation). Each save also measures the EMA
|
| 55 |
+
policy offline on fixed frames (held-out episodes with --val-episodes, else training frames): normalized-action MSE
|
| 56 |
+
overall and per action group.
|
| 57 |
+
|
| 58 |
+
Protocol and reproducibility (owner 2026-11-27, aligned with HumanWAM hb_training/protocol.yaml): the batch, steps
|
| 59 |
+
(long tasks x2), warm-up, workers and seed default to the protocol recipe of the policy (PROTOCOL_RECIPES); another
|
| 60 |
+
value, --save-every, a dataset not at 30 Hz or training without the in-training MSE (now required for every model) is
|
| 61 |
+
refused unless --protocol-exception / --allow-no-inloop records the owner's decision; uncommitted changes under
|
| 62 |
+
evaluation/ are refused unless --allow-dirty-tree. The order is EpochSampler's (epoch e: default_rng([seed, 1, e])),
|
| 63 |
+
each item augmented with default_rng([aug_seed, draw]) (its position in the run's stream), so worker count and an
|
| 64 |
+
interruption change nothing: train_state.pt keeps the torch / CUDA / numpy / python random states and --resume
|
| 65 |
+
continues bit-exactly. config.json and each protocol.json record the task, the dataset id (--dataset-id REPO@COMMIT
|
| 66 |
+
or inferred from <name>-<commit>/data), the save points, the environment (Python, torch, torchvision, numpy, Pillow,
|
| 67 |
+
CUDA, cuDNN, GPU, driver), the sha256 of hb_aug_v2.py and of the in-training MSE code, and the deviations.
|
| 68 |
+
|
| 69 |
+
Continuation (owner 2026-11-27, HumanWAM hb_training/protocol.yaml interface.continuation, as FastWAM's
|
| 70 |
+
hb_fastwam_cont.py): --init-from <run>/checkpoints/step-NNNNNN into a new --out loads that run's weights only (raw policy
|
| 71 |
+
and EMA from its train_state.pt when written at that step, else the saved EMA weights for both), then trains --steps
|
| 72 |
+
more steps with a fresh AdamW and schedule: peak --lr = 0.3 x the original peak (a peak equal to or above it is
|
| 73 |
+
refused), --warmup = 5 % of --steps, then the policy's cosine. Same policy configuration, data, augmentation and seed
|
| 74 |
+
(checked). Checkpoints are named by the total step (e.g. a 12000-step run continued 2000 steps saves step-014000);
|
| 75 |
+
train_log, in-training MSE and the EMA decay also count the total steps; config.json training.continuation records
|
| 76 |
+
the source checkpoint (path, step, model.pt sha256, code commit) and the continuation's learning rate.
|
| 77 |
+
"""
|
| 78 |
+
from __future__ import annotations
|
| 79 |
+
|
| 80 |
+
import argparse
|
| 81 |
+
import copy
|
| 82 |
+
from datetime import datetime, timezone
|
| 83 |
+
import json
|
| 84 |
+
import math
|
| 85 |
+
import os
|
| 86 |
+
from pathlib import Path
|
| 87 |
+
import subprocess
|
| 88 |
+
import sys
|
| 89 |
+
import time
|
| 90 |
+
|
| 91 |
+
import numpy as np
|
| 92 |
+
|
| 93 |
+
HERE = Path(__file__).resolve().parent
|
| 94 |
+
REPO = HERE.parents[1]
|
| 95 |
+
if str(HERE.parent) not in sys.path:
|
| 96 |
+
sys.path.insert(0, str(HERE.parent))
|
| 97 |
+
|
| 98 |
+
from baselines.data import (CONTRACTS, ChunkDataset, FlashChunkDataset, LeRobotDataset, # noqa: E402
|
| 99 |
+
augmentation_module, frame_cache, load_lowdim, parse_episodes, statistics,
|
| 100 |
+
unit_range_dims)
|
| 101 |
+
from baselines.flash import FLASH_DEFAULTS, FLASH_POLICY_FIELDS # noqa: E402
|
| 102 |
+
from baselines.fm_dit_v2 import FM_DIT_V2_POLICY_FIELDS, UPSTREAM as FM_DIT_V2_UPSTREAM # noqa: E402
|
| 103 |
+
from baselines.policies import ODE_POLICIES, POLICIES, POLICY_DEFAULTS, PolicyConfig, build_policy # noqa: E402
|
| 104 |
+
from baselines.runtime import save_checkpoint # noqa: E402
|
| 105 |
+
|
| 106 |
+
DEFAULTS = dict(lr=1e-4, betas=(0.95, 0.999), weight_decay=1e-6, warmup=500, ema=0.9999, batch_size=64,
|
| 107 |
+
horizon=16, backbone_weights='IMAGENET1K_V1', backbone_lr_scale=0.1, seed=0, amp=True)
|
| 108 |
+
# FLASH-Policy f47e490 default_train.yaml / flash.yaml where they differ from DEFAULTS
|
| 109 |
+
FLASH_TRAINING = dict(seed=42, backbone_weights=None, backbone_lr_scale=1.0, schedule='diffusers_cosine',
|
| 110 |
+
ema_schedule='diffusion_policy_emamodel')
|
| 111 |
+
# FM-DiT v2 (fm_dit_v2.py): FLASH-Policy's FM-DiT trains with the same default_train.yaml
|
| 112 |
+
FM_DIT_V2_TRAINING = dict(FLASH_TRAINING)
|
| 113 |
+
# HumanWAM hb_training/protocol.yaml models.* (owner 2026-11-27: hb_baselines trains exactly the protocol's recipe; any
|
| 114 |
+
# other value is refused unless --protocol-exception records the owner's decision): the global batch (1 GPU), the
|
| 115 |
+
# steps of a training from scratch (long tasks x LONG_TASKS), the warm-up and the DataLoader workers. FM-DiT v1 and DP
|
| 116 |
+
# have no registered recipe (the collaborator's; FM-DiT v1 is superseded by v2): only the batch is checked for them.
|
| 117 |
+
PROTOCOL_RECIPES = {
|
| 118 |
+
'act': dict(batch_size=512, steps=4000, warmup=200, workers=32),
|
| 119 |
+
'flash': dict(batch_size=512, steps=12000, warmup=500, workers=40),
|
| 120 |
+
'fm_dit_v2': dict(batch_size=512, steps=12000, warmup=500, workers=32),
|
| 121 |
+
'ode_mlp': dict(batch_size=512, steps=5000, warmup=500, workers=32),
|
| 122 |
+
'ode_dit': dict(batch_size=512, steps=5000, warmup=500, workers=32),
|
| 123 |
+
'fm_dit': dict(batch_size=512),
|
| 124 |
+
'dp': dict(batch_size=512),
|
| 125 |
+
}
|
| 126 |
+
LONG_TASKS = {'c6': 2} # protocol.yaml interface.long_task_step_factor (A14 is not doubled)
|
| 127 |
+
DATASET_FPS = 30 # every dataset, training and evaluation (owner 2026-11-26)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def training_defaults(policy: str) -> dict:
|
| 131 |
+
"""DEFAULTS with the policy's own: FLASH_TRAINING (flash), FM_DIT_V2_TRAINING (fm_dit_v2),
|
| 132 |
+
policies.POLICY_DEFAULTS (the ODE policies)."""
|
| 133 |
+
# FM-DiT v1: seed 42 for every training from 2026-11-27 (owner: one seed per model, kept on every training;
|
| 134 |
+
# FM-DiT uses 42 as fm_dit_v2 / FLASH; its published seed-0 folders stay as recorded)
|
| 135 |
+
own = {'flash': FLASH_TRAINING, 'fm_dit_v2': FM_DIT_V2_TRAINING, 'fm_dit': dict(seed=42)}.get(policy, {})
|
| 136 |
+
return dict(DEFAULTS, **own, **POLICY_DEFAULTS.get(policy, {}))
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
def policy_default(policy: str, key: str):
|
| 140 |
+
"""The training default of `key` for `policy`."""
|
| 141 |
+
return training_defaults(policy)[key]
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
def same_policy_config(saved: dict, current: dict) -> bool:
|
| 145 |
+
"""A saved policy configuration matches the current one; a field added to PolicyConfig after the save (absent
|
| 146 |
+
from it) matches when the current value is that field's default (e.g. the ode_* fields for an older FM-DiT run)."""
|
| 147 |
+
from dataclasses import MISSING, fields
|
| 148 |
+
defaults = {f.name: f.default for f in fields(PolicyConfig) if f.default is not MISSING}
|
| 149 |
+
return all(saved[k] == v if k in saved else (k in defaults and defaults[k] == v) for k, v in current.items()) \
|
| 150 |
+
and set(saved) <= set(current)
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
def git_commit():
|
| 154 |
+
"""The code's commit: git HEAD, or outside a checkout (a tree copied file by file, e.g. onto the A800 NAS, which
|
| 155 |
+
cannot reach the private repository) the commit in <repo>/HB_CODE_COMMIT that the copier wrote and checked."""
|
| 156 |
+
try:
|
| 157 |
+
return subprocess.run(['git', '-C', str(REPO), 'rev-parse', 'HEAD'], capture_output=True, text=True,
|
| 158 |
+
check=True).stdout.strip()
|
| 159 |
+
except Exception: # noqa: BLE001 - outside a checkout
|
| 160 |
+
import re
|
| 161 |
+
try:
|
| 162 |
+
m = re.search(r'\b[0-9a-f]{7,40}\b', (REPO / 'HB_CODE_COMMIT').read_text())
|
| 163 |
+
except OSError:
|
| 164 |
+
return None
|
| 165 |
+
return m.group(0) if m else None
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
def git_dirty():
|
| 169 |
+
"""The uncommitted changes of the code a run trains with (evaluation/), [] when clean, None outside a checkout:
|
| 170 |
+
the recorded code_commit is that code only when the tree is clean."""
|
| 171 |
+
try:
|
| 172 |
+
out = subprocess.run(['git', '-C', str(REPO), 'status', '--porcelain', '--', 'evaluation'],
|
| 173 |
+
capture_output=True, text=True, check=True).stdout
|
| 174 |
+
except Exception: # noqa: BLE001 - outside a checkout
|
| 175 |
+
return None
|
| 176 |
+
return [line[3:] for line in out.splitlines() if line.strip()]
|
| 177 |
+
|
| 178 |
+
|
| 179 |
+
def file_sha256(path):
|
| 180 |
+
import hashlib
|
| 181 |
+
try:
|
| 182 |
+
return hashlib.sha256(Path(path).read_bytes()).hexdigest()
|
| 183 |
+
except OSError:
|
| 184 |
+
return None
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
def environment(device):
|
| 188 |
+
"""The versions that change the numerics (REPRODUCIBILITY.md principle 5): Python, torch, torchvision, numpy,
|
| 189 |
+
Pillow (the JPEG effect of the augmentation), CUDA, cuDNN, the GPU and its driver."""
|
| 190 |
+
import platform
|
| 191 |
+
import torch
|
| 192 |
+
env = dict(python=platform.python_version(), torch=torch.__version__, numpy=np.__version__,
|
| 193 |
+
cuda=torch.version.cuda,
|
| 194 |
+
cudnn=torch.backends.cudnn.version() if torch.backends.cudnn.is_available() else None)
|
| 195 |
+
for name, module in (('torchvision', 'torchvision'), ('pillow', 'PIL')):
|
| 196 |
+
try:
|
| 197 |
+
env[name] = __import__(module).__version__
|
| 198 |
+
except Exception: # noqa: BLE001
|
| 199 |
+
env[name] = None
|
| 200 |
+
if device.type == 'cuda':
|
| 201 |
+
env['gpu'] = torch.cuda.get_device_name(device)
|
| 202 |
+
try:
|
| 203 |
+
env['driver'] = subprocess.run(['nvidia-smi', '--query-gpu=driver_version', '--format=csv,noheader',
|
| 204 |
+
'-i', str(device.index or 0)], capture_output=True, text=True,
|
| 205 |
+
timeout=20).stdout.strip() or None
|
| 206 |
+
except Exception: # noqa: BLE001
|
| 207 |
+
env['driver'] = None
|
| 208 |
+
return env
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
class EpochSampler:
|
| 212 |
+
"""The training order (owner 2026-11-27, aligned with HumanWAM's resumable runs): epoch e is the permutation
|
| 213 |
+
numpy default_rng([seed, 1, e]) of the items, cut to whole batches (drop_last); each item comes with its draw
|
| 214 |
+
number (its position in the whole run's stream, e * batches_per_epoch * batch + j), which seeds its augmentation
|
| 215 |
+
(ChunkDataset: default_rng([aug_seed, draw])). Order and augmentations are thus a function of the seed and the
|
| 216 |
+
step only (not of the worker count or of an interruption): start_step skips the batches already trained."""
|
| 217 |
+
|
| 218 |
+
def __init__(self, n, batch_size, seed, start_step=0):
|
| 219 |
+
self.n, self.batch, self.seed = int(n), int(batch_size), int(seed)
|
| 220 |
+
self.per_epoch = self.n // self.batch
|
| 221 |
+
if self.per_epoch < 1:
|
| 222 |
+
raise SystemExit(f'{n} training items: fewer than one batch of {batch_size}')
|
| 223 |
+
self.epoch, self.offset = divmod(int(start_step), self.per_epoch)
|
| 224 |
+
|
| 225 |
+
def __len__(self):
|
| 226 |
+
return (self.per_epoch - self.offset) * self.batch
|
| 227 |
+
|
| 228 |
+
def __iter__(self):
|
| 229 |
+
perm = np.random.default_rng([self.seed, 1, self.epoch]).permutation(self.n)
|
| 230 |
+
base = self.epoch * self.per_epoch * self.batch
|
| 231 |
+
start = self.offset * self.batch
|
| 232 |
+
self.epoch, self.offset = self.epoch + 1, 0
|
| 233 |
+
for j in range(start, self.per_epoch * self.batch):
|
| 234 |
+
yield int(perm[j]), base + j
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
def rng_state():
|
| 238 |
+
import random
|
| 239 |
+
import torch
|
| 240 |
+
return dict(torch=torch.get_rng_state(), cuda=torch.cuda.get_rng_state_all() if torch.cuda.is_available() else None,
|
| 241 |
+
numpy=np.random.get_state(), python=random.getstate())
|
| 242 |
+
|
| 243 |
+
|
| 244 |
+
def set_rng_state(state):
|
| 245 |
+
import random
|
| 246 |
+
import torch
|
| 247 |
+
torch.set_rng_state(state['torch'])
|
| 248 |
+
if state.get('cuda') is not None and torch.cuda.is_available():
|
| 249 |
+
torch.cuda.set_rng_state_all(state['cuda'])
|
| 250 |
+
np.random.set_state(state['numpy'])
|
| 251 |
+
random.setstate(state['python'])
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
def parse_hw(text):
|
| 255 |
+
h, w = text.lower().split('x')
|
| 256 |
+
return int(h), int(w)
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
def random_shift(images, pad):
|
| 260 |
+
"""DrQ random shift: replicate-pad by `pad` pixels and crop back at a random offset per sample.
|
| 261 |
+
images (B, N, 3, H, W) float."""
|
| 262 |
+
import torch
|
| 263 |
+
import torch.nn.functional as F
|
| 264 |
+
if pad <= 0:
|
| 265 |
+
return images
|
| 266 |
+
B, N, C, H, W = images.shape
|
| 267 |
+
x = F.pad(images.reshape(B * N, C, H, W), (pad,) * 4, mode='replicate')
|
| 268 |
+
oy = torch.randint(0, 2 * pad + 1, (B * N,), device=images.device)
|
| 269 |
+
ox = torch.randint(0, 2 * pad + 1, (B * N,), device=images.device)
|
| 270 |
+
rows = (oy[:, None] + torch.arange(H, device=images.device)[None])[:, None, :, None].expand(-1, C, -1, W + 2 * pad)
|
| 271 |
+
x = x.gather(2, rows)
|
| 272 |
+
cols = (ox[:, None] + torch.arange(W, device=images.device)[None])[:, None, None, :].expand(-1, C, H, -1)
|
| 273 |
+
return x.gather(3, cols).reshape(B, N, C, H, W)
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
class EMA:
|
| 277 |
+
"""Diffusion Policy's EMAModel schedule: decay = min(max_decay, 1 - (1 + step) ** -0.75), parameters averaged,
|
| 278 |
+
buffers (normalizers) copied. schedule 'diffusion_policy_emamodel' counts the steps as upstream's EMAModel does
|
| 279 |
+
(decay 0 for the first two updates, then 1 - (step - 1) ** -0.75; FLASH)."""
|
| 280 |
+
|
| 281 |
+
def __init__(self, model, max_decay, schedule='hb'):
|
| 282 |
+
self.model = copy.deepcopy(model).eval().requires_grad_(False)
|
| 283 |
+
self.max_decay = float(max_decay)
|
| 284 |
+
self.schedule = schedule
|
| 285 |
+
|
| 286 |
+
def decay(self, step):
|
| 287 |
+
if self.schedule == 'diffusion_policy_emamodel':
|
| 288 |
+
return 0.0 if step <= 2 else min(self.max_decay, max(0.0, 1 - (step - 1) ** -0.75))
|
| 289 |
+
return 0.0 if step <= 0 else min(self.max_decay, max(0.0, 1 - (1 + step) ** -0.75))
|
| 290 |
+
|
| 291 |
+
def update(self, model, step):
|
| 292 |
+
import torch
|
| 293 |
+
decay = self.decay(step)
|
| 294 |
+
with torch.no_grad():
|
| 295 |
+
for e, p in zip(self.model.parameters(), model.parameters()):
|
| 296 |
+
e.mul_(decay).add_(p.detach(), alpha=1 - decay)
|
| 297 |
+
for e, b in zip(self.model.buffers(), model.buffers()):
|
| 298 |
+
e.copy_(b)
|
| 299 |
+
return decay
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
def preflight(train_set, eval_set, contract, samples=64, seed=0) -> dict:
|
| 303 |
+
"""Training items of `train_set` (augmented unless its body_dims is 0) against the same frames read without
|
| 304 |
+
augmentation, and two reads of the offline-check items; raises on any violation of docs/augmentation_v2.md.
|
| 305 |
+
Items are (images, state, *labels): every label (action rows; FLASH's polynomial rows and history) must be
|
| 306 |
+
bit-identical to the plain read."""
|
| 307 |
+
import torch
|
| 308 |
+
plain = train_set.plain() # the same frames without augmentation
|
| 309 |
+
picks = np.random.default_rng(seed).choice(len(plain), size=min(samples, len(plain)), replace=False)
|
| 310 |
+
nb, sd = train_set.body_dims, contract.state_dim
|
| 311 |
+
limit = augmentation_module().max_body_offset_rad() * (1 + 1e-5)
|
| 312 |
+
images_changed = body_moved = 0
|
| 313 |
+
worst = 0.0
|
| 314 |
+
for k in picks:
|
| 315 |
+
(im, st, *lab), (im0, st0, *lab0) = train_set[int(k)], plain[int(k)]
|
| 316 |
+
if st.shape != (sd,) or st0.shape != (sd,) or [x.shape for x in lab] != [x.shape for x in lab0]:
|
| 317 |
+
raise SystemExit(f'preflight: state {tuple(st.shape)} / labels {[tuple(x.shape) for x in lab]}, '
|
| 318 |
+
f'expected ({sd},)')
|
| 319 |
+
if not all(torch.equal(a, b) for a, b in zip(lab, lab0)):
|
| 320 |
+
raise SystemExit('preflight: an action label differs from the recorded data')
|
| 321 |
+
if not torch.equal(st[nb:], st0[nb:]):
|
| 322 |
+
raise SystemExit(f'preflight: a state value past the {nb} body joints changed')
|
| 323 |
+
delta = (st[:nb].double() - st0[:nb].double()).abs()
|
| 324 |
+
if nb:
|
| 325 |
+
worst = max(worst, float(delta.max()))
|
| 326 |
+
if worst > limit:
|
| 327 |
+
raise SystemExit(f'preflight: a body joint moved {math.degrees(worst):.3f} deg (> 2.75)')
|
| 328 |
+
body_moved += int((delta > 0).sum())
|
| 329 |
+
images_changed += int(not torch.equal(im, im0))
|
| 330 |
+
n = len(picks)
|
| 331 |
+
moved = body_moved / max(1, n * nb)
|
| 332 |
+
if nb and (images_changed < 0.9 * n or moved < 0.95):
|
| 333 |
+
raise SystemExit(f'preflight: augmentation inactive ({images_changed}/{n} images changed, {moved:.3f} of the '
|
| 334 |
+
'body joint values moved)')
|
| 335 |
+
if not nb and (images_changed or worst):
|
| 336 |
+
raise SystemExit('preflight: items changed with the augmentation off')
|
| 337 |
+
eval_picks = np.random.default_rng(seed + 1).choice(len(eval_set), size=min(8, len(eval_set)), replace=False)
|
| 338 |
+
for k in eval_picks:
|
| 339 |
+
a, b = eval_set[int(k)], eval_set[int(k)]
|
| 340 |
+
if eval_set.body_dims or not all(torch.equal(x, y) for x, y in zip(a, b)):
|
| 341 |
+
raise SystemExit('preflight: the offline-check items are not deterministic')
|
| 342 |
+
return dict(samples=n, state_dim=sd, body_dims=nb, images_changed=images_changed,
|
| 343 |
+
body_values_moved=round(moved, 4),
|
| 344 |
+
max_body_offset_deg=round(math.degrees(worst), 4), actions_bit_identical=True,
|
| 345 |
+
non_body_state_bit_identical=True, eval_items_deterministic=len(eval_picks))
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
def offline_eval(policy, dataset, samples, device, groups):
|
| 349 |
+
"""Normalized-action MSE of policy.predict on fixed dataset items (seeded), overall and per action group. FLASH:
|
| 350 |
+
its 30 Hz output rows against the recorded rows from the anchor (rows past the episode's end left out). A policy
|
| 351 |
+
with lead rows (ODE) starts from the recorded row before the frame (its BOS at an episode's first frame), as from
|
| 352 |
+
the executed row in closed loop, and is scored on the valid rows."""
|
| 353 |
+
import torch
|
| 354 |
+
policy.eval()
|
| 355 |
+
errs, masks = [], []
|
| 356 |
+
generator = torch.Generator(device=device)
|
| 357 |
+
generator.manual_seed(0)
|
| 358 |
+
lead = int(getattr(policy, 'lead_rows', 0))
|
| 359 |
+
for start in range(0, len(samples), 32):
|
| 360 |
+
batch = [dataset[int(k)] for k in samples[start:start + 32]]
|
| 361 |
+
images = torch.stack([b[0] for b in batch]).to(device).permute(0, 1, 4, 2, 3).float().div_(255.)
|
| 362 |
+
state = torch.stack([b[1] for b in batch]).to(device)
|
| 363 |
+
if policy.name == 'flash':
|
| 364 |
+
hist = torch.stack([b[3] for b in batch]).to(device)
|
| 365 |
+
has = torch.stack([b[4] for b in batch]).to(device)
|
| 366 |
+
target = torch.stack([b[5] for b in batch]).to(device)
|
| 367 |
+
valid = torch.stack([b[6] for b in batch]).numpy()
|
| 368 |
+
pred, _ = policy.predict(images, state, hist, has, generator=generator)
|
| 369 |
+
raw = policy.action_norm.normalize(pred.float())
|
| 370 |
+
elif lead:
|
| 371 |
+
rows = torch.stack([b[2] for b in batch]).to(device)
|
| 372 |
+
row_valid = torch.stack([b[3] for b in batch])
|
| 373 |
+
previous, target = rows[:, lead - 1], rows[:, lead:]
|
| 374 |
+
valid = (row_valid[:, lead:] > 0).numpy()
|
| 375 |
+
_, raw = policy.predict(images, state, generator=generator, previous=previous,
|
| 376 |
+
has_previous=(row_valid[:, lead - 1] > 0).to(device))
|
| 377 |
+
else:
|
| 378 |
+
target = torch.stack([b[2] for b in batch]).to(device)
|
| 379 |
+
valid = np.ones(target.shape[:2], bool)
|
| 380 |
+
_, raw = policy.predict(images, state, generator=generator)
|
| 381 |
+
errs.append((raw.float() - policy.action_norm.normalize(target)).pow(2).cpu().numpy())
|
| 382 |
+
masks.append(valid)
|
| 383 |
+
err, mask = np.concatenate(errs), np.concatenate(masks) # (S, horizon, action_dim), (S, horizon)
|
| 384 |
+
rows = err[mask]
|
| 385 |
+
out = dict(mse=float(rows.mean()), mse_row0=float(err[:, 0][mask[:, 0]].mean()))
|
| 386 |
+
offset = 0
|
| 387 |
+
for column, start, end in groups:
|
| 388 |
+
out[f'mse_{column.split(".")[-1]}'] = float(rows[:, offset:offset + end - start].mean())
|
| 389 |
+
offset += end - start
|
| 390 |
+
return out
|
| 391 |
+
|
| 392 |
+
|
| 393 |
+
SAVE_COUNT = 6 # owner 2026-11-27: small models keep 6 checkpoints per training, spread evenly over its steps
|
| 394 |
+
SAVE_GRID = 250 # the in-training MSE's interval: every save point has its nMSE
|
| 395 |
+
|
| 396 |
+
|
| 397 |
+
def save_points(steps: int, every=None) -> list:
|
| 398 |
+
"""The run's own steps (1..steps) at which it saves: k * steps / 6 for k = 1..6 rounded to the 250-step grid
|
| 399 |
+
(the last one is always `steps`); with `every` (a recorded deviation) every multiple of it and the end."""
|
| 400 |
+
if every:
|
| 401 |
+
return sorted({*range(every, steps + 1, every), steps})
|
| 402 |
+
if steps < SAVE_COUNT * SAVE_GRID:
|
| 403 |
+
return sorted({max(1, round(k * steps / SAVE_COUNT)) for k in range(1, SAVE_COUNT + 1)})
|
| 404 |
+
return sorted({min(steps, max(SAVE_GRID, SAVE_GRID * round(k * steps / SAVE_COUNT / SAVE_GRID)))
|
| 405 |
+
for k in range(1, SAVE_COUNT)} | {steps})
|
| 406 |
+
|
| 407 |
+
|
| 408 |
+
def init_continuation(args, policy, ema, pcfg, contract, cameras, hw, augmentation, train_episodes, out):
|
| 409 |
+
"""--init-from (owner 2026-11-27: aligned with HumanWAM's continuation, hb_training/protocol.yaml
|
| 410 |
+
interface.continuation and fastwam_tools/hb_fastwam_cont.py): load only the weights of a finished run's checkpoint
|
| 411 |
+
into the freshly built policy (and EMA) before training; the optimizer and the schedule start new. The run it
|
| 412 |
+
continues must have the same policy configuration, contract, cameras, image size, augmentation and training
|
| 413 |
+
episodes, and the continuation's peak learning rate must be below the original one (REPRODUCIBILITY.md: a
|
| 414 |
+
continuation never reuses the original peak). Returns (record for config.training.continuation, original steps)."""
|
| 415 |
+
import torch
|
| 416 |
+
from baselines.runtime import sha256 as file_sha256
|
| 417 |
+
src = args.init_from.expanduser().resolve()
|
| 418 |
+
if not (src / 'model.pt').is_file() or not (src / 'config.json').is_file():
|
| 419 |
+
raise SystemExit(f'--init-from {src}: not a checkpoint folder (model.pt, config.json)')
|
| 420 |
+
if src.parent.parent == out:
|
| 421 |
+
raise SystemExit('--init-from: give the continuation its own --out (the original run stays as it is)')
|
| 422 |
+
before = json.loads((src / 'config.json').read_text())
|
| 423 |
+
problems = []
|
| 424 |
+
if not same_policy_config(before['policy'], pcfg.to_dict()):
|
| 425 |
+
problems.append('policy configuration')
|
| 426 |
+
if before['contract'] != contract.to_dict(cameras):
|
| 427 |
+
problems.append('contract / cameras')
|
| 428 |
+
if list(before['image_hw']) != list(hw):
|
| 429 |
+
problems.append('image size')
|
| 430 |
+
if (before['training'].get('augmentation') or {}).get('version') != augmentation.get('version') \
|
| 431 |
+
or before['training'].get('shift_px') != args.shift:
|
| 432 |
+
problems.append('augmentation')
|
| 433 |
+
if list(before['dataset']['train_episodes']) != list(train_episodes):
|
| 434 |
+
problems.append('training episodes')
|
| 435 |
+
if problems:
|
| 436 |
+
raise SystemExit(f'--init-from {src}: the run differs in {", ".join(problems)}; a continuation trains the '
|
| 437 |
+
'same model on the same data')
|
| 438 |
+
original_lr = float(before['training']['lr'])
|
| 439 |
+
if not args.lr < original_lr:
|
| 440 |
+
raise SystemExit(f'--init-from: --lr {args.lr} must be below the original peak {original_lr} (the protocol: '
|
| 441 |
+
f'0.3 x, i.e. {0.3 * original_lr:g})')
|
| 442 |
+
step0 = int(before['step'])
|
| 443 |
+
state_file = src.parent.parent / 'train_state.pt'
|
| 444 |
+
saved = torch.load(state_file, map_location='cpu', weights_only=False) if state_file.is_file() else None
|
| 445 |
+
total_saved = None # the total step train_state.pt was written at (its 'step' counts the run's own steps)
|
| 446 |
+
if saved is not None:
|
| 447 |
+
c = (saved['config'].get('training') or {}).get('continuation') or {}
|
| 448 |
+
total_saved = int(c.get('init_step', 0)) + int(saved['step'])
|
| 449 |
+
if saved is not None and total_saved == step0:
|
| 450 |
+
policy.load_state_dict(saved['policy'], strict=True)
|
| 451 |
+
if ema is not None:
|
| 452 |
+
if saved.get('ema') is None:
|
| 453 |
+
raise SystemExit(f'--init-from: {state_file} has no EMA weights')
|
| 454 |
+
ema.model.load_state_dict(saved['ema'], strict=True)
|
| 455 |
+
weights = f'raw policy and EMA from {state_file} (written at step {step0})'
|
| 456 |
+
else:
|
| 457 |
+
payload = torch.load(src / 'model.pt', map_location='cpu', weights_only=True)
|
| 458 |
+
policy.load_state_dict(payload['state_dict'], strict=True)
|
| 459 |
+
if ema is not None:
|
| 460 |
+
ema.model.load_state_dict(payload['state_dict'], strict=True)
|
| 461 |
+
weights = (f'the saved {before.get("weights", "ema")} weights of {src.name} for the policy and its EMA '
|
| 462 |
+
f'(no train_state.pt written at step {step0})')
|
| 463 |
+
policy.to(next(policy.parameters()).device)
|
| 464 |
+
record = dict(init_from=str(src), init_step=step0, init_weights=weights, init_model_sha256=file_sha256(src / 'model.pt'),
|
| 465 |
+
init_code_commit=before.get('code_commit'), original_peak_lr=original_lr, peak_lr=args.lr,
|
| 466 |
+
peak_lr_factor=round(args.lr / original_lr, 6), warmup_steps=args.warmup,
|
| 467 |
+
warmup_ratio=round(args.warmup / max(1, args.steps), 6), more_steps=args.steps,
|
| 468 |
+
total_steps=step0 + args.steps, optimizer='fresh AdamW (same groups, betas, weight decay)',
|
| 469 |
+
schedule='fresh: warm-up then the policy\'s cosine over the continuation steps',
|
| 470 |
+
ema_decay_steps='total steps (the EMA keeps averaging as in the original run)')
|
| 471 |
+
print(json.dumps(dict(event='continuation', **record)), flush=True)
|
| 472 |
+
return record, step0
|
| 473 |
+
|
| 474 |
+
|
| 475 |
+
def main():
|
| 476 |
+
p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
| 477 |
+
p.add_argument('--policy', choices=sorted(POLICIES), required=True)
|
| 478 |
+
p.add_argument('--dataset', type=Path, required=True, help='LeRobot v2.1 dataset directory')
|
| 479 |
+
p.add_argument('--contract', choices=sorted(CONTRACTS), required=True)
|
| 480 |
+
p.add_argument('--cameras', help='comma-separated cameras (default: the contract\'s)')
|
| 481 |
+
p.add_argument('--episodes', help="episodes to use, e.g. '0:100' (default: all)")
|
| 482 |
+
p.add_argument('--val-episodes', type=int, default=0, help='hold out the last N of them for the offline check')
|
| 483 |
+
p.add_argument('--out', type=Path, required=True)
|
| 484 |
+
p.add_argument('--steps', type=int, default=None,
|
| 485 |
+
help="training steps (default: the protocol recipe's, long tasks x2; with --init-from 2000)")
|
| 486 |
+
p.add_argument('--batch-size', type=int, default=None, help="batch (default: the protocol recipe's, 512)")
|
| 487 |
+
p.add_argument('--dataset-id', metavar='REPO@COMMIT',
|
| 488 |
+
help='the HF dataset and revision the --dataset directory holds (recorded; default: inferred from '
|
| 489 |
+
'a directory named <name>-<commit>/data)')
|
| 490 |
+
p.add_argument('--allow-dirty-tree', action='store_true',
|
| 491 |
+
help='train with uncommitted changes under evaluation/ (recorded; otherwise refused)')
|
| 492 |
+
p.add_argument('--lr', type=float, default=None,
|
| 493 |
+
help=f"peak learning rate (default {DEFAULTS['lr']}; with --init-from 0.3 x the original peak)")
|
| 494 |
+
p.add_argument('--weight-decay', type=float, default=DEFAULTS['weight_decay'])
|
| 495 |
+
p.add_argument('--warmup', type=int, default=None,
|
| 496 |
+
help=f"warm-up steps (default {DEFAULTS['warmup']}; with --init-from 5 %% of --steps)")
|
| 497 |
+
p.add_argument('--ema', type=float, default=DEFAULTS['ema'], help='max EMA decay; 0 saves the raw weights')
|
| 498 |
+
p.add_argument('--horizon', type=int, default=None,
|
| 499 |
+
help="action rows per chunk (default: the policy's; 16; FLASH: --flash rows)")
|
| 500 |
+
p.add_argument('--image-size', default='168x224', help='HxW of the policy images')
|
| 501 |
+
p.add_argument('--augmentation', choices=['hb-v2', 'none'], default='hb-v2',
|
| 502 |
+
help='training augmentation: the benchmark spec v2 (default; docs/augmentation_v2.md) or none '
|
| 503 |
+
'(an explicit exception, recorded in run.json)')
|
| 504 |
+
p.add_argument('--shift', type=int, default=0,
|
| 505 |
+
help='native random-shift augmentation in pixels (default 0: off; only with --augmentation none)')
|
| 506 |
+
p.add_argument('--preflight-only', action='store_true', help='run the data preflight, write run.json and stop')
|
| 507 |
+
p.add_argument('--backbone-weights', default=None,
|
| 508 |
+
help="torchvision weights the ResNet18 starts from (default IMAGENET1K_V1; FLASH, ODE: none); "
|
| 509 |
+
"'none': from scratch")
|
| 510 |
+
p.add_argument('--backbone-lr-scale', type=float, default=None,
|
| 511 |
+
help='learning rate of the image backbone relative to --lr (default 0.1; FLASH, ODE: 1)')
|
| 512 |
+
p.add_argument('--model', action='append', default=[], metavar='KEY=VALUE',
|
| 513 |
+
help='override a PolicyConfig field (JSON value), e.g. num_layers=6; repeatable')
|
| 514 |
+
p.add_argument('--flash', action='append', default=[], metavar='KEY=VALUE',
|
| 515 |
+
help='FLASH setting (JSON value), e.g. stride=2; repeatable (flash.FLASH_DEFAULTS)')
|
| 516 |
+
p.add_argument('--cache-dir', type=Path, default=Path('~/hb_models/baselines/cache'))
|
| 517 |
+
p.add_argument('--workers', type=int, default=None,
|
| 518 |
+
help='DataLoader workers (and frame-cache decoders); the v2 augmentation costs ~17 ms of one CPU '
|
| 519 |
+
"core per item, so 8 workers feed only ~6 steps/s at batch 64 (default: the protocol "
|
| 520 |
+
"recipe's)")
|
| 521 |
+
p.add_argument('--prefetch', type=int, default=2, help='batches prefetched per worker')
|
| 522 |
+
p.add_argument('--save-every', type=int, default=None,
|
| 523 |
+
help="save every N steps instead of the protocol's 6 even save points (owner 2026-11-27); a "
|
| 524 |
+
'deviation: needs --protocol-exception')
|
| 525 |
+
p.add_argument('--log-every', type=int, default=100)
|
| 526 |
+
p.add_argument('--eval-samples', type=int, default=256)
|
| 527 |
+
p.add_argument('--seed', type=int, default=None,
|
| 528 |
+
help='training seed (default: the model\'s one fixed seed: ACT, DP 0; FM-DiT v1 / v2, FLASH, ODE 42; '
|
| 529 |
+
'another value needs --protocol-exception)')
|
| 530 |
+
p.add_argument('--device', default='cuda:0')
|
| 531 |
+
p.add_argument('--no-amp', action='store_true')
|
| 532 |
+
p.add_argument('--resume', action='store_true', help='continue from <out>/train_state.pt')
|
| 533 |
+
p.add_argument('--init-from', type=Path, metavar='CHECKPOINT',
|
| 534 |
+
help='continuation of a finished run (HumanWAM hb_training/protocol.yaml interface.continuation: '
|
| 535 |
+
'weights only): its checkpoint folder <run>/checkpoints/step-NNNNNN. Loads the raw policy and '
|
| 536 |
+
'its EMA from <run>/train_state.pt when that was written at the same step (else the saved '
|
| 537 |
+
'EMA weights for both); a fresh AdamW and schedule run --steps MORE steps with peak --lr '
|
| 538 |
+
'(the protocol: 0.3 x the original peak) and --warmup (5 %% of --steps). Checkpoints, logs, '
|
| 539 |
+
'the in-training MSE and the EMA decay count the total steps (original + continuation). '
|
| 540 |
+
'Use a new --out.')
|
| 541 |
+
p.add_argument('--protocol-exception', metavar='TEXT', action='append', default=[],
|
| 542 |
+
help="a setting other than the protocol's (e.g. --save-every): the owner's decision, recorded "
|
| 543 |
+
'verbatim in run.json and config.json (repeatable)')
|
| 544 |
+
p.add_argument('--continuation-exception', metavar='TEXT',
|
| 545 |
+
help='--init-from with a peak learning rate, warm-up or step count other than the protocol\'s '
|
| 546 |
+
'(0.3 x, 5 %%, 2000 or, long tasks, 4000 steps): the owner\'s decision, recorded verbatim')
|
| 547 |
+
p.add_argument('--inloop-task', help='in-training MSE: the task key of HumanWAM eval-action-mse hb_eval_common')
|
| 548 |
+
p.add_argument('--inloop-code', type=Path, help='in-training MSE: HumanWAM hb_training/eval-action-mse')
|
| 549 |
+
p.add_argument('--allow-no-inloop', action='store_true',
|
| 550 |
+
help='train without the in-training MSE (every model needs it, owner 2026-11-22/27; an exception '
|
| 551 |
+
'to the protocol, recorded)')
|
| 552 |
+
args = p.parse_args()
|
| 553 |
+
recipe = PROTOCOL_RECIPES.get(args.policy, {})
|
| 554 |
+
factor = LONG_TASKS.get(args.inloop_task, 1)
|
| 555 |
+
given = dict(warmup=args.warmup, seed=args.seed)
|
| 556 |
+
args.batch_size = recipe.get('batch_size', DEFAULTS['batch_size']) if args.batch_size is None else args.batch_size
|
| 557 |
+
args.workers = recipe.get('workers', 32) if args.workers is None else args.workers
|
| 558 |
+
if args.steps is None:
|
| 559 |
+
args.steps = (2000 * factor if args.init_from else
|
| 560 |
+
recipe['steps'] * factor if 'steps' in recipe else 60000)
|
| 561 |
+
if args.warmup is None and not args.init_from and 'warmup' in recipe:
|
| 562 |
+
args.warmup = recipe['warmup']
|
| 563 |
+
want_seed = training_defaults(args.policy)['seed']
|
| 564 |
+
deviations = [f'{k} {v} (protocol {w})' for k, v, w in (
|
| 565 |
+
('batch_size', args.batch_size, recipe.get('batch_size')),
|
| 566 |
+
('steps', args.steps, None if args.init_from or 'steps' not in recipe else recipe['steps'] * factor),
|
| 567 |
+
('warmup', given['warmup'], None if args.init_from else recipe.get('warmup')),
|
| 568 |
+
('workers', args.workers, recipe.get('workers')),
|
| 569 |
+
('seed', given['seed'], want_seed)) if w is not None and v is not None and v != w]
|
| 570 |
+
if args.save_every:
|
| 571 |
+
deviations.append(f'save_every {args.save_every} (protocol: 6 even save points)')
|
| 572 |
+
if deviations and not args.protocol_exception:
|
| 573 |
+
raise SystemExit(f"{args.policy}: {', '.join(deviations)} differ from the protocol (HumanWAM "
|
| 574 |
+
"hb_training/protocol.yaml); pass --protocol-exception with the owner's decision")
|
| 575 |
+
continuation_protocol = None
|
| 576 |
+
if args.init_from: # HumanWAM protocol.yaml interface.continuation
|
| 577 |
+
original_lr = float(json.loads((args.init_from.expanduser() / 'config.json').read_text())['training']['lr'])
|
| 578 |
+
want = dict(lr=0.3 * original_lr, warmup=round(0.05 * args.steps), steps=(2000, 4000))
|
| 579 |
+
args.lr = want['lr'] if args.lr is None else args.lr
|
| 580 |
+
args.warmup = want['warmup'] if args.warmup is None else args.warmup
|
| 581 |
+
off = [f'{k} {v}' for k, v, ok in (('lr', args.lr, math.isclose(args.lr, want['lr'], rel_tol=1e-6)),
|
| 582 |
+
('warmup', args.warmup, args.warmup == want['warmup']),
|
| 583 |
+
('steps', args.steps, args.steps in want['steps'])) if not ok]
|
| 584 |
+
if off and not args.continuation_exception:
|
| 585 |
+
raise SystemExit(f"--init-from: {', '.join(off)} differ from the protocol's continuation (lr "
|
| 586 |
+
f"{want['lr']:g} = 0.3 x {original_lr:g}, warm-up {want['warmup']} = 5 % of --steps, "
|
| 587 |
+
'2000 steps, long tasks 4000); pass --continuation-exception with the owner\'s decision')
|
| 588 |
+
continuation_protocol = dict(peak_lr_factor=0.3, warmup_ratio=0.05, steps=list(want['steps']),
|
| 589 |
+
deviations=off, exception=args.continuation_exception)
|
| 590 |
+
elif args.continuation_exception:
|
| 591 |
+
raise SystemExit('--continuation-exception goes with --init-from')
|
| 592 |
+
args.lr = DEFAULTS['lr'] if args.lr is None else args.lr
|
| 593 |
+
args.warmup = DEFAULTS['warmup'] if args.warmup is None else args.warmup
|
| 594 |
+
|
| 595 |
+
flash = args.policy == 'flash'
|
| 596 |
+
ode = args.policy in ODE_POLICIES
|
| 597 |
+
fm2 = args.policy == 'fm_dit_v2'
|
| 598 |
+
defaults = training_defaults(args.policy)
|
| 599 |
+
horizon = defaults['horizon'] if args.horizon is None else args.horizon
|
| 600 |
+
lead = POLICIES[args.policy].lead_rows
|
| 601 |
+
seed = defaults['seed'] if args.seed is None else args.seed
|
| 602 |
+
backbone_weights = defaults['backbone_weights'] if args.backbone_weights is None else args.backbone_weights
|
| 603 |
+
backbone_lr_scale = defaults['backbone_lr_scale'] if args.backbone_lr_scale is None else args.backbone_lr_scale
|
| 604 |
+
if not args.inloop_task and not args.allow_no_inloop:
|
| 605 |
+
raise SystemExit(f'{args.policy}: the protocol requires the in-training MSE for every model (--inloop-task, '
|
| 606 |
+
'--inloop-code), or --allow-no-inloop as a recorded exception')
|
| 607 |
+
dirty = git_dirty()
|
| 608 |
+
if dirty and not args.allow_dirty_tree:
|
| 609 |
+
raise SystemExit(f'uncommitted changes under evaluation/ ({", ".join(dirty[:5])}): the recorded code_commit '
|
| 610 |
+
'would not be the code trained; commit them or pass --allow-dirty-tree (recorded)')
|
| 611 |
+
if bool(args.inloop_task) != bool(args.inloop_code):
|
| 612 |
+
raise SystemExit('--inloop-task and --inloop-code go together')
|
| 613 |
+
|
| 614 |
+
out = args.out.expanduser().resolve()
|
| 615 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 616 |
+
contract = CONTRACTS[args.contract]
|
| 617 |
+
aug = augmentation_module()
|
| 618 |
+
aug.check_state_layout(contract.robot, contract.state_dim, [column for column, _, _ in contract.state])
|
| 619 |
+
hb_aug = args.augmentation == 'hb-v2'
|
| 620 |
+
if hb_aug and args.shift:
|
| 621 |
+
raise SystemExit('--shift is the native random shift, which the augmentation spec v2 turns off '
|
| 622 |
+
'(docs/augmentation_v2.md); use it only with --augmentation none')
|
| 623 |
+
if contract.body_dims != aug.BODY_JOINTS[contract.robot]:
|
| 624 |
+
raise SystemExit(f'contract {contract.name}: body_dims {contract.body_dims}, the spec perturbs '
|
| 625 |
+
f'{aug.BODY_JOINTS[contract.robot]} body joints')
|
| 626 |
+
augmentation = (aug.describe(contract.robot, contract.body_dims) if hb_aug else
|
| 627 |
+
dict(version=None, exception='--augmentation none (not the benchmark default)'))
|
| 628 |
+
cameras = tuple(args.cameras.split(',')) if args.cameras else contract.cameras
|
| 629 |
+
hw = parse_hw(args.image_size)
|
| 630 |
+
dataset = LeRobotDataset(args.dataset)
|
| 631 |
+
dataset.check_contract(contract, cameras)
|
| 632 |
+
if dataset.fps != DATASET_FPS and not args.protocol_exception:
|
| 633 |
+
raise SystemExit(f'{dataset.root}: {dataset.fps} Hz; every dataset, training and evaluation is {DATASET_FPS} '
|
| 634 |
+
"Hz (owner 2026-11-26); pass --protocol-exception with the owner's decision")
|
| 635 |
+
dataset_id = args.dataset_id
|
| 636 |
+
if dataset_id is None:
|
| 637 |
+
import re
|
| 638 |
+
root = Path(dataset.root)
|
| 639 |
+
m = re.fullmatch(r'(.+)-([0-9a-f]{7,40})', (root.parent if root.name == 'data' else root).name)
|
| 640 |
+
dataset_id = f'{m.group(1)}@{m.group(2)} (inferred from the directory name)' if m else None
|
| 641 |
+
if dataset_id is None:
|
| 642 |
+
raise SystemExit(f'{dataset.root}: give --dataset-id REPO@COMMIT (the HF dataset and revision it holds)')
|
| 643 |
+
episodes = parse_episodes(args.episodes, dataset.lengths)
|
| 644 |
+
if not 0 <= args.val_episodes < len(episodes):
|
| 645 |
+
raise SystemExit('--val-episodes must leave training episodes')
|
| 646 |
+
lowdim = load_lowdim(dataset, contract, episodes)
|
| 647 |
+
if len(lowdim['tasks']) != 1:
|
| 648 |
+
raise SystemExit(f"the baselines take no language: one task per dataset, found {lowdim['tasks']}")
|
| 649 |
+
n_train = len(episodes) - args.val_episodes
|
| 650 |
+
train_pos, val_pos = list(range(n_train)), list(range(n_train, len(episodes)))
|
| 651 |
+
train_rows = np.concatenate([np.arange(s, s + n) for s, n in
|
| 652 |
+
zip(lowdim['starts'][:n_train], lowdim['lengths'][:n_train])])
|
| 653 |
+
stats = statistics(lowdim, train_rows, quantiles=ode)
|
| 654 |
+
if ode: # the G1 port's normalization: the DFX6 values fixed at [0, 1]
|
| 655 |
+
for key, dims in unit_range_dims(contract).items():
|
| 656 |
+
stats[key]['unit_dims'] = dims
|
| 657 |
+
frames = frame_cache(dataset, lowdim, cameras, hw, args.cache_dir, workers=args.workers)
|
| 658 |
+
|
| 659 |
+
overrides = {k: json.loads(v) for k, v in (item.split('=', 1) for item in args.model)}
|
| 660 |
+
base = dict(policy=args.policy, n_cameras=len(cameras), state_dim=contract.state_dim,
|
| 661 |
+
action_dim=contract.action_dim, horizon=horizon)
|
| 662 |
+
if ode: # the body part integrated as the ODE state: the contract's first action group (G1 token 64, H2 body 31)
|
| 663 |
+
_, first, last = contract.action[0]
|
| 664 |
+
overrides.setdefault('ode_body_dim', last - first)
|
| 665 |
+
if flash:
|
| 666 |
+
settings = dict(FLASH_DEFAULTS, **{k: json.loads(v) for k, v in (i.split('=', 1) for i in args.flash)})
|
| 667 |
+
if args.horizon is not None and args.horizon != settings['rows']:
|
| 668 |
+
raise SystemExit('FLASH: the output rows are --flash rows=N, not --horizon')
|
| 669 |
+
base.update(FLASH_POLICY_FIELDS, horizon=int(settings['rows']), extra=dict(flash=settings))
|
| 670 |
+
elif args.flash:
|
| 671 |
+
raise SystemExit('--flash applies to --policy flash only')
|
| 672 |
+
if fm2:
|
| 673 |
+
base.update(FM_DIT_V2_POLICY_FIELDS)
|
| 674 |
+
weights = None if str(backbone_weights).lower() in ('none', '') else backbone_weights
|
| 675 |
+
pcfg = PolicyConfig.from_dict({**base, 'backbone_weights': weights, **overrides})
|
| 676 |
+
aug_seed = seed if hb_aug else None # every model: the seeded augmentation stream (REPRODUCIBILITY.md section 3)
|
| 677 |
+
if flash:
|
| 678 |
+
from baselines.flash import FlashPolicy, flash_settings
|
| 679 |
+
fs = flash_settings(pcfg)
|
| 680 |
+
H_ext = fs['poly_prefix'] + fs['n_action'] + fs['poly_suffix'] + 2 * fs['fit_pad']
|
| 681 |
+
offsets = (np.arange(H_ext) - (fs['fit_pad'] + fs['poly_prefix'])) * fs['stride']
|
| 682 |
+
kw = dict(offsets=offsets, stride=fs['stride'], n_history=fs['n_history'], rows=fs['rows'])
|
| 683 |
+
train_set = FlashChunkDataset(lowdim, frames, cameras, hw, train_pos,
|
| 684 |
+
body_dims=contract.body_dims if hb_aug else 0, aug_seed=aug_seed, **kw)
|
| 685 |
+
eval_set = FlashChunkDataset(lowdim, frames, cameras, hw, val_pos or train_pos, with_dense=True, **kw)
|
| 686 |
+
assert FlashPolicy.name == 'flash'
|
| 687 |
+
else:
|
| 688 |
+
train_set = ChunkDataset(lowdim, frames, cameras, hw, horizon, train_pos,
|
| 689 |
+
body_dims=contract.body_dims if hb_aug else 0, lead=lead, aug_seed=aug_seed)
|
| 690 |
+
eval_set = ChunkDataset(lowdim, frames, cameras, hw, horizon, val_pos or train_pos,
|
| 691 |
+
lead=lead) # never augmented
|
| 692 |
+
print(f'HB_AUG_SEED={aug_seed}', file=sys.stderr, flush=True)
|
| 693 |
+
checks = preflight(train_set, eval_set, contract, seed=seed)
|
| 694 |
+
print(json.dumps(dict(event='preflight', augmentation=augmentation.get('version'), **checks)), flush=True)
|
| 695 |
+
if args.save_every and not args.protocol_exception:
|
| 696 |
+
raise SystemExit('--save-every: the protocol saves 6 checkpoints spread evenly over the steps (owner '
|
| 697 |
+
"2026-11-27); pass --protocol-exception with the owner's decision to save otherwise")
|
| 698 |
+
save_at = set(save_points(args.steps, args.save_every))
|
| 699 |
+
print(json.dumps(dict(event='save_points', steps=sorted(save_at))), flush=True)
|
| 700 |
+
layout = dict(nodes=1, gpus=1, per_gpu_batch=args.batch_size, global_batch=args.batch_size,
|
| 701 |
+
gradient_accumulation=1, num_workers=args.workers, prefetch=args.prefetch)
|
| 702 |
+
if args.preflight_only:
|
| 703 |
+
(out / 'run.json').write_text(json.dumps(dict(
|
| 704 |
+
argv=sys.argv, started=datetime.now().isoformat(timespec='seconds'), host=os.uname().nodename,
|
| 705 |
+
contract=contract.to_dict(cameras), image_hw=list(hw), augmentation=augmentation, preflight=checks,
|
| 706 |
+
shift_px=args.shift, seed=seed, aug_seed=aug_seed, layout=layout, policy=pcfg.to_dict(),
|
| 707 |
+
code_commit=git_commit()), indent=1, default=str))
|
| 708 |
+
return
|
| 709 |
+
|
| 710 |
+
import torch
|
| 711 |
+
torch.manual_seed(seed)
|
| 712 |
+
np.random.seed(seed)
|
| 713 |
+
device = torch.device(args.device)
|
| 714 |
+
policy = build_policy(pcfg)
|
| 715 |
+
policy.fit_normalizers(stats)
|
| 716 |
+
policy.to(device)
|
| 717 |
+
ema = EMA(policy, args.ema, defaults.get('ema_schedule', 'hb')) if args.ema > 0 else None
|
| 718 |
+
named = list(policy.named_parameters())
|
| 719 |
+
backbone = [p for n, p in named if n.startswith(policy.backbone_prefix)]
|
| 720 |
+
rest = [p for n, p in named if not n.startswith(policy.backbone_prefix)]
|
| 721 |
+
if not backbone:
|
| 722 |
+
raise SystemExit(f'no backbone parameters under {policy.backbone_prefix!r}')
|
| 723 |
+
optimizer = torch.optim.AdamW([dict(params=rest), dict(params=backbone, lr=args.lr * backbone_lr_scale)],
|
| 724 |
+
lr=args.lr, betas=DEFAULTS['betas'], weight_decay=args.weight_decay)
|
| 725 |
+
schedule = defaults.get('schedule', 'hb')
|
| 726 |
+
|
| 727 |
+
def lr_lambda(step):
|
| 728 |
+
if schedule == 'diffusers_cosine': # diffusers get_cosine_schedule_with_warmup (FLASH's lr_scheduler)
|
| 729 |
+
if step < args.warmup:
|
| 730 |
+
return step / max(1, args.warmup)
|
| 731 |
+
progress = (step - args.warmup) / max(1, args.steps - args.warmup)
|
| 732 |
+
return max(0.0, 0.5 * (1.0 + math.cos(math.pi * progress)))
|
| 733 |
+
if step < args.warmup:
|
| 734 |
+
return (step + 1) / max(1, args.warmup)
|
| 735 |
+
return 0.5 * (1 + math.cos(math.pi * min(1.0, (step - args.warmup) / max(1, args.steps - args.warmup))))
|
| 736 |
+
|
| 737 |
+
scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer, lr_lambda)
|
| 738 |
+
step = 0
|
| 739 |
+
step0 = 0 # continuation: the steps of the run it starts from (0 for a training from scratch)
|
| 740 |
+
continuation = None
|
| 741 |
+
state_path = out / 'train_state.pt'
|
| 742 |
+
resuming = args.resume and state_path.exists()
|
| 743 |
+
resume_rng = None
|
| 744 |
+
if args.init_from and not resuming:
|
| 745 |
+
continuation, step0 = init_continuation(args, policy, ema, pcfg, contract, cameras, hw, augmentation,
|
| 746 |
+
episodes[:n_train], out)
|
| 747 |
+
continuation['protocol'] = continuation_protocol
|
| 748 |
+
if resuming:
|
| 749 |
+
saved = torch.load(state_path, map_location='cpu', weights_only=False)
|
| 750 |
+
if not same_policy_config(saved['config']['policy'], pcfg.to_dict()):
|
| 751 |
+
raise SystemExit('train_state.pt was written for another policy configuration')
|
| 752 |
+
before = saved['config'].get('training', {})
|
| 753 |
+
if (before.get('augmentation') or {}).get('version') != augmentation.get('version') \
|
| 754 |
+
or before.get('shift_px') != args.shift:
|
| 755 |
+
raise SystemExit('train_state.pt was trained with another augmentation (version / --shift); resuming '
|
| 756 |
+
'would change it mid-run')
|
| 757 |
+
policy.load_state_dict(saved['policy'])
|
| 758 |
+
optimizer.load_state_dict(saved['optimizer'])
|
| 759 |
+
scheduler.load_state_dict(saved['scheduler'])
|
| 760 |
+
if ema is not None:
|
| 761 |
+
ema.model.load_state_dict(saved['ema'])
|
| 762 |
+
step = int(saved['step'])
|
| 763 |
+
continuation = before.get('continuation')
|
| 764 |
+
if bool(continuation) != bool(args.init_from) or (
|
| 765 |
+
continuation and Path(continuation['init_from']) != args.init_from.expanduser().resolve()):
|
| 766 |
+
raise SystemExit('--resume: give the same --init-from as the interrupted run (none for a run from '
|
| 767 |
+
'scratch)')
|
| 768 |
+
step0 = int(continuation['init_step']) if continuation else 0
|
| 769 |
+
resume_rng = saved.get('rng')
|
| 770 |
+
if resume_rng is None:
|
| 771 |
+
print('HB_RESUME no random state in train_state.pt (written before 2026-11-27): the streams restart',
|
| 772 |
+
flush=True)
|
| 773 |
+
print(json.dumps(dict(event='resumed', step=step0 + step, local_step=step)), flush=True)
|
| 774 |
+
|
| 775 |
+
inloop = None
|
| 776 |
+
if args.inloop_task:
|
| 777 |
+
# one GPU: hb_inloop_core shards by RANK / WORLD_SIZE, which a DLC node sets for its own launcher
|
| 778 |
+
for key, value in (('RANK', '0'), ('WORLD_SIZE', '1'), ('LOCAL_RANK', '0')):
|
| 779 |
+
if os.environ.get(key, value) != value:
|
| 780 |
+
print(f'HB_INLOOP {key}={os.environ[key]} -> {value} (one-GPU training)', flush=True)
|
| 781 |
+
os.environ[key] = value
|
| 782 |
+
from baselines import inloop as inloop_mod
|
| 783 |
+
inloop = inloop_mod.install(args.inloop_code, args.inloop_task, out,
|
| 784 |
+
lambda: ema.model if ema is not None else policy, contract, cameras, hw, lowdim,
|
| 785 |
+
args.policy, lowdim_loader=lambda eps: load_lowdim(dataset, contract, eps))
|
| 786 |
+
else:
|
| 787 |
+
print(f'HB_INLOOP {args.policy} disabled: no --inloop-task', flush=True)
|
| 788 |
+
|
| 789 |
+
samples = np.random.default_rng(1).choice(len(eval_set), size=min(args.eval_samples, len(eval_set)), replace=False)
|
| 790 |
+
training = dict(steps=args.steps, batch_size=args.batch_size, lr=args.lr, betas=list(DEFAULTS['betas']),
|
| 791 |
+
weight_decay=args.weight_decay, warmup=args.warmup,
|
| 792 |
+
schedule='linear warm-up + cosine' if schedule == 'hb' else schedule,
|
| 793 |
+
backbone_lr_scale=backbone_lr_scale,
|
| 794 |
+
ema=args.ema, shift_px=args.shift, amp=(not args.no_amp) and bool(defaults['amp']), seed=seed,
|
| 795 |
+
augmentation=augmentation, preflight=checks, aug_seed=aug_seed, layout=layout,
|
| 796 |
+
continuation=continuation, total_steps=step0 + args.steps,
|
| 797 |
+
save_steps=[step0 + k for k in sorted(save_at)],
|
| 798 |
+
save_rule=(f'every {args.save_every} steps (exception)' if args.save_every else
|
| 799 |
+
f'{SAVE_COUNT} checkpoints spread evenly over the steps on the {SAVE_GRID}-step grid '
|
| 800 |
+
'(owner 2026-11-27)'),
|
| 801 |
+
protocol_exceptions=args.protocol_exception)
|
| 802 |
+
training.update(ema_schedule=defaults.get('ema_schedule', 'hb'),
|
| 803 |
+
inloop=dict(task=args.inloop_task, code=str(args.inloop_code) if args.inloop_code else None,
|
| 804 |
+
every=int(os.environ.get('HB_INLOOP_EVERY', '250')) if args.inloop_task else 0,
|
| 805 |
+
exception=None if args.inloop_task else '--allow-no-inloop',
|
| 806 |
+
code_sha256={f: file_sha256(Path(args.inloop_code) / f) for f in
|
| 807 |
+
('hb_inloop_core.py', 'hb_eval_common.py')} if args.inloop_code else None))
|
| 808 |
+
training.update(protocol_recipe=dict(recipe, long_task_factor=factor), protocol_deviations=deviations,
|
| 809 |
+
environment=environment(device), code_dirty=dirty, allow_dirty_tree=args.allow_dirty_tree,
|
| 810 |
+
augmentation_sha256=file_sha256(HERE.parent / 'augmentation' / 'hb_aug_v2.py'),
|
| 811 |
+
order='EpochSampler: default_rng([seed, 1, epoch]) permutation; augmentation default_rng([aug_seed, '
|
| 812 |
+
'draw])')
|
| 813 |
+
if flash:
|
| 814 |
+
training.update(upstream='NTUMARS/FLASH-Policy@f47e490')
|
| 815 |
+
if fm2:
|
| 816 |
+
training.update(upstream=FM_DIT_V2_UPSTREAM)
|
| 817 |
+
if ode:
|
| 818 |
+
training.update(upstream='NTUMARS/ODE-POLICY real-g1@fd8bec47 (G1 port, HumanWAM packages/ode_g1) + '
|
| 819 |
+
'main@cea26d94 (encoder, ode_dit field, default_train.yaml)')
|
| 820 |
+
config = dict(
|
| 821 |
+
policy=pcfg.to_dict(), contract=contract.to_dict(cameras), image_hw=list(hw), task_text=lowdim['tasks'][0],
|
| 822 |
+
dataset=dict(name=dataset.name,
|
| 823 |
+
root=str(dataset.root), robot_type=dataset.info.get('robot_type'), fps=dataset.fps,
|
| 824 |
+
episodes=episodes, train_episodes=episodes[:n_train], val_episodes=episodes[n_train:],
|
| 825 |
+
train_frames=int(len(train_set)),
|
| 826 |
+
git_commit=dataset.info.get('script_config', {}).get('git_commit')),
|
| 827 |
+
training=training, stats=stats, code_commit=git_commit(), task=args.inloop_task, dataset_id=dataset_id)
|
| 828 |
+
run = dict(argv=sys.argv, started=datetime.now().isoformat(timespec='seconds'), host=os.uname().nodename,
|
| 829 |
+
torch=torch.__version__, **config)
|
| 830 |
+
(out / 'run.json').write_text(json.dumps(run, indent=1, default=str))
|
| 831 |
+
sampler = EpochSampler(len(train_set), args.batch_size, seed, start_step=step)
|
| 832 |
+
# its own generator: creating the iterator (here and after a --resume) must not draw from the global stream that
|
| 833 |
+
# the model's noise and dropout use, or a resumed run would be one draw off
|
| 834 |
+
loader = torch.utils.data.DataLoader(train_set, batch_size=args.batch_size, sampler=sampler, drop_last=True,
|
| 835 |
+
generator=torch.Generator().manual_seed(seed),
|
| 836 |
+
num_workers=args.workers, pin_memory=True, persistent_workers=True,
|
| 837 |
+
prefetch_factor=args.prefetch)
|
| 838 |
+
params = sum(x.numel() for x in policy.parameters())
|
| 839 |
+
print(json.dumps(dict(event='start', policy=args.policy, params=params,
|
| 840 |
+
backbone_params=sum(x.numel() for x in backbone), backbone_weights=pcfg.backbone_weights,
|
| 841 |
+
backbone_norm=pcfg.backbone_norm, train_frames=len(train_set), steps=args.steps,
|
| 842 |
+
from_step=step0 + step, total_steps=step0 + args.steps, cameras=list(cameras), hw=list(hw),
|
| 843 |
+
seed=seed)), flush=True)
|
| 844 |
+
log = (out / 'train_log.jsonl').open('a')
|
| 845 |
+
amp = (not args.no_amp) and device.type == 'cuda' and bool(defaults['amp'])
|
| 846 |
+
|
| 847 |
+
def save(step): # step: this run's own steps; checkpoints are named and stamped with the total
|
| 848 |
+
total = step0 + step
|
| 849 |
+
folder = out / f'checkpoints/step-{total:06d}'
|
| 850 |
+
model = ema.model if ema is not None else policy
|
| 851 |
+
metrics = offline_eval(model, eval_set, samples, device, contract.action)
|
| 852 |
+
save_checkpoint(folder, model, dict(config, step=total, weights='ema' if ema is not None else 'raw',
|
| 853 |
+
offline_eval=dict(metrics, samples=len(samples),
|
| 854 |
+
frames='val' if val_pos else 'train')))
|
| 855 |
+
final = out / 'checkpoints/final'
|
| 856 |
+
if final.is_symlink() or final.exists():
|
| 857 |
+
final.unlink()
|
| 858 |
+
final.symlink_to(folder.name)
|
| 859 |
+
torch.save(dict(policy=policy.state_dict(), optimizer=optimizer.state_dict(), scheduler=scheduler.state_dict(),
|
| 860 |
+
ema=None if ema is None else ema.model.state_dict(), step=step, config=config,
|
| 861 |
+
rng=rng_state()),
|
| 862 |
+
out / 'train_state.pt.tmp')
|
| 863 |
+
(out / 'train_state.pt.tmp').replace(state_path)
|
| 864 |
+
record = dict(event='save', step=total, checkpoint=str(folder), **metrics)
|
| 865 |
+
print(json.dumps(record), flush=True)
|
| 866 |
+
log.write(json.dumps(record) + '\n')
|
| 867 |
+
log.flush()
|
| 868 |
+
policy.train()
|
| 869 |
+
|
| 870 |
+
if resume_rng is not None: # the interrupted run's random streams (model noise, dropout) at its last save
|
| 871 |
+
set_rng_state(resume_rng)
|
| 872 |
+
policy.train()
|
| 873 |
+
t0, data_s, acc = time.monotonic(), 0.0, {}
|
| 874 |
+
while step < args.steps:
|
| 875 |
+
tick = time.monotonic()
|
| 876 |
+
for images, *labels in loader:
|
| 877 |
+
data_s += time.monotonic() - tick
|
| 878 |
+
images = images.to(device, non_blocking=True).permute(0, 1, 4, 2, 3).float().div_(255.)
|
| 879 |
+
images = random_shift(images, args.shift)
|
| 880 |
+
labels = [x.to(device, non_blocking=True) for x in labels]
|
| 881 |
+
with torch.autocast(device.type, dtype=torch.bfloat16, enabled=amp):
|
| 882 |
+
loss, metrics = policy.compute_loss(images, *labels)
|
| 883 |
+
optimizer.zero_grad(set_to_none=True)
|
| 884 |
+
loss.backward()
|
| 885 |
+
optimizer.step()
|
| 886 |
+
scheduler.step()
|
| 887 |
+
step += 1
|
| 888 |
+
decay = ema.update(policy, step0 + step) if ema is not None else 0.0
|
| 889 |
+
for k, v in dict(metrics, loss=float(loss.detach())).items():
|
| 890 |
+
acc[k] = acc.get(k, 0.0) + v
|
| 891 |
+
if step % args.log_every == 0:
|
| 892 |
+
elapsed = time.monotonic() - t0
|
| 893 |
+
record = dict(event='train', step=step0 + step, lr=scheduler.get_last_lr()[0],
|
| 894 |
+
backbone_lr=scheduler.get_last_lr()[1], ema_decay=round(decay, 6),
|
| 895 |
+
it_s=round(args.log_every / elapsed, 2), data_frac=round(data_s / elapsed, 3),
|
| 896 |
+
**{k: v / args.log_every for k, v in acc.items()})
|
| 897 |
+
print(json.dumps(record), flush=True)
|
| 898 |
+
log.write(json.dumps(record) + '\n')
|
| 899 |
+
log.flush()
|
| 900 |
+
t0, data_s, acc = time.monotonic(), 0.0, {}
|
| 901 |
+
if inloop is not None and (step0 + step) % inloop.every == 0:
|
| 902 |
+
inloop.evaluate(step0 + step, ema.model if ema is not None else policy)
|
| 903 |
+
policy.train()
|
| 904 |
+
if step in save_at:
|
| 905 |
+
save(step)
|
| 906 |
+
if step >= args.steps:
|
| 907 |
+
break
|
| 908 |
+
tick = time.monotonic()
|
| 909 |
+
log.close()
|
| 910 |
+
if step >= args.steps: # as HumanWAM's launchers (e.g. fastwam_cont.sh): what the finished run is
|
| 911 |
+
c = continuation or {}
|
| 912 |
+
(out / 'complete.json').write_text(json.dumps(dict(
|
| 913 |
+
run=out.name, policy=args.policy, contract=contract.name, steps=args.steps, total_steps_after=step0 + step,
|
| 914 |
+
per_gpu_batch=args.batch_size, global_batch=args.batch_size, gradient_accumulation_steps=1,
|
| 915 |
+
save_steps=[step0 + k for k in sorted(save_at)], seed=seed, aug_seed=aug_seed, peak_lr=args.lr, warmup=args.warmup,
|
| 916 |
+
continued_from=c.get('init_from'), continued_from_step=c.get('init_step'),
|
| 917 |
+
continuation=continuation, code_commit=config['code_commit'],
|
| 918 |
+
finished_utc=datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')), indent=1))
|
| 919 |
+
print(json.dumps(dict(event='done', step=step0 + step, checkpoint=str(out / 'checkpoints/final'))), flush=True)
|
| 920 |
+
|
| 921 |
+
|
| 922 |
+
if __name__ == '__main__':
|
| 923 |
+
main()
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/policy/ODEMLP/deploy.yml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ODE-MLP baseline (evaluation/baselines, after ODE Policy's G1 port: github.com/NTUMARS/ODE-POLICY real-g1, HumanWAM
|
| 2 |
+
# packages/ode_g1; in its authors' configuration): the SONIC token is an ODE state integrated with Euler over 16 rows
|
| 3 |
+
# from the token executed at t-1 (past_actions[-1]; the normalized-zero BOS without one), with a FiLM residual MLP field (512 wide, 4 layers; the G1 port's); the DFX6 hands
|
| 4 |
+
# decoded from the condition; the condition from one ResNet18 per view (current ego_view and chest, 168x224, from
|
| 5 |
+
# scratch, GroupNorm; ODE Policy's encoder in place of the G1 port's GR00T reader), state44 into the field only.
|
| 6 |
+
# Deterministic, one field call per row.
|
| 7 |
+
# Train a checkpoint on a task's G1 expert dataset with
|
| 8 |
+
# evaluation/baselines/train.py --policy ode_mlp --contract g1_sonic_dfx6 (evaluation/README.md#baselines)
|
| 9 |
+
# and register its checkpoints/final (or checkpoints/step-NNNNNN) directory below; the entry is a placeholder until
|
| 10 |
+
# then (no checkpoint trained yet, 2026-11-24). The adapter refuses a checkpoint of another baseline or robot, and a
|
| 11 |
+
# task text other than the training dataset's (config check_task: false skips that check).
|
| 12 |
+
policy_name: ODEMLP
|
| 13 |
+
python: /home/jason/benchmark/Humanoid_benchmark/model/.venv_baselines/bin/python # evaluation/baselines/requirements.txt
|
| 14 |
+
action_space: sonic_dfx6
|
| 15 |
+
checkpoints:
|
| 16 |
+
# Task b6, data v6 (owner 2026-11-24): train.py --policy ode_mlp --contract g1_sonic_dfx6 on all 542 b6 v6 episodes
|
| 17 |
+
# (HF humanoid-benchmark/b6-pedal-bin root @ad2f5bf0, 331,577 frames, 30 Hz, trim v2; local copy b6_v6_ad2f5bf0),
|
| 18 |
+
# batch 512, 8000 steps, lr 4e-4 (1e-4 at the authors' batch 32, square-root scaled), warm-up 400 then cosine,
|
| 19 |
+
# augmentation spec v2. Offline MSE on 2048 training frames, every 1000 steps: lowest at 8000 (0.00639; log
|
| 20 |
+
# dev_logs/ode_policy_baseline_2026-11-24.md). Code: the run's code_snapshot/ (uncommitted at training time).
|
| 21 |
+
# Evaluate on b6 v6's task configuration (cart and barrel ranges differ from v5).
|
| 22 |
+
b6v6_b512_s8000: /home/jason/hb_models/baselines/runs/b6-pedal-bin-v6/ode_mlp/checkpoints/step-008000
|
| 23 |
+
# Task b6, data v6, the protocol run (HumanWAM hb_training/REPRODUCIBILITY.md section 4.7; owner 2026-11-25): all 542
|
| 24 |
+
# episodes, seed 42, HB_AUG_SEED 42, lr 1e-4 (not batch-scaled), diffusers cosine after 500 warm-up steps, EMAModel,
|
| 25 |
+
# batch 512, 8000 steps, code b4b94d29; in-training MSE (b6v6 train10) lowest at 5250 (0.1228), 8000: 0.1357. The
|
| 26 |
+
# b6v6_b512_s8000 entry above predates the protocol (not an official result).
|
| 27 |
+
# Published: HF humanoid-benchmark/ode b6-pedal-bin/b512-v6/step-00{5,6,8}000 (5a403322); the paths below are the
|
| 28 |
+
# training machine's, another machine registers its download of those folders.
|
| 29 |
+
b6v6p_s5000: /home/jason/hb_models/baselines/runs/b6-pedal-bin-v6/ode_mlp-protocol/checkpoints/step-005000
|
| 30 |
+
b6v6p_s6000: /home/jason/hb_models/baselines/runs/b6-pedal-bin-v6/ode_mlp-protocol/checkpoints/step-006000
|
| 31 |
+
b6v6p_s8000: /home/jason/hb_models/baselines/runs/b6-pedal-bin-v6/ode_mlp-protocol/checkpoints/step-008000
|
| 32 |
+
default_checkpoint: b6v6p_s8000
|
| 33 |
+
config:
|
| 34 |
+
# rows executed before the next query (null: the whole 16-row chunk; the runners query again after 12 rows at most,
|
| 35 |
+
# as the G1 port's deployment re-plans about 4 rows before a chunk ends)
|
| 36 |
+
execution_steps: null
|
a10-trolley-push-v3/b512/step-005000/training_records/code_d2096858/evaluation/policy/ODEMLP/model.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""ODE-MLP (ODE policy) baseline of the Humanoid Benchmark (evaluation/baselines, after ODE Policy's G1 port,
|
| 2 |
+
github.com/NTUMARS/ODE-POLICY): one checkpoint of evaluation/baselines/train.py with the g1_sonic_dfx6 contract, served
|
| 3 |
+
by the shared adapter evaluation/baselines/adapters.py (current ego_view + chest frames, state44 and the row executed at
|
| 4 |
+
t-1 -> 16 rows of action76).
|
| 5 |
+
"""
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import sys
|
| 8 |
+
|
| 9 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[2])) # evaluation/: the baselines package
|
| 10 |
+
from baselines.adapters import make_model # noqa: E402
|
| 11 |
+
|
| 12 |
+
Model = make_model('ode_mlp')
|
a10-trolley-push-v3/b512/step-005000/training_records/inloop-mse.jsonl
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"step": 250, "utc": "2026-11-27T06:17:58Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 38.8, "infer_s_per_query": 0.0236, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.005626720411688269, "mae_raw": 0.035799269421690136, "nmse": 0.17644996326514453, "groups": {"motion_token": {"mse_raw": 0.001094210181753287, "nmse": 0.1466070157574196}, "hands": {"mse_raw": 0.02980010830467484, "nmse": 0.33561234997301104}}, "nmse_by_step": [0.08314400343042035, 0.09887590449586198, 0.11290099390599728, 0.12523836452409742, 0.14511761293382439, 0.15154532487135736, 0.16556442907389263, 0.17499835854160103, 0.1888269744041217, 0.20149538304504822, 0.20851126235000803, 0.21792177156706827, 0.22897176805845862, 0.2329126020079222, 0.24173925994594742, 0.2509889821455748], "nmse_per_episode": {"0": 0.19716460763984367, "16": 0.19035200418511836, "33": 0.15416309401122993, "49": 0.16347431256321618, "65": 0.19083433143153042, "82": 0.14005492048446203, "98": 0.1946554429228819, "114": 0.19147458585586935, "131": 0.1904185226466834, "147": 0.15225552927895344}, "nmse_episode_sem": 0.0067959158012634805}
|
| 2 |
+
{"step": 500, "utc": "2026-11-27T06:25:41Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 13.8, "infer_s_per_query": 0.0256, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0013191503887206519, "mae_raw": 0.02015743686595649, "nmse": 0.10034431690533195, "groups": {"motion_token": {"mse_raw": 0.0008043594180541358, "nmse": 0.10672345754627448}, "hands": {"mse_raw": 0.004064702232275405, "nmse": 0.06632223348697171}}, "nmse_by_step": [0.03950548957654081, 0.05099951040031408, 0.06005473405395622, 0.0697257503474716, 0.07720721109552979, 0.08368080671785401, 0.09165204206499489, 0.09891955085169167, 0.10666716882604, 0.1136808910166747, 0.12046631804411073, 0.12643964220282317, 0.13292953657862014, 0.13868918377696698, 0.14596820952643252, 0.15257475707238796], "nmse_per_episode": {"0": 0.1195413695889388, "16": 0.1112326846091515, "33": 0.08841726748083087, "49": 0.0964036531351474, "65": 0.11150512205163439, "82": 0.07639356921527057, "98": 0.10847912639731688, "114": 0.10045512270119454, "131": 0.10871334254598036, "147": 0.08276540656685442}, "nmse_episode_sem": 0.004457569352380404}
|
| 3 |
+
{"step": 750, "utc": "2026-11-27T06:33:47Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 5.8, "infer_s_per_query": 0.0105, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.001053387027402022, "mae_raw": 0.018105695984667578, "nmse": 0.08455838703727038, "groups": {"motion_token": {"mse_raw": 0.0006739167386152711, "nmse": 0.09015116731339567}, "hands": {"mse_raw": 0.0030772285675980254, "nmse": 0.05473022556460204}}, "nmse_by_step": [0.03698263686606736, 0.04696003104581161, 0.05421201061780113, 0.062004342933387024, 0.0664498984949785, 0.07149319776596205, 0.07769448595138569, 0.08320430572460555, 0.08913369756543833, 0.0948099231033342, 0.1005098253330203, 0.10470298188274936, 0.10975158484967684, 0.11411857698876926, 0.11890365571518931, 0.12480632839133281], "nmse_per_episode": {"0": 0.10007046790798972, "16": 0.09480554153756078, "33": 0.07171920187936666, "49": 0.08357246161016149, "65": 0.0913852497015736, "82": 0.06619431211886753, "98": 0.09364531097474586, "114": 0.08569192775873517, "131": 0.09136235431296097, "147": 0.06738660676430919}, "nmse_episode_sem": 0.003830151919848646}
|
| 4 |
+
{"step": 1000, "utc": "2026-11-27T06:41:59Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 7.5, "infer_s_per_query": 0.0139, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0009239142174028476, "mae_raw": 0.017288942345442083, "nmse": 0.07476214564297483, "groups": {"motion_token": {"mse_raw": 0.0005843657671607605, "nmse": 0.07934381613199686}, "hands": {"mse_raw": 0.002734839285360648, "nmse": 0.050326569701524014}}, "nmse_by_step": [0.03554902945786918, 0.04440782259839172, 0.05070128062279066, 0.057395591604320235, 0.0608138106491443, 0.06468778203414868, 0.0698821299082524, 0.07395479104532103, 0.07850319111785897, 0.08287177978073353, 0.08734867014242698, 0.09037196142028016, 0.09449618438780519, 0.09810718345449125, 0.10176206379178217, 0.10757255701790279], "nmse_per_episode": {"0": 0.0866282303018944, "16": 0.07914176706159629, "33": 0.0645982633495055, "49": 0.07561184885906999, "65": 0.08220587604918114, "82": 0.06163013441180489, "98": 0.08406971764464179, "114": 0.07830132243257738, "131": 0.07408125495072282, "147": 0.06103326546047778}, "nmse_episode_sem": 0.0029438497008757655}
|
| 5 |
+
{"step": 1250, "utc": "2026-11-27T06:50:19Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 16.4, "infer_s_per_query": 0.0301, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0008327786446727002, "mae_raw": 0.016649574625823255, "nmse": 0.06763785582822938, "groups": {"motion_token": {"mse_raw": 0.0005199660143863266, "nmse": 0.07146786583732749}, "hands": {"mse_raw": 0.0025011126728666944, "nmse": 0.04721113577970614}}, "nmse_by_step": [0.034062794858583045, 0.04209104610059261, 0.04789030614632445, 0.05386934367652987, 0.05676378059523325, 0.05978942091978703, 0.06422900792913987, 0.06721244869384942, 0.07066628766737021, 0.07402112280411699, 0.07749435275735618, 0.0798720651619409, 0.0835394001232486, 0.08704580860200388, 0.0900359887050199, 0.09546307892352407], "nmse_per_episode": {"0": 0.07620325736315886, "16": 0.06629012651454065, "33": 0.06063443309708201, "49": 0.06870803674331709, "65": 0.07596133470536444, "82": 0.058909059332321725, "98": 0.07648144337338167, "114": 0.07336035696533957, "131": 0.0621904849256064, "147": 0.05690472384111445}, "nmse_episode_sem": 0.0024189617812041962}
|
| 6 |
+
{"step": 1500, "utc": "2026-11-27T06:59:30Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 14.1, "infer_s_per_query": 0.0261, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0007724625318311129, "mae_raw": 0.016176005691096222, "nmse": 0.06286788797945589, "groups": {"motion_token": {"mse_raw": 0.00047982507350783564, "nmse": 0.06626886197176858}, "hands": {"mse_raw": 0.0023331956428885915, "nmse": 0.044729360020454904}}, "nmse_by_step": [0.03259299540809098, 0.04012281504454582, 0.04556072697127769, 0.051312146659121184, 0.05387382831183682, 0.05625506186230302, 0.06032192820268595, 0.06266318220910466, 0.06549485190477909, 0.06835673769885339, 0.0712542049183732, 0.07320557534124057, 0.07669443004990471, 0.08002081342960542, 0.08249100140908594, 0.0872752125349755], "nmse_per_episode": {"0": 0.06783924440242714, "16": 0.06023206407447155, "33": 0.05740981170296555, "49": 0.06356022188360269, "65": 0.07141266919548053, "82": 0.05671392705717599, "98": 0.07011810843393691, "114": 0.0704126846096725, "131": 0.05648226633460078, "147": 0.053713578467092335}, "nmse_episode_sem": 0.002126086865399535}
|
| 7 |
+
{"step": 1750, "utc": "2026-11-27T07:09:05Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 16.7, "infer_s_per_query": 0.0308, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0007205890618034584, "mae_raw": 0.01574833030337106, "nmse": 0.05904350143112847, "groups": {"motion_token": {"mse_raw": 0.00044926987695297066, "nmse": 0.06223868891953184}, "hands": {"mse_raw": 0.0021676247143393927, "nmse": 0.042002501492977226}}, "nmse_by_step": [0.03108157687202444, 0.03833452985070186, 0.04346838729492033, 0.04914206566026196, 0.05152641938615369, 0.05347245712841884, 0.05719852897314697, 0.058995510242006347, 0.061424662989352265, 0.06388273123754096, 0.06634444364042363, 0.06803126547773859, 0.07137904627567672, 0.07447023888241575, 0.07651534615266357, 0.08086611780965393], "nmse_per_episode": {"0": 0.06154036850977924, "16": 0.055007143481681224, "33": 0.05437408086078448, "49": 0.059172399075389105, "65": 0.06749824973141251, "82": 0.05474326319325973, "98": 0.06639634371512054, "114": 0.06676729276153039, "131": 0.05312361694622806, "147": 0.05097767284375005}, "nmse_episode_sem": 0.001966597919327921}
|
| 8 |
+
{"step": 2000, "utc": "2026-11-27T07:20:05Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 15.3, "infer_s_per_query": 0.0281, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0006737660600488245, "mae_raw": 0.01539280973972859, "nmse": 0.05601693310893954, "groups": {"motion_token": {"mse_raw": 0.00042659956917863646, "nmse": 0.059220097031928993}, "hands": {"mse_raw": 0.0019919873446898276, "nmse": 0.038933392186329144}}, "nmse_by_step": [0.029744474703174796, 0.03684059280950971, 0.04185407913502834, 0.04746727911854135, 0.04961087585838893, 0.051284026825912904, 0.05477397223953486, 0.05616272212372457, 0.058361903211743775, 0.06045373082230592, 0.06251990525697199, 0.0639644442475515, 0.06717603642645638, 0.07000138097447643, 0.07170099488089987, 0.07565558839661322], "nmse_per_episode": {"0": 0.05689829243915148, "16": 0.05130509766298031, "33": 0.051911049631731515, "49": 0.05568400179136184, "65": 0.06373178679835241, "82": 0.05286360482294831, "98": 0.06370783745657724, "114": 0.06339986263563888, "131": 0.05104293450257219, "147": 0.04879660793960275}, "nmse_episode_sem": 0.0018253540652685555}
|
| 9 |
+
{"step": 2250, "utc": "2026-11-27T07:31:15Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 15.8, "infer_s_per_query": 0.0293, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.000628805940058794, "mae_raw": 0.015057666633634134, "nmse": 0.053496128923221815, "groups": {"motion_token": {"mse_raw": 0.0004088852780821922, "nmse": 0.056859996577945826}, "hands": {"mse_raw": 0.0018017161372673367, "nmse": 0.035555501431360416}}, "nmse_by_step": [0.02850588369046619, 0.03551927040848865, 0.040432182655680694, 0.04596990376716279, 0.04792019498121772, 0.04930913353996011, 0.05259341985572067, 0.05369411084112865, 0.055752313579369106, 0.057629019896822994, 0.05944563048500156, 0.060699732100091476, 0.0637972331632001, 0.06644809396179417, 0.06790955401931527, 0.07151311894073102], "nmse_per_episode": {"0": 0.05326490626128021, "16": 0.04873637014522974, "33": 0.05013596592868828, "49": 0.05262634287358558, "65": 0.060098524356689914, "82": 0.0509856676946809, "98": 0.061567032856689574, "114": 0.060695029532560396, "131": 0.04925833561694359, "147": 0.04680815747804713}, "nmse_episode_sem": 0.0017134757738512469}
|
| 10 |
+
{"step": 2500, "utc": "2026-11-27T07:41:52Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 18.5, "infer_s_per_query": 0.0343, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0005868729216787344, "mae_raw": 0.014725264631320257, "nmse": 0.051237449135977026, "groups": {"motion_token": {"mse_raw": 0.00039334559204988565, "nmse": 0.05480396627476333}, "hands": {"mse_raw": 0.0016190186796992611, "nmse": 0.032216024395783464}}, "nmse_by_step": [0.027332649104987894, 0.03428458072593906, 0.03910948418584171, 0.04459727925741193, 0.046428442206791536, 0.047646172990646225, 0.050733279375877925, 0.05163997990585336, 0.05347161251572392, 0.0552151802338991, 0.05670480215199201, 0.05773736228404638, 0.06068205185606129, 0.06317080549753465, 0.06439327914031363, 0.06776085926201243], "nmse_per_episode": {"0": 0.05081548008248129, "16": 0.04637332899997379, "33": 0.048436135794808946, "49": 0.049623584649706176, "65": 0.05698588592751961, "82": 0.04877679271800584, "98": 0.05962498953446337, "114": 0.05821953758619776, "131": 0.0477493730400905, "147": 0.04503004657286792}, "nmse_episode_sem": 0.0016436181152961172}
|
| 11 |
+
{"step": 2750, "utc": "2026-11-27T07:53:08Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 14.4, "infer_s_per_query": 0.0266, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.000549720132625669, "mae_raw": 0.014426028982775174, "nmse": 0.04934165544689585, "groups": {"motion_token": {"mse_raw": 0.0003809612557473394, "nmse": 0.053128895130170474}, "hands": {"mse_raw": 0.0014497674759767598, "nmse": 0.029143043802764543}}, "nmse_by_step": [0.026406286208444624, 0.03329768969497223, 0.0379992200286776, 0.043405826173007124, 0.0451501010700332, 0.04621846215785723, 0.04914258946578274, 0.04993102904935122, 0.051579799362198225, 0.05320716334933127, 0.05448735535864328, 0.055371223568797805, 0.05809596541569341, 0.060380962382307, 0.06136561551345244, 0.064457324452235], "nmse_per_episode": {"0": 0.048793715010568554, "16": 0.04457324338119484, "33": 0.04703633534732181, "49": 0.04721437398271536, "65": 0.05442536489242238, "82": 0.046756396924556534, "98": 0.057913707550767114, "114": 0.05610577918705145, "131": 0.04642818903625505, "147": 0.04347940802865762}, "nmse_episode_sem": 0.0015897083791959793}
|
| 12 |
+
{"step": 3000, "utc": "2026-11-27T08:04:15Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 15.9, "infer_s_per_query": 0.0294, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0005197787503018626, "mae_raw": 0.014164361147146086, "nmse": 0.04772797142419467, "groups": {"motion_token": {"mse_raw": 0.00037016136718309413, "nmse": 0.05167128697869969}, "hands": {"mse_raw": 0.0013177381269352934, "nmse": 0.026696955133501305}}, "nmse_by_step": [0.02565940486363845, 0.0324922025314154, 0.03706541295300834, 0.04235611060154604, 0.04405837906294779, 0.04494389586874263, 0.04772480307935164, 0.04842660123934192, 0.04990656931868096, 0.05144089851689851, 0.05259882315717703, 0.05333497367961226, 0.0558905825360255, 0.058051856148234056, 0.05886548419621328, 0.0617970781745743], "nmse_per_episode": {"0": 0.047189963572393245, "16": 0.04303908639323542, "33": 0.04585736416704221, "49": 0.045483895943908476, "65": 0.05234338935236796, "82": 0.04495343295390964, "98": 0.05599558107300148, "114": 0.054247568076064914, "131": 0.045397960319794144, "147": 0.04213597332232393}, "nmse_episode_sem": 0.001517775442138292}
|
| 13 |
+
{"step": 3250, "utc": "2026-11-27T08:15:31Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 13.0, "infer_s_per_query": 0.024, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0004950746722943474, "mae_raw": 0.013939759979604017, "nmse": 0.046333551636243454, "groups": {"motion_token": {"mse_raw": 0.0003608094510893024, "nmse": 0.05040404239969191}, "hands": {"mse_raw": 0.001211155852054587, "nmse": 0.024624267564518396}}, "nmse_by_step": [0.02506941600037502, 0.031830122377741445, 0.03628795083378428, 0.04147861297977575, 0.043093047607277, 0.04386184112496034, 0.04654757982320398, 0.04713375394622486, 0.048455960671682986, 0.049922148888812315, 0.05094562502252862, 0.05153945479183532, 0.05396736781313143, 0.05598778642514599, 0.05666633616840631, 0.059456496445254005], "nmse_per_episode": {"0": 0.04582399225551828, "16": 0.041678322906718385, "33": 0.04482607787664924, "49": 0.0439196934199293, "65": 0.05069681024933335, "82": 0.04353850904944178, "98": 0.05410864261180717, "114": 0.05262929042965678, "131": 0.044501176496265074, "147": 0.04102607278288429}, "nmse_episode_sem": 0.0014470703403095186}
|
| 14 |
+
{"step": 3500, "utc": "2026-11-27T08:26:31Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 13.6, "infer_s_per_query": 0.0251, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0004771368813055966, "mae_raw": 0.013769147627927058, "nmse": 0.04526002124318323, "groups": {"motion_token": {"mse_raw": 0.00035363428427220985, "nmse": 0.04941912265784565}, "hands": {"mse_raw": 0.0011358173988169921, "nmse": 0.023078147031650304}}, "nmse_by_step": [0.024614660765068904, 0.031316993265467816, 0.0356640761413518, 0.040777124365572855, 0.04236179015655068, 0.043023161195302084, 0.045614028973892766, 0.046142378500426504, 0.04731957865539803, 0.048744405375548035, 0.04968187411002845, 0.050173941127542344, 0.052466494467684886, 0.05442437172444882, 0.055014151824287615, 0.05768396727942369], "nmse_per_episode": {"0": 0.04475594948167039, "16": 0.0406214333842499, "33": 0.04399199702603094, "49": 0.04281865338410489, "65": 0.04943265204098209, "82": 0.042502406003823, "98": 0.052549922327867656, "114": 0.051256494059978855, "131": 0.0439375409502024, "147": 0.040188072567418597}, "nmse_episode_sem": 0.001377994866976606}
|
| 15 |
+
{"step": 3750, "utc": "2026-11-27T08:37:34Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 13.6, "infer_s_per_query": 0.0252, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.00046249677101600957, "mae_raw": 0.0136325095882249, "nmse": 0.044345946489574795, "groups": {"motion_token": {"mse_raw": 0.0003474627369741373, "nmse": 0.048575064838067394}, "hands": {"mse_raw": 0.0010760116192393275, "nmse": 0.02179064863094767}}, "nmse_by_step": [0.024241621979897467, 0.030891647929529177, 0.03515818107335369, 0.04017972629981959, 0.041723935696790934, 0.04232510332598501, 0.044839494022845344, 0.045267477821462794, 0.046348162818992275, 0.04774270604103015, 0.048580044332773874, 0.04902053858115161, 0.05119514551592155, 0.053082993833650303, 0.05361705291238078, 0.056145698708366665], "nmse_per_episode": {"0": 0.043841684593019625, "16": 0.03980343367595853, "33": 0.04337154411890461, "49": 0.04191420457207203, "65": 0.048445768786457094, "82": 0.04157634195296347, "98": 0.05119813438265317, "114": 0.050095350329998255, "131": 0.04322065062411512, "147": 0.03948191069096156}, "nmse_episode_sem": 0.0013213544695139204}
|
| 16 |
+
{"step": 4000, "utc": "2026-11-27T08:48:41Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 16.4, "infer_s_per_query": 0.0304, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0004515128752211616, "mae_raw": 0.01352405118306556, "nmse": 0.04362466829461301, "groups": {"motion_token": {"mse_raw": 0.00034262249168558813, "nmse": 0.047903878071602124}, "hands": {"mse_raw": 0.0010322615874108867, "nmse": 0.020802216150671075}}, "nmse_by_step": [0.023953432727399884, 0.0305591563805567, 0.034742049318218005, 0.0396846334176515, 0.04120972295790507, 0.0417519108594289, 0.04420593140954112, 0.0445598417757277, 0.04554969870237366, 0.04691650751629175, 0.04771567818162363, 0.04810086115497522, 0.05021729224249525, 0.052059554576903956, 0.052533937894803484, 0.05503061177600418], "nmse_per_episode": {"0": 0.0431677162373004, "16": 0.03917018359329802, "33": 0.04281303424035878, "49": 0.041229991193727555, "65": 0.04768959972917163, "82": 0.04086470651720264, "98": 0.050026632932184796, "114": 0.049151419364635324, "131": 0.04270019819321277, "147": 0.03895257159397494}, "nmse_episode_sem": 0.0012683133361314023}
|
| 17 |
+
{"step": 4250, "utc": "2026-11-27T09:00:35Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 8.4, "infer_s_per_query": 0.0156, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0004421994590972354, "mae_raw": 0.01343743380535207, "nmse": 0.04303817634069244, "groups": {"motion_token": {"mse_raw": 0.0003387123951072237, "nmse": 0.0473669130713835}, "hands": {"mse_raw": 0.0009941304670439638, "nmse": 0.01995158044367346}}, "nmse_by_step": [0.023714709997687478, 0.030288282541592076, 0.03442165006413109, 0.03930481647621035, 0.04077884651851365, 0.04129327781103602, 0.04368564488974042, 0.043985280826882925, 0.04493155147409043, 0.04626282959877709, 0.04700152787422637, 0.047357156667610756, 0.04942680048433455, 0.05121826538223171, 0.05162887860776927, 0.05408368711020545], "nmse_per_episode": {"0": 0.04263852877077942, "16": 0.03865542570150987, "33": 0.0423912718278717, "49": 0.0406258187568885, "65": 0.04712903947905139, "82": 0.04032703551368627, "98": 0.049068246500131765, "114": 0.048303430651483154, "131": 0.0422481598293877, "147": 0.038538686114174325}, "nmse_episode_sem": 0.0012230426748676636}
|
| 18 |
+
{"step": 4500, "utc": "2026-11-27T09:11:16Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 13.8, "infer_s_per_query": 0.0255, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0004355682705124652, "mae_raw": 0.013377018425676917, "nmse": 0.04259343857499913, "groups": {"motion_token": {"mse_raw": 0.0003357909050801072, "nmse": 0.04695579644136649}, "hands": {"mse_raw": 0.0009677142194850409, "nmse": 0.0193275299543732}}, "nmse_by_step": [0.023541424793719404, 0.030084803427523375, 0.03416537616191283, 0.03899931775727433, 0.040458599996093525, 0.040939825867203294, 0.043291605494492014, 0.043549459596548865, 0.0444627239414581, 0.04575639062380175, 0.04647429630953936, 0.046793541624283876, 0.04881313304286325, 0.05057520932309173, 0.05096457993117253, 0.05337946174667163], "nmse_per_episode": {"0": 0.04223652933456785, "16": 0.03827878611402175, "33": 0.042037129553439606, "49": 0.04018656662896361, "65": 0.046720693892083234, "82": 0.039958157197899684, "98": 0.04826880282528347, "114": 0.047674038745195664, "131": 0.04187996546617449, "147": 0.038256151407045406}, "nmse_episode_sem": 0.0011839166721164544}
|
| 19 |
+
{"step": 4750, "utc": "2026-11-27T09:21:07Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 16.0, "infer_s_per_query": 0.0296, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.00043114753477337255, "mae_raw": 0.013337358851849647, "nmse": 0.0422887543785429, "groups": {"motion_token": {"mse_raw": 0.0003337605673252158, "nmse": 0.046671587391149634}, "hands": {"mse_raw": 0.0009505446944968758, "nmse": 0.01891364497797374}}, "nmse_by_step": [0.023422200642550826, 0.02994580015397655, 0.03398960531403067, 0.03878931207888286, 0.040247498188395625, 0.040696463903102414, 0.04301762025346097, 0.0432346283667644, 0.04412734316448694, 0.04539022094345942, 0.04609960254679493, 0.04640040744745632, 0.04839690715139768, 0.050149385070403674, 0.0505350434901561, 0.05292106334140948], "nmse_per_episode": {"0": 0.04198245008278082, "16": 0.03796782263955554, "33": 0.041790410732202715, "49": 0.03992544079038377, "65": 0.046442101436239246, "82": 0.039722036928817185, "98": 0.047690761175304346, "114": 0.04723430461730318, "131": 0.0416406258935336, "147": 0.03806455846680859}, "nmse_episode_sem": 0.0011562487806578627}
|
| 20 |
+
{"step": 5000, "utc": "2026-11-27T09:31:37Z", "model": "ode_mlp", "task": "a10v3", "split": "train10", "queries": 533, "ranks": 1, "wall_s": 15.7, "infer_s_per_query": 0.029, "seed": 1234, "weights": "ema", "policy": "ode_mlp", "cache_checked_episodes": [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], "inloop_code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse", "cache": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse/cache/a10v3/train10", "rows": 8446, "metric": "nmse-v2: dims constant over training excluded", "dims_scored": 76, "mse_raw": 0.0004282933328333554, "mae_raw": 0.013313482543838202, "nmse": 0.04209119221983073, "groups": {"motion_token": {"mse_raw": 0.000332456132806209, "nmse": 0.04648867674066364}, "hands": {"mse_raw": 0.0009394250663114689, "nmse": 0.01863794144205519}}, "nmse_by_step": [0.023343712535353583, 0.029855453633924074, 0.033872823944782665, 0.03865487215974893, 0.040101382293572706, 0.040534404045500405, 0.04284241701100579, 0.04302952429957912, 0.04391558452783107, 0.04516458108481456, 0.045852863709418934, 0.04614300941108406, 0.04813378454589587, 0.04987514012872959, 0.050246649142724045, 0.05262846328121031], "nmse_per_episode": {"0": 0.041816324503568494, "16": 0.03778391708330008, "33": 0.041642482599013285, "49": 0.03976389793161662, "65": 0.04626316699664855, "82": 0.03956947213459659, "98": 0.04730850395196163, "114": 0.046941702659779934, "131": 0.04145112146629758, "147": 0.03795144591159741}, "nmse_episode_sem": 0.0011366989678504205}
|
a10-trolley-push-v3/b512/step-005000/training_records/launch.sh
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Exact training command of a10v3-b512-s5000 (A800 single-GPU pool policies-20261109/hb_small/small_pool.sh, 2026-11-27).
|
| 3 |
+
# Code: Humanoid_benchmark bai d20968588471ede76533662de44fd0df9e124b49 (tree Humanoid_benchmark-bai-07a80dd + train.py at that commit;
|
| 4 |
+
# HB_CODE_COMMIT names it). The DLC RANK / WORLD_SIZE variables are removed: single GPU.
|
| 5 |
+
# Hardware: Aliyun PAI DLC A800 80 GB, 1 GPU (rank 1 GPU 3), cores 46-60 of 92, small pool 2026-11-27T06:07:05Z
|
| 6 |
+
P=/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z
|
| 7 |
+
G=$P/policies-20261109
|
| 8 |
+
cd $P/Humanoid_benchmark-bai-07a80dd
|
| 9 |
+
env -u RANK -u WORLD_SIZE -u LOCAL_RANK -u LOCAL_WORLD_SIZE -u GROUP_RANK -u MASTER_ADDR -u MASTER_PORT CUDA_VISIBLE_DEVICES=3 TORCH_HOME=$G/torch-home taskset -c 46-60 $G/envs/hb-baselines/bin/python -I evaluation/baselines/train.py --policy ode_mlp --contract g1_sonic_dfx6 --dataset /mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/a10-trolley-push-v3-6e410c5/data --out /mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000 --steps 5000 --batch-size 512 --workers 32 --log-every 50 --cache-dir /mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/flash-cache/a10v3 --inloop-task a10v3 --inloop-code /mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse
|
a10-trolley-push-v3/b512/step-005000/training_records/pip_freeze_hb-baselines.txt
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
anyio==4.16.0
|
| 2 |
+
av==15.1.0
|
| 3 |
+
certifi==2026.11.20
|
| 4 |
+
charset-normalizer==3.5.3
|
| 5 |
+
click==8.5.1
|
| 6 |
+
diffusers==0.35.1
|
| 7 |
+
filelock==4.3.1
|
| 8 |
+
fsspec==2026.9.0
|
| 9 |
+
h11==0.16.0
|
| 10 |
+
hf-xet==1.8.0
|
| 11 |
+
httpcore2==2.16.2
|
| 12 |
+
httpx2==2.16.2
|
| 13 |
+
huggingface_hub==2.4.0
|
| 14 |
+
idna==3.20
|
| 15 |
+
importlib_metadata==10.2.0
|
| 16 |
+
iniconfig==2.3.1
|
| 17 |
+
Jinja2==3.1.6
|
| 18 |
+
lazy-importer==0.1.0
|
| 19 |
+
MarkupSafe==3.0.4
|
| 20 |
+
mpmath==1.3.0
|
| 21 |
+
networkx==3.7
|
| 22 |
+
numpy==2.2.6
|
| 23 |
+
nvidia-cublas-cu12==12.8.4.1
|
| 24 |
+
nvidia-cuda-cupti-cu12==12.8.90
|
| 25 |
+
nvidia-cuda-nvrtc-cu12==12.8.93
|
| 26 |
+
nvidia-cuda-runtime-cu12==12.8.90
|
| 27 |
+
nvidia-cudnn-cu12==9.10.2.21
|
| 28 |
+
nvidia-cufft-cu12==11.3.3.83
|
| 29 |
+
nvidia-cufile-cu12==1.13.1.3
|
| 30 |
+
nvidia-curand-cu12==10.3.9.90
|
| 31 |
+
nvidia-cusolver-cu12==11.7.3.90
|
| 32 |
+
nvidia-cusparse-cu12==12.5.8.93
|
| 33 |
+
nvidia-cusparselt-cu12==0.7.1
|
| 34 |
+
nvidia-nccl-cu12==2.27.5
|
| 35 |
+
nvidia-nvjitlink-cu12==12.8.93
|
| 36 |
+
nvidia-nvshmem-cu12==3.3.20
|
| 37 |
+
nvidia-nvtx-cu12==12.8.90
|
| 38 |
+
opencv-python-headless==4.11.0.86
|
| 39 |
+
packaging==26.4
|
| 40 |
+
pillow==13.0.0
|
| 41 |
+
pluggy==1.7.0
|
| 42 |
+
pyarrow==23.0.1
|
| 43 |
+
Pygments==2.21.0
|
| 44 |
+
pytest==8.4.2
|
| 45 |
+
PyYAML==6.0.4
|
| 46 |
+
regex==2026.11.19
|
| 47 |
+
requests==2.34.2
|
| 48 |
+
safetensors==0.8.0
|
| 49 |
+
setuptools==84.2.1
|
| 50 |
+
sympy==1.14.0
|
| 51 |
+
torch==2.9.0+cu128
|
| 52 |
+
torchvision==0.24.0+cu128
|
| 53 |
+
tqdm==4.70.1
|
| 54 |
+
triton==3.5.0
|
| 55 |
+
truststore==0.10.5
|
| 56 |
+
typing_extensions==4.16.0
|
| 57 |
+
urllib3==2.8.0
|
| 58 |
+
zipp==4.1.2
|
a10-trolley-push-v3/b512/step-005000/training_records/run.json
ADDED
|
@@ -0,0 +1,1340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"argv": [
|
| 3 |
+
"evaluation/baselines/train.py",
|
| 4 |
+
"--policy",
|
| 5 |
+
"ode_mlp",
|
| 6 |
+
"--contract",
|
| 7 |
+
"g1_sonic_dfx6",
|
| 8 |
+
"--dataset",
|
| 9 |
+
"/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/a10-trolley-push-v3-6e410c5/data",
|
| 10 |
+
"--out",
|
| 11 |
+
"/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000",
|
| 12 |
+
"--steps",
|
| 13 |
+
"5000",
|
| 14 |
+
"--batch-size",
|
| 15 |
+
"512",
|
| 16 |
+
"--workers",
|
| 17 |
+
"32",
|
| 18 |
+
"--log-every",
|
| 19 |
+
"50",
|
| 20 |
+
"--cache-dir",
|
| 21 |
+
"/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/flash-cache/a10v3",
|
| 22 |
+
"--inloop-task",
|
| 23 |
+
"a10v3",
|
| 24 |
+
"--inloop-code",
|
| 25 |
+
"/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse"
|
| 26 |
+
],
|
| 27 |
+
"started": "2026-11-27T14:07:41",
|
| 28 |
+
"host": "dlc19te5fv9wtn5t-worker-0",
|
| 29 |
+
"torch": "2.9.0+cu128",
|
| 30 |
+
"policy": {
|
| 31 |
+
"policy": "ode_mlp",
|
| 32 |
+
"n_cameras": 2,
|
| 33 |
+
"state_dim": 44,
|
| 34 |
+
"action_dim": 76,
|
| 35 |
+
"horizon": 16,
|
| 36 |
+
"backbone": "resnet18",
|
| 37 |
+
"backbone_weights": null,
|
| 38 |
+
"backbone_norm": "group",
|
| 39 |
+
"hidden_dim": 384,
|
| 40 |
+
"num_layers": 4,
|
| 41 |
+
"num_heads": 8,
|
| 42 |
+
"mlp_ratio": 4.0,
|
| 43 |
+
"dropout": 0.1,
|
| 44 |
+
"time_embed_dim": 128,
|
| 45 |
+
"num_inference_steps": null,
|
| 46 |
+
"num_train_timesteps": 100,
|
| 47 |
+
"beta_schedule": "squaredcos_cap_v2",
|
| 48 |
+
"prediction_type": "epsilon",
|
| 49 |
+
"clip_sample": true,
|
| 50 |
+
"act_hidden_dim": 512,
|
| 51 |
+
"dim_feedforward": 3200,
|
| 52 |
+
"enc_layers": 4,
|
| 53 |
+
"dec_layers": 7,
|
| 54 |
+
"nheads": 8,
|
| 55 |
+
"latent_dim": 32,
|
| 56 |
+
"kl_weight": 10.0,
|
| 57 |
+
"ode_body_dim": 64,
|
| 58 |
+
"ode_width": 512,
|
| 59 |
+
"ode_layers": 4,
|
| 60 |
+
"ode_cond_dim": 512,
|
| 61 |
+
"ode_field_scale": 1.0,
|
| 62 |
+
"ode_dit_hidden": 512,
|
| 63 |
+
"ode_dit_layers": 4,
|
| 64 |
+
"ode_dit_heads": 8,
|
| 65 |
+
"ode_dit_tokens": 4,
|
| 66 |
+
"extra": {}
|
| 67 |
+
},
|
| 68 |
+
"contract": {
|
| 69 |
+
"name": "g1_sonic_dfx6",
|
| 70 |
+
"robot": "g1",
|
| 71 |
+
"cameras": [
|
| 72 |
+
"ego_view",
|
| 73 |
+
"chest"
|
| 74 |
+
],
|
| 75 |
+
"state": [
|
| 76 |
+
[
|
| 77 |
+
"observation.state",
|
| 78 |
+
0,
|
| 79 |
+
29
|
| 80 |
+
],
|
| 81 |
+
[
|
| 82 |
+
"observation.inspire_left_hand_state",
|
| 83 |
+
0,
|
| 84 |
+
6
|
| 85 |
+
],
|
| 86 |
+
[
|
| 87 |
+
"observation.inspire_right_hand_state",
|
| 88 |
+
0,
|
| 89 |
+
6
|
| 90 |
+
],
|
| 91 |
+
[
|
| 92 |
+
"observation.projected_gravity",
|
| 93 |
+
0,
|
| 94 |
+
3
|
| 95 |
+
]
|
| 96 |
+
],
|
| 97 |
+
"action": [
|
| 98 |
+
[
|
| 99 |
+
"action.motion_token",
|
| 100 |
+
0,
|
| 101 |
+
64
|
| 102 |
+
],
|
| 103 |
+
[
|
| 104 |
+
"observation.inspire_left_hand_state",
|
| 105 |
+
0,
|
| 106 |
+
6
|
| 107 |
+
],
|
| 108 |
+
[
|
| 109 |
+
"observation.inspire_right_hand_state",
|
| 110 |
+
0,
|
| 111 |
+
6
|
| 112 |
+
]
|
| 113 |
+
],
|
| 114 |
+
"state_dim": 44,
|
| 115 |
+
"action_dim": 76,
|
| 116 |
+
"action_space": "sonic_dfx6",
|
| 117 |
+
"body_dims": 29
|
| 118 |
+
},
|
| 119 |
+
"image_hw": [
|
| 120 |
+
168,
|
| 121 |
+
224
|
| 122 |
+
],
|
| 123 |
+
"task_text": "Walk naturally to the purple platform trolley with open hands, approach its handle slowly and directly, grasp with both hands, then push straight until the platform is alongside the cardboard box ahead and to the side, stop, open both hands and withdraw slightly from the handle.",
|
| 124 |
+
"dataset": {
|
| 125 |
+
"name": "data",
|
| 126 |
+
"root": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/a10-trolley-push-v3-6e410c5/data",
|
| 127 |
+
"robot_type": null,
|
| 128 |
+
"fps": 30.0,
|
| 129 |
+
"episodes": [
|
| 130 |
+
0,
|
| 131 |
+
1,
|
| 132 |
+
2,
|
| 133 |
+
3,
|
| 134 |
+
4,
|
| 135 |
+
5,
|
| 136 |
+
6,
|
| 137 |
+
7,
|
| 138 |
+
8,
|
| 139 |
+
9,
|
| 140 |
+
10,
|
| 141 |
+
11,
|
| 142 |
+
12,
|
| 143 |
+
13,
|
| 144 |
+
14,
|
| 145 |
+
15,
|
| 146 |
+
16,
|
| 147 |
+
17,
|
| 148 |
+
18,
|
| 149 |
+
19,
|
| 150 |
+
20,
|
| 151 |
+
21,
|
| 152 |
+
22,
|
| 153 |
+
23,
|
| 154 |
+
24,
|
| 155 |
+
25,
|
| 156 |
+
26,
|
| 157 |
+
27,
|
| 158 |
+
28,
|
| 159 |
+
29,
|
| 160 |
+
30,
|
| 161 |
+
31,
|
| 162 |
+
32,
|
| 163 |
+
33,
|
| 164 |
+
34,
|
| 165 |
+
35,
|
| 166 |
+
36,
|
| 167 |
+
37,
|
| 168 |
+
38,
|
| 169 |
+
39,
|
| 170 |
+
40,
|
| 171 |
+
41,
|
| 172 |
+
42,
|
| 173 |
+
43,
|
| 174 |
+
44,
|
| 175 |
+
45,
|
| 176 |
+
46,
|
| 177 |
+
47,
|
| 178 |
+
48,
|
| 179 |
+
49,
|
| 180 |
+
50,
|
| 181 |
+
51,
|
| 182 |
+
52,
|
| 183 |
+
53,
|
| 184 |
+
54,
|
| 185 |
+
55,
|
| 186 |
+
56,
|
| 187 |
+
57,
|
| 188 |
+
58,
|
| 189 |
+
59,
|
| 190 |
+
60,
|
| 191 |
+
61,
|
| 192 |
+
62,
|
| 193 |
+
63,
|
| 194 |
+
64,
|
| 195 |
+
65,
|
| 196 |
+
66,
|
| 197 |
+
67,
|
| 198 |
+
68,
|
| 199 |
+
69,
|
| 200 |
+
70,
|
| 201 |
+
71,
|
| 202 |
+
72,
|
| 203 |
+
73,
|
| 204 |
+
74,
|
| 205 |
+
75,
|
| 206 |
+
76,
|
| 207 |
+
77,
|
| 208 |
+
78,
|
| 209 |
+
79,
|
| 210 |
+
80,
|
| 211 |
+
81,
|
| 212 |
+
82,
|
| 213 |
+
83,
|
| 214 |
+
84,
|
| 215 |
+
85,
|
| 216 |
+
86,
|
| 217 |
+
87,
|
| 218 |
+
88,
|
| 219 |
+
89,
|
| 220 |
+
90,
|
| 221 |
+
91,
|
| 222 |
+
92,
|
| 223 |
+
93,
|
| 224 |
+
94,
|
| 225 |
+
95,
|
| 226 |
+
96,
|
| 227 |
+
97,
|
| 228 |
+
98,
|
| 229 |
+
99,
|
| 230 |
+
100,
|
| 231 |
+
101,
|
| 232 |
+
102,
|
| 233 |
+
103,
|
| 234 |
+
104,
|
| 235 |
+
105,
|
| 236 |
+
106,
|
| 237 |
+
107,
|
| 238 |
+
108,
|
| 239 |
+
109,
|
| 240 |
+
110,
|
| 241 |
+
111,
|
| 242 |
+
112,
|
| 243 |
+
113,
|
| 244 |
+
114,
|
| 245 |
+
115,
|
| 246 |
+
116,
|
| 247 |
+
117,
|
| 248 |
+
118,
|
| 249 |
+
119,
|
| 250 |
+
120,
|
| 251 |
+
121,
|
| 252 |
+
122,
|
| 253 |
+
123,
|
| 254 |
+
124,
|
| 255 |
+
125,
|
| 256 |
+
126,
|
| 257 |
+
127,
|
| 258 |
+
128,
|
| 259 |
+
129,
|
| 260 |
+
130,
|
| 261 |
+
131,
|
| 262 |
+
132,
|
| 263 |
+
133,
|
| 264 |
+
134,
|
| 265 |
+
135,
|
| 266 |
+
136,
|
| 267 |
+
137,
|
| 268 |
+
138,
|
| 269 |
+
139,
|
| 270 |
+
140,
|
| 271 |
+
141,
|
| 272 |
+
142,
|
| 273 |
+
143,
|
| 274 |
+
144,
|
| 275 |
+
145,
|
| 276 |
+
146,
|
| 277 |
+
147
|
| 278 |
+
],
|
| 279 |
+
"train_episodes": [
|
| 280 |
+
0,
|
| 281 |
+
1,
|
| 282 |
+
2,
|
| 283 |
+
3,
|
| 284 |
+
4,
|
| 285 |
+
5,
|
| 286 |
+
6,
|
| 287 |
+
7,
|
| 288 |
+
8,
|
| 289 |
+
9,
|
| 290 |
+
10,
|
| 291 |
+
11,
|
| 292 |
+
12,
|
| 293 |
+
13,
|
| 294 |
+
14,
|
| 295 |
+
15,
|
| 296 |
+
16,
|
| 297 |
+
17,
|
| 298 |
+
18,
|
| 299 |
+
19,
|
| 300 |
+
20,
|
| 301 |
+
21,
|
| 302 |
+
22,
|
| 303 |
+
23,
|
| 304 |
+
24,
|
| 305 |
+
25,
|
| 306 |
+
26,
|
| 307 |
+
27,
|
| 308 |
+
28,
|
| 309 |
+
29,
|
| 310 |
+
30,
|
| 311 |
+
31,
|
| 312 |
+
32,
|
| 313 |
+
33,
|
| 314 |
+
34,
|
| 315 |
+
35,
|
| 316 |
+
36,
|
| 317 |
+
37,
|
| 318 |
+
38,
|
| 319 |
+
39,
|
| 320 |
+
40,
|
| 321 |
+
41,
|
| 322 |
+
42,
|
| 323 |
+
43,
|
| 324 |
+
44,
|
| 325 |
+
45,
|
| 326 |
+
46,
|
| 327 |
+
47,
|
| 328 |
+
48,
|
| 329 |
+
49,
|
| 330 |
+
50,
|
| 331 |
+
51,
|
| 332 |
+
52,
|
| 333 |
+
53,
|
| 334 |
+
54,
|
| 335 |
+
55,
|
| 336 |
+
56,
|
| 337 |
+
57,
|
| 338 |
+
58,
|
| 339 |
+
59,
|
| 340 |
+
60,
|
| 341 |
+
61,
|
| 342 |
+
62,
|
| 343 |
+
63,
|
| 344 |
+
64,
|
| 345 |
+
65,
|
| 346 |
+
66,
|
| 347 |
+
67,
|
| 348 |
+
68,
|
| 349 |
+
69,
|
| 350 |
+
70,
|
| 351 |
+
71,
|
| 352 |
+
72,
|
| 353 |
+
73,
|
| 354 |
+
74,
|
| 355 |
+
75,
|
| 356 |
+
76,
|
| 357 |
+
77,
|
| 358 |
+
78,
|
| 359 |
+
79,
|
| 360 |
+
80,
|
| 361 |
+
81,
|
| 362 |
+
82,
|
| 363 |
+
83,
|
| 364 |
+
84,
|
| 365 |
+
85,
|
| 366 |
+
86,
|
| 367 |
+
87,
|
| 368 |
+
88,
|
| 369 |
+
89,
|
| 370 |
+
90,
|
| 371 |
+
91,
|
| 372 |
+
92,
|
| 373 |
+
93,
|
| 374 |
+
94,
|
| 375 |
+
95,
|
| 376 |
+
96,
|
| 377 |
+
97,
|
| 378 |
+
98,
|
| 379 |
+
99,
|
| 380 |
+
100,
|
| 381 |
+
101,
|
| 382 |
+
102,
|
| 383 |
+
103,
|
| 384 |
+
104,
|
| 385 |
+
105,
|
| 386 |
+
106,
|
| 387 |
+
107,
|
| 388 |
+
108,
|
| 389 |
+
109,
|
| 390 |
+
110,
|
| 391 |
+
111,
|
| 392 |
+
112,
|
| 393 |
+
113,
|
| 394 |
+
114,
|
| 395 |
+
115,
|
| 396 |
+
116,
|
| 397 |
+
117,
|
| 398 |
+
118,
|
| 399 |
+
119,
|
| 400 |
+
120,
|
| 401 |
+
121,
|
| 402 |
+
122,
|
| 403 |
+
123,
|
| 404 |
+
124,
|
| 405 |
+
125,
|
| 406 |
+
126,
|
| 407 |
+
127,
|
| 408 |
+
128,
|
| 409 |
+
129,
|
| 410 |
+
130,
|
| 411 |
+
131,
|
| 412 |
+
132,
|
| 413 |
+
133,
|
| 414 |
+
134,
|
| 415 |
+
135,
|
| 416 |
+
136,
|
| 417 |
+
137,
|
| 418 |
+
138,
|
| 419 |
+
139,
|
| 420 |
+
140,
|
| 421 |
+
141,
|
| 422 |
+
142,
|
| 423 |
+
143,
|
| 424 |
+
144,
|
| 425 |
+
145,
|
| 426 |
+
146,
|
| 427 |
+
147
|
| 428 |
+
],
|
| 429 |
+
"val_episodes": [],
|
| 430 |
+
"train_frames": 125290,
|
| 431 |
+
"git_commit": "d60c56c996a71c5df11fb93115792440da5092aa"
|
| 432 |
+
},
|
| 433 |
+
"training": {
|
| 434 |
+
"steps": 5000,
|
| 435 |
+
"batch_size": 512,
|
| 436 |
+
"lr": 0.0001,
|
| 437 |
+
"betas": [
|
| 438 |
+
0.95,
|
| 439 |
+
0.999
|
| 440 |
+
],
|
| 441 |
+
"weight_decay": 1e-06,
|
| 442 |
+
"warmup": 500,
|
| 443 |
+
"schedule": "diffusers_cosine",
|
| 444 |
+
"backbone_lr_scale": 1.0,
|
| 445 |
+
"ema": 0.9999,
|
| 446 |
+
"shift_px": 0,
|
| 447 |
+
"amp": true,
|
| 448 |
+
"seed": 42,
|
| 449 |
+
"augmentation": {
|
| 450 |
+
"spec": "docs/augmentation_v2.md",
|
| 451 |
+
"version": "hb-aug-v2-20261109",
|
| 452 |
+
"implementation": "evaluation/augmentation/hb_aug_v2.py",
|
| 453 |
+
"visual": {
|
| 454 |
+
"effects": [
|
| 455 |
+
"exposure",
|
| 456 |
+
"contrast",
|
| 457 |
+
"saturation",
|
| 458 |
+
"hue",
|
| 459 |
+
"gamma",
|
| 460 |
+
"temperature",
|
| 461 |
+
"rotation_crop",
|
| 462 |
+
"noise",
|
| 463 |
+
"gaussian_blur",
|
| 464 |
+
"jpeg",
|
| 465 |
+
"motion_blur",
|
| 466 |
+
"sharpen",
|
| 467 |
+
"defocus",
|
| 468 |
+
"light_shadow",
|
| 469 |
+
"wb_channel"
|
| 470 |
+
],
|
| 471 |
+
"boosted_per_sample": 1,
|
| 472 |
+
"boost": 1.5,
|
| 473 |
+
"pixel_scale": "H / 224",
|
| 474 |
+
"future_targets": "none (one observation frame)"
|
| 475 |
+
},
|
| 476 |
+
"proprio": {
|
| 477 |
+
"robot": "g1",
|
| 478 |
+
"body_dims": 29,
|
| 479 |
+
"bias_deg": 2.0,
|
| 480 |
+
"bias_scope": "per_sample",
|
| 481 |
+
"noise_deg": 0.25,
|
| 482 |
+
"noise_clip_sigma": 3,
|
| 483 |
+
"delay_probability": 0.0,
|
| 484 |
+
"history_drop_probability": 0.0,
|
| 485 |
+
"velocity": false
|
| 486 |
+
},
|
| 487 |
+
"native_image_augmentation": "off",
|
| 488 |
+
"evaluation": "off"
|
| 489 |
+
},
|
| 490 |
+
"preflight": {
|
| 491 |
+
"samples": 64,
|
| 492 |
+
"state_dim": 44,
|
| 493 |
+
"body_dims": 29,
|
| 494 |
+
"images_changed": 64,
|
| 495 |
+
"body_values_moved": 1.0,
|
| 496 |
+
"max_body_offset_deg": 2.5974,
|
| 497 |
+
"actions_bit_identical": true,
|
| 498 |
+
"non_body_state_bit_identical": true,
|
| 499 |
+
"eval_items_deterministic": 8
|
| 500 |
+
},
|
| 501 |
+
"aug_seed": 42,
|
| 502 |
+
"layout": {
|
| 503 |
+
"nodes": 1,
|
| 504 |
+
"gpus": 1,
|
| 505 |
+
"per_gpu_batch": 512,
|
| 506 |
+
"global_batch": 512,
|
| 507 |
+
"gradient_accumulation": 1,
|
| 508 |
+
"num_workers": 32,
|
| 509 |
+
"prefetch": 2
|
| 510 |
+
},
|
| 511 |
+
"continuation": null,
|
| 512 |
+
"total_steps": 5000,
|
| 513 |
+
"save_steps": [
|
| 514 |
+
750,
|
| 515 |
+
1750,
|
| 516 |
+
2500,
|
| 517 |
+
3250,
|
| 518 |
+
4250,
|
| 519 |
+
5000
|
| 520 |
+
],
|
| 521 |
+
"save_rule": "6 checkpoints spread evenly over the steps on the 250-step grid (owner 2026-11-27)",
|
| 522 |
+
"protocol_exceptions": [],
|
| 523 |
+
"ema_schedule": "diffusion_policy_emamodel",
|
| 524 |
+
"inloop": {
|
| 525 |
+
"task": "a10v3",
|
| 526 |
+
"code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse",
|
| 527 |
+
"every": 250,
|
| 528 |
+
"exception": null,
|
| 529 |
+
"code_sha256": {
|
| 530 |
+
"hb_inloop_core.py": "6c7c160f05cc624eeebd0721c5241b52d2b6b64ac25cd1e9fd72e0b8a6aca8e6",
|
| 531 |
+
"hb_eval_common.py": "c26efcb8e6c49be8b5883ec187e5b7292bd19d81c4442ba5ee1ba35e9bb8c8a6"
|
| 532 |
+
}
|
| 533 |
+
},
|
| 534 |
+
"protocol_recipe": {
|
| 535 |
+
"batch_size": 512,
|
| 536 |
+
"steps": 5000,
|
| 537 |
+
"warmup": 500,
|
| 538 |
+
"workers": 32,
|
| 539 |
+
"long_task_factor": 1
|
| 540 |
+
},
|
| 541 |
+
"protocol_deviations": [],
|
| 542 |
+
"environment": {
|
| 543 |
+
"python": "3.12.12",
|
| 544 |
+
"torch": "2.9.0+cu128",
|
| 545 |
+
"numpy": "2.2.6",
|
| 546 |
+
"cuda": "12.8",
|
| 547 |
+
"cudnn": 91002,
|
| 548 |
+
"torchvision": "0.24.0+cu128",
|
| 549 |
+
"pillow": "13.0.0",
|
| 550 |
+
"gpu": "NVIDIA A800-SXM4-80GB",
|
| 551 |
+
"driver": "570.133.20"
|
| 552 |
+
},
|
| 553 |
+
"code_dirty": null,
|
| 554 |
+
"allow_dirty_tree": false,
|
| 555 |
+
"augmentation_sha256": "9f7713cea4f846efcfc924234267ced48210357f419d67915c10b504316bedde",
|
| 556 |
+
"order": "EpochSampler: default_rng([seed, 1, epoch]) permutation; augmentation default_rng([aug_seed, draw])",
|
| 557 |
+
"upstream": "NTUMARS/ODE-POLICY real-g1@fd8bec47 (G1 port, HumanWAM packages/ode_g1) + main@cea26d94 (encoder, ode_dit field, default_train.yaml)"
|
| 558 |
+
},
|
| 559 |
+
"stats": {
|
| 560 |
+
"state": {
|
| 561 |
+
"min": [
|
| 562 |
+
-0.5649979114532471,
|
| 563 |
+
-0.13802263140678406,
|
| 564 |
+
-0.1670541912317276,
|
| 565 |
+
0.12547282874584198,
|
| 566 |
+
-0.7361007332801819,
|
| 567 |
+
-0.21955746412277222,
|
| 568 |
+
-0.5882344245910645,
|
| 569 |
+
-0.3116748631000519,
|
| 570 |
+
-0.46413329243659973,
|
| 571 |
+
0.11360634118318558,
|
| 572 |
+
-0.5077619552612305,
|
| 573 |
+
-0.1829676479101181,
|
| 574 |
+
-0.10724634677171707,
|
| 575 |
+
-0.08531239628791809,
|
| 576 |
+
-0.018562935292720795,
|
| 577 |
+
-0.7220436334609985,
|
| 578 |
+
-0.18919637799263,
|
| 579 |
+
-0.6303816437721252,
|
| 580 |
+
-0.6336395144462585,
|
| 581 |
+
0.6115855574607849,
|
| 582 |
+
-0.3079671561717987,
|
| 583 |
+
-0.6135874390602112,
|
| 584 |
+
-0.7832939028739929,
|
| 585 |
+
-0.5058244466781616,
|
| 586 |
+
-0.2831243574619293,
|
| 587 |
+
-0.6437979936599731,
|
| 588 |
+
-1.6898001432418823,
|
| 589 |
+
-0.19531497359275818,
|
| 590 |
+
-0.41606205701828003,
|
| 591 |
+
0.28926292061805725,
|
| 592 |
+
0.2978215515613556,
|
| 593 |
+
0.2999863028526306,
|
| 594 |
+
0.3241505026817322,
|
| 595 |
+
0.4532031714916229,
|
| 596 |
+
0.0,
|
| 597 |
+
0.28560081124305725,
|
| 598 |
+
0.2877190411090851,
|
| 599 |
+
0.2999747097492218,
|
| 600 |
+
0.3188680410385132,
|
| 601 |
+
0.2645348310470581,
|
| 602 |
+
0.0,
|
| 603 |
+
-0.20698592066764832,
|
| 604 |
+
-0.09532465785741806,
|
| 605 |
+
-1.0
|
| 606 |
+
],
|
| 607 |
+
"max": [
|
| 608 |
+
0.309661328792572,
|
| 609 |
+
0.379180908203125,
|
| 610 |
+
0.3793095648288727,
|
| 611 |
+
1.2328346967697144,
|
| 612 |
+
0.47058796882629395,
|
| 613 |
+
0.15291371941566467,
|
| 614 |
+
0.19136027991771698,
|
| 615 |
+
0.15236611664295197,
|
| 616 |
+
-0.015697233378887177,
|
| 617 |
+
1.1718807220458984,
|
| 618 |
+
0.5186899304389954,
|
| 619 |
+
0.14761242270469666,
|
| 620 |
+
0.1112193688750267,
|
| 621 |
+
0.0773688405752182,
|
| 622 |
+
0.1617131233215332,
|
| 623 |
+
1.00409996509552,
|
| 624 |
+
0.8376004099845886,
|
| 625 |
+
0.5049045085906982,
|
| 626 |
+
0.8701820969581604,
|
| 627 |
+
1.5639278888702393,
|
| 628 |
+
0.5088244676589966,
|
| 629 |
+
0.17580963671207428,
|
| 630 |
+
1.0189212560653687,
|
| 631 |
+
0.14113207161426544,
|
| 632 |
+
1.1240776777267456,
|
| 633 |
+
0.9259319305419922,
|
| 634 |
+
-0.5317077040672302,
|
| 635 |
+
0.5406411290168762,
|
| 636 |
+
0.2410225123167038,
|
| 637 |
+
0.9997925758361816,
|
| 638 |
+
1.0,
|
| 639 |
+
1.0,
|
| 640 |
+
1.0,
|
| 641 |
+
1.0,
|
| 642 |
+
0.9993118047714233,
|
| 643 |
+
1.0,
|
| 644 |
+
0.999999463558197,
|
| 645 |
+
1.0,
|
| 646 |
+
1.0,
|
| 647 |
+
1.0,
|
| 648 |
+
1.0,
|
| 649 |
+
0.1430673897266388,
|
| 650 |
+
0.1608637273311615,
|
| 651 |
+
-0.9776055812835693
|
| 652 |
+
],
|
| 653 |
+
"mean": [
|
| 654 |
+
-0.03259149700071818,
|
| 655 |
+
0.10292444149082529,
|
| 656 |
+
0.14249111690247215,
|
| 657 |
+
0.2586853334339307,
|
| 658 |
+
-0.13208746169373772,
|
| 659 |
+
-0.04728850229841452,
|
| 660 |
+
-0.057759515038012764,
|
| 661 |
+
-0.06284486123386064,
|
| 662 |
+
-0.2184019612651195,
|
| 663 |
+
0.2452933834388023,
|
| 664 |
+
-0.11712754842266818,
|
| 665 |
+
0.0048785726169163915,
|
| 666 |
+
-0.004230145816850251,
|
| 667 |
+
0.003071327284655127,
|
| 668 |
+
0.09238250920443919,
|
| 669 |
+
0.1588980504213021,
|
| 670 |
+
0.1931384421498494,
|
| 671 |
+
-0.1042624106421826,
|
| 672 |
+
-0.07162919313633376,
|
| 673 |
+
1.2364839745900875,
|
| 674 |
+
0.11456040760956449,
|
| 675 |
+
-0.02982258333000492,
|
| 676 |
+
0.12297573380987696,
|
| 677 |
+
-0.1314084334755782,
|
| 678 |
+
0.2841458952024311,
|
| 679 |
+
-0.024690842999814416,
|
| 680 |
+
-1.2646153851212503,
|
| 681 |
+
0.13921934353286197,
|
| 682 |
+
-0.0051523384937139476,
|
| 683 |
+
0.7584627563567199,
|
| 684 |
+
0.7347248990636687,
|
| 685 |
+
0.7359466597474728,
|
| 686 |
+
0.7434046703440507,
|
| 687 |
+
0.8677225796256197,
|
| 688 |
+
0.18050129081743033,
|
| 689 |
+
0.7157243621259897,
|
| 690 |
+
0.7192522151209102,
|
| 691 |
+
0.7318337730585849,
|
| 692 |
+
0.7466828414938838,
|
| 693 |
+
0.8631709350224399,
|
| 694 |
+
0.18055928431852253,
|
| 695 |
+
-0.042149546611078066,
|
| 696 |
+
0.009104512566997977,
|
| 697 |
+
-0.9984240542430339
|
| 698 |
+
],
|
| 699 |
+
"std": [
|
| 700 |
+
0.14332528920223156,
|
| 701 |
+
0.050326975118008516,
|
| 702 |
+
0.05447536225043596,
|
| 703 |
+
0.18542866648901002,
|
| 704 |
+
0.09795413152590728,
|
| 705 |
+
0.040414279934421656,
|
| 706 |
+
0.1314410589437231,
|
| 707 |
+
0.04705665020366312,
|
| 708 |
+
0.05069233811524638,
|
| 709 |
+
0.15587224743782863,
|
| 710 |
+
0.08590396003577097,
|
| 711 |
+
0.045061991383975486,
|
| 712 |
+
0.021383485564564507,
|
| 713 |
+
0.014773382285823268,
|
| 714 |
+
0.023373377725290283,
|
| 715 |
+
0.3311819219220262,
|
| 716 |
+
0.10532448629122226,
|
| 717 |
+
0.12440342036807371,
|
| 718 |
+
0.3243145748636537,
|
| 719 |
+
0.10518505753045373,
|
| 720 |
+
0.08286589309217163,
|
| 721 |
+
0.07242343474690907,
|
| 722 |
+
0.3441978307840592,
|
| 723 |
+
0.1108561220333568,
|
| 724 |
+
0.17804600736368034,
|
| 725 |
+
0.32602324245623393,
|
| 726 |
+
0.1009863076683941,
|
| 727 |
+
0.05984207969250063,
|
| 728 |
+
0.05603953470424581,
|
| 729 |
+
0.28970257569536595,
|
| 730 |
+
0.30400373906907074,
|
| 731 |
+
0.3010014700359181,
|
| 732 |
+
0.29230853834349046,
|
| 733 |
+
0.17118303819521438,
|
| 734 |
+
0.3785607898211561,
|
| 735 |
+
0.3253747707974398,
|
| 736 |
+
0.32108122353058915,
|
| 737 |
+
0.3064997790556862,
|
| 738 |
+
0.2895646717445341,
|
| 739 |
+
0.17312796927521015,
|
| 740 |
+
0.37853011602794057,
|
| 741 |
+
0.029836058972889025,
|
| 742 |
+
0.01995769633452533,
|
| 743 |
+
0.0011964531867846406
|
| 744 |
+
],
|
| 745 |
+
"q01": [
|
| 746 |
+
-0.46048143863677976,
|
| 747 |
+
-0.001417565532028675,
|
| 748 |
+
-0.019787334837019437,
|
| 749 |
+
0.1400335283577442,
|
| 750 |
+
-0.40042722046375273,
|
| 751 |
+
-0.1500592675805092,
|
| 752 |
+
-0.4469831359386444,
|
| 753 |
+
-0.20127003654837608,
|
| 754 |
+
-0.35273449271917345,
|
| 755 |
+
0.13117286264896394,
|
| 756 |
+
-0.31278882563114163,
|
| 757 |
+
-0.10695050276815891,
|
| 758 |
+
-0.06434167601168156,
|
| 759 |
+
-0.03814786046743393,
|
| 760 |
+
0.0030093658366240577,
|
| 761 |
+
-0.5162069481611252,
|
| 762 |
+
-0.031657121963798995,
|
| 763 |
+
-0.3940638452768326,
|
| 764 |
+
-0.5422306978702545,
|
| 765 |
+
0.9766830176115036,
|
| 766 |
+
-0.13969131857156752,
|
| 767 |
+
-0.24476195588707925,
|
| 768 |
+
-0.5818968629837036,
|
| 769 |
+
-0.3349967387318611,
|
| 770 |
+
-0.02889954417943954,
|
| 771 |
+
-0.5198817837238312,
|
| 772 |
+
-1.4832872450351715,
|
| 773 |
+
0.00666264486499131,
|
| 774 |
+
-0.16844903901219366,
|
| 775 |
+
0.3000469207763672,
|
| 776 |
+
0.3000378906726837,
|
| 777 |
+
0.300070583820343,
|
| 778 |
+
0.3319503664970398,
|
| 779 |
+
0.4941388964653015,
|
| 780 |
+
0.0,
|
| 781 |
+
0.2999802529811859,
|
| 782 |
+
0.3000173270702362,
|
| 783 |
+
0.3000636100769043,
|
| 784 |
+
0.32894015312194824,
|
| 785 |
+
0.5052923560142517,
|
| 786 |
+
0.0,
|
| 787 |
+
-0.09914009734988212,
|
| 788 |
+
-0.025850909166038036,
|
| 789 |
+
-0.9999485015869141
|
| 790 |
+
],
|
| 791 |
+
"q99": [
|
| 792 |
+
0.20422495111823086,
|
| 793 |
+
0.25848694026470187,
|
| 794 |
+
0.2645684388279915,
|
| 795 |
+
1.0600767815113068,
|
| 796 |
+
0.07926157340407373,
|
| 797 |
+
0.05578560329973699,
|
| 798 |
+
0.12076335318386557,
|
| 799 |
+
0.0634762664884329,
|
| 800 |
+
-0.09861872553825378,
|
| 801 |
+
0.9024305552244187,
|
| 802 |
+
0.08224537916481496,
|
| 803 |
+
0.10222977459430696,
|
| 804 |
+
0.05355732761323453,
|
| 805 |
+
0.03978750210255386,
|
| 806 |
+
0.1318538938462734,
|
| 807 |
+
0.8845052689313889,
|
| 808 |
+
0.4733697807788849,
|
| 809 |
+
0.21367629334330562,
|
| 810 |
+
0.740164201259613,
|
| 811 |
+
1.455635689496994,
|
| 812 |
+
0.2315270981192589,
|
| 813 |
+
0.09163028463721276,
|
| 814 |
+
0.8678649854660034,
|
| 815 |
+
0.09198425464332108,
|
| 816 |
+
0.7561256486177446,
|
| 817 |
+
0.8060805976390839,
|
| 818 |
+
-0.9242562597990035,
|
| 819 |
+
0.330000014603138,
|
| 820 |
+
0.13720838129520418,
|
| 821 |
+
0.9997493028640747,
|
| 822 |
+
0.9996715849637985,
|
| 823 |
+
0.9996342724561691,
|
| 824 |
+
0.9996714061498642,
|
| 825 |
+
1.0,
|
| 826 |
+
0.9991828799247742,
|
| 827 |
+
0.9997599720954895,
|
| 828 |
+
0.9996874332427979,
|
| 829 |
+
0.9996535778045654,
|
| 830 |
+
0.9996883869171143,
|
| 831 |
+
1.0,
|
| 832 |
+
0.9991675019264221,
|
| 833 |
+
0.0729682007431984,
|
| 834 |
+
0.08541205741465092,
|
| 835 |
+
-0.9938413059711456
|
| 836 |
+
],
|
| 837 |
+
"unit_dims": [
|
| 838 |
+
29,
|
| 839 |
+
30,
|
| 840 |
+
31,
|
| 841 |
+
32,
|
| 842 |
+
33,
|
| 843 |
+
34,
|
| 844 |
+
35,
|
| 845 |
+
36,
|
| 846 |
+
37,
|
| 847 |
+
38,
|
| 848 |
+
39,
|
| 849 |
+
40
|
| 850 |
+
]
|
| 851 |
+
},
|
| 852 |
+
"action": {
|
| 853 |
+
"min": [
|
| 854 |
+
-0.4375,
|
| 855 |
+
-0.4375,
|
| 856 |
+
-0.5625,
|
| 857 |
+
-0.4375,
|
| 858 |
+
-0.5,
|
| 859 |
+
-0.0625,
|
| 860 |
+
-0.1875,
|
| 861 |
+
-0.5,
|
| 862 |
+
-0.25,
|
| 863 |
+
-0.4375,
|
| 864 |
+
-0.4375,
|
| 865 |
+
-0.375,
|
| 866 |
+
-0.4375,
|
| 867 |
+
-0.1875,
|
| 868 |
+
-0.0625,
|
| 869 |
+
-0.3125,
|
| 870 |
+
-0.0625,
|
| 871 |
+
-0.125,
|
| 872 |
+
-0.5,
|
| 873 |
+
-0.25,
|
| 874 |
+
-0.625,
|
| 875 |
+
-0.5,
|
| 876 |
+
-0.25,
|
| 877 |
+
0.0,
|
| 878 |
+
-0.25,
|
| 879 |
+
-0.25,
|
| 880 |
+
-0.3125,
|
| 881 |
+
-0.25,
|
| 882 |
+
-0.25,
|
| 883 |
+
-0.1875,
|
| 884 |
+
-0.375,
|
| 885 |
+
-0.1875,
|
| 886 |
+
-0.0625,
|
| 887 |
+
-0.375,
|
| 888 |
+
-0.375,
|
| 889 |
+
-0.375,
|
| 890 |
+
0.0,
|
| 891 |
+
-0.4375,
|
| 892 |
+
-0.3125,
|
| 893 |
+
-0.3125,
|
| 894 |
+
-0.3125,
|
| 895 |
+
-0.5,
|
| 896 |
+
-0.5,
|
| 897 |
+
-0.25,
|
| 898 |
+
-0.3125,
|
| 899 |
+
-0.3125,
|
| 900 |
+
-0.375,
|
| 901 |
+
-0.5,
|
| 902 |
+
0.0,
|
| 903 |
+
-0.25,
|
| 904 |
+
-0.5,
|
| 905 |
+
-0.3125,
|
| 906 |
+
-0.3125,
|
| 907 |
+
-0.3125,
|
| 908 |
+
-0.3125,
|
| 909 |
+
-0.375,
|
| 910 |
+
-0.4375,
|
| 911 |
+
-0.125,
|
| 912 |
+
-0.1875,
|
| 913 |
+
-0.5,
|
| 914 |
+
-0.6875,
|
| 915 |
+
-0.3125,
|
| 916 |
+
-0.3125,
|
| 917 |
+
-0.5,
|
| 918 |
+
0.28926292061805725,
|
| 919 |
+
0.2978215515613556,
|
| 920 |
+
0.2999863028526306,
|
| 921 |
+
0.3241505026817322,
|
| 922 |
+
0.4532031714916229,
|
| 923 |
+
0.0,
|
| 924 |
+
0.28560081124305725,
|
| 925 |
+
0.2877190411090851,
|
| 926 |
+
0.2999747097492218,
|
| 927 |
+
0.3188680410385132,
|
| 928 |
+
0.2645348310470581,
|
| 929 |
+
0.0
|
| 930 |
+
],
|
| 931 |
+
"max": [
|
| 932 |
+
0.25,
|
| 933 |
+
0.3125,
|
| 934 |
+
0.125,
|
| 935 |
+
0.25,
|
| 936 |
+
0.4375,
|
| 937 |
+
0.5625,
|
| 938 |
+
0.375,
|
| 939 |
+
0.25,
|
| 940 |
+
0.375,
|
| 941 |
+
0.0625,
|
| 942 |
+
0.0625,
|
| 943 |
+
0.1875,
|
| 944 |
+
0.3125,
|
| 945 |
+
0.75,
|
| 946 |
+
0.5,
|
| 947 |
+
0.3125,
|
| 948 |
+
0.3125,
|
| 949 |
+
0.375,
|
| 950 |
+
0.125,
|
| 951 |
+
0.4375,
|
| 952 |
+
0.1875,
|
| 953 |
+
0.5625,
|
| 954 |
+
0.3125,
|
| 955 |
+
0.5,
|
| 956 |
+
0.3125,
|
| 957 |
+
0.5,
|
| 958 |
+
0.125,
|
| 959 |
+
0.5625,
|
| 960 |
+
0.375,
|
| 961 |
+
0.5,
|
| 962 |
+
0.5625,
|
| 963 |
+
0.5,
|
| 964 |
+
0.5,
|
| 965 |
+
0.5,
|
| 966 |
+
0.3125,
|
| 967 |
+
0.1875,
|
| 968 |
+
0.6875,
|
| 969 |
+
0.1875,
|
| 970 |
+
0.625,
|
| 971 |
+
0.0625,
|
| 972 |
+
0.3125,
|
| 973 |
+
0.25,
|
| 974 |
+
0.25,
|
| 975 |
+
0.1875,
|
| 976 |
+
0.3125,
|
| 977 |
+
0.1875,
|
| 978 |
+
0.25,
|
| 979 |
+
0.375,
|
| 980 |
+
0.75,
|
| 981 |
+
0.5625,
|
| 982 |
+
0.5,
|
| 983 |
+
0.375,
|
| 984 |
+
0.4375,
|
| 985 |
+
0.375,
|
| 986 |
+
0.25,
|
| 987 |
+
0.3125,
|
| 988 |
+
0.1875,
|
| 989 |
+
0.25,
|
| 990 |
+
0.1875,
|
| 991 |
+
0.25,
|
| 992 |
+
-0.3125,
|
| 993 |
+
0.25,
|
| 994 |
+
0.5,
|
| 995 |
+
0.375,
|
| 996 |
+
0.9997925758361816,
|
| 997 |
+
1.0,
|
| 998 |
+
1.0,
|
| 999 |
+
1.0,
|
| 1000 |
+
1.0,
|
| 1001 |
+
0.9993118047714233,
|
| 1002 |
+
1.0,
|
| 1003 |
+
0.999999463558197,
|
| 1004 |
+
1.0,
|
| 1005 |
+
1.0,
|
| 1006 |
+
1.0,
|
| 1007 |
+
1.0
|
| 1008 |
+
],
|
| 1009 |
+
"mean": [
|
| 1010 |
+
-0.06629070556309362,
|
| 1011 |
+
-0.05511014446484157,
|
| 1012 |
+
-0.22505886343682657,
|
| 1013 |
+
-0.039107769973661104,
|
| 1014 |
+
-0.04682386862479049,
|
| 1015 |
+
0.3142594181498922,
|
| 1016 |
+
0.06716717216058744,
|
| 1017 |
+
-0.015287532923617208,
|
| 1018 |
+
0.08235743076063533,
|
| 1019 |
+
-0.17423327879319978,
|
| 1020 |
+
-0.20464023465559902,
|
| 1021 |
+
-0.03392479447681379,
|
| 1022 |
+
0.03874261712826243,
|
| 1023 |
+
0.2375,
|
| 1024 |
+
0.1918529012690558,
|
| 1025 |
+
0.05225077819458855,
|
| 1026 |
+
0.16261922340170804,
|
| 1027 |
+
0.1694284260515604,
|
| 1028 |
+
-0.17236411525261394,
|
| 1029 |
+
0.12906207598371777,
|
| 1030 |
+
-0.11041334104876686,
|
| 1031 |
+
-0.09034489983238886,
|
| 1032 |
+
0.07829086519275281,
|
| 1033 |
+
0.22341667331790246,
|
| 1034 |
+
-0.016289707877723682,
|
| 1035 |
+
0.05943411285816905,
|
| 1036 |
+
-0.11190338414877485,
|
| 1037 |
+
0.11185998483518238,
|
| 1038 |
+
0.03395073429643228,
|
| 1039 |
+
0.11506903982759997,
|
| 1040 |
+
0.039812135844839974,
|
| 1041 |
+
0.17395841647378082,
|
| 1042 |
+
0.2093303535796951,
|
| 1043 |
+
0.12787433155080213,
|
| 1044 |
+
0.05439081331311358,
|
| 1045 |
+
-0.15496298587277516,
|
| 1046 |
+
0.19578278394125628,
|
| 1047 |
+
-0.15189310798946445,
|
| 1048 |
+
-0.04390713544576582,
|
| 1049 |
+
-0.14537971905179983,
|
| 1050 |
+
-0.09730674834384229,
|
| 1051 |
+
-0.06830702769574587,
|
| 1052 |
+
-0.20630387500997685,
|
| 1053 |
+
-0.07832927607949557,
|
| 1054 |
+
-0.043487608747705325,
|
| 1055 |
+
0.023496488147497805,
|
| 1056 |
+
-9.478011014446484e-06,
|
| 1057 |
+
0.006343782424774523,
|
| 1058 |
+
0.4254489584164738,
|
| 1059 |
+
0.19045863596456222,
|
| 1060 |
+
0.0642414598132333,
|
| 1061 |
+
0.11013349030249821,
|
| 1062 |
+
-0.03714931359246548,
|
| 1063 |
+
0.06375209513927688,
|
| 1064 |
+
-0.06714322771170883,
|
| 1065 |
+
-0.10344750179583366,
|
| 1066 |
+
-0.016653364195067445,
|
| 1067 |
+
0.035530569079735015,
|
| 1068 |
+
-0.006146240721526059,
|
| 1069 |
+
-0.11385984515923059,
|
| 1070 |
+
-0.6169801061537233,
|
| 1071 |
+
0.07215659669566606,
|
| 1072 |
+
-0.062095937425173595,
|
| 1073 |
+
-0.06103539787692553,
|
| 1074 |
+
0.7584627563567199,
|
| 1075 |
+
0.7347248990636687,
|
| 1076 |
+
0.7359466597474728,
|
| 1077 |
+
0.7434046703440507,
|
| 1078 |
+
0.8677225796256197,
|
| 1079 |
+
0.18050129081743033,
|
| 1080 |
+
0.7157243621259897,
|
| 1081 |
+
0.7192522151209102,
|
| 1082 |
+
0.7318337730585849,
|
| 1083 |
+
0.7466828414938838,
|
| 1084 |
+
0.8631709350224399,
|
| 1085 |
+
0.18055928431852253
|
| 1086 |
+
],
|
| 1087 |
+
"std": [
|
| 1088 |
+
0.08355496121131518,
|
| 1089 |
+
0.09326184648072526,
|
| 1090 |
+
0.08203358498822505,
|
| 1091 |
+
0.06955414567790866,
|
| 1092 |
+
0.10596747618875023,
|
| 1093 |
+
0.07795442659140216,
|
| 1094 |
+
0.07092115557940734,
|
| 1095 |
+
0.12551970791788017,
|
| 1096 |
+
0.07726665297605524,
|
| 1097 |
+
0.08503618788026966,
|
| 1098 |
+
0.04939946109970159,
|
| 1099 |
+
0.0642530465250632,
|
| 1100 |
+
0.10165332059491544,
|
| 1101 |
+
0.16715226435676253,
|
| 1102 |
+
0.07978636779653304,
|
| 1103 |
+
0.062093797277847175,
|
| 1104 |
+
0.06906049598665721,
|
| 1105 |
+
0.061107210734037076,
|
| 1106 |
+
0.10103219576880981,
|
| 1107 |
+
0.12552738140001207,
|
| 1108 |
+
0.11307675563355261,
|
| 1109 |
+
0.1315226204681107,
|
| 1110 |
+
0.0539603663638299,
|
| 1111 |
+
0.07761860329949177,
|
| 1112 |
+
0.0814798817598654,
|
| 1113 |
+
0.08871903770821819,
|
| 1114 |
+
0.042644450865256506,
|
| 1115 |
+
0.11889695762095398,
|
| 1116 |
+
0.09244965300262262,
|
| 1117 |
+
0.08260374980620613,
|
| 1118 |
+
0.1694667219988425,
|
| 1119 |
+
0.08529732186866353,
|
| 1120 |
+
0.07239679018020305,
|
| 1121 |
+
0.11005592215273363,
|
| 1122 |
+
0.09032910022286104,
|
| 1123 |
+
0.06908623040805847,
|
| 1124 |
+
0.09871646552427954,
|
| 1125 |
+
0.1239992628273514,
|
| 1126 |
+
0.1433562434186525,
|
| 1127 |
+
0.05147929395251614,
|
| 1128 |
+
0.07641809442013198,
|
| 1129 |
+
0.105798513365219,
|
| 1130 |
+
0.09447674175568083,
|
| 1131 |
+
0.062372487097606795,
|
| 1132 |
+
0.09040021909821346,
|
| 1133 |
+
0.06330894955736102,
|
| 1134 |
+
0.1000297074555641,
|
| 1135 |
+
0.09828292929155315,
|
| 1136 |
+
0.11854148907613134,
|
| 1137 |
+
0.1441671361875703,
|
| 1138 |
+
0.10845541642742883,
|
| 1139 |
+
0.12332705685672458,
|
| 1140 |
+
0.11286697307607886,
|
| 1141 |
+
0.07940003144723148,
|
| 1142 |
+
0.09312402313087363,
|
| 1143 |
+
0.0724733252946844,
|
| 1144 |
+
0.09132727788851353,
|
| 1145 |
+
0.07193283597257298,
|
| 1146 |
+
0.062306487349445695,
|
| 1147 |
+
0.0846974241318232,
|
| 1148 |
+
0.04614175344349353,
|
| 1149 |
+
0.07787907390454928,
|
| 1150 |
+
0.09273522667792361,
|
| 1151 |
+
0.15382179172960914,
|
| 1152 |
+
0.28970257569536595,
|
| 1153 |
+
0.30400373906907074,
|
| 1154 |
+
0.3010014700359181,
|
| 1155 |
+
0.29230853834349046,
|
| 1156 |
+
0.17118303819521438,
|
| 1157 |
+
0.3785607898211561,
|
| 1158 |
+
0.3253747707974398,
|
| 1159 |
+
0.32108122353058915,
|
| 1160 |
+
0.3064997790556862,
|
| 1161 |
+
0.2895646717445341,
|
| 1162 |
+
0.17312796927521015,
|
| 1163 |
+
0.37853011602794057
|
| 1164 |
+
],
|
| 1165 |
+
"q01": [
|
| 1166 |
+
-0.25,
|
| 1167 |
+
-0.25,
|
| 1168 |
+
-0.375,
|
| 1169 |
+
-0.25,
|
| 1170 |
+
-0.3125,
|
| 1171 |
+
0.0625,
|
| 1172 |
+
-0.0625,
|
| 1173 |
+
-0.3125,
|
| 1174 |
+
-0.125,
|
| 1175 |
+
-0.3125,
|
| 1176 |
+
-0.3125,
|
| 1177 |
+
-0.1875,
|
| 1178 |
+
-0.25,
|
| 1179 |
+
-0.125,
|
| 1180 |
+
0.0625,
|
| 1181 |
+
-0.125,
|
| 1182 |
+
0.0,
|
| 1183 |
+
0.0,
|
| 1184 |
+
-0.375,
|
| 1185 |
+
-0.1875,
|
| 1186 |
+
-0.375,
|
| 1187 |
+
-0.375,
|
| 1188 |
+
-0.0625,
|
| 1189 |
+
0.0625,
|
| 1190 |
+
-0.1875,
|
| 1191 |
+
-0.125,
|
| 1192 |
+
-0.1875,
|
| 1193 |
+
-0.125,
|
| 1194 |
+
-0.125,
|
| 1195 |
+
-0.0625,
|
| 1196 |
+
-0.3125,
|
| 1197 |
+
-0.0625,
|
| 1198 |
+
0.0625,
|
| 1199 |
+
-0.125,
|
| 1200 |
+
-0.1875,
|
| 1201 |
+
-0.3125,
|
| 1202 |
+
0.0625,
|
| 1203 |
+
-0.375,
|
| 1204 |
+
-0.3125,
|
| 1205 |
+
-0.25,
|
| 1206 |
+
-0.1875,
|
| 1207 |
+
-0.375,
|
| 1208 |
+
-0.375,
|
| 1209 |
+
-0.1875,
|
| 1210 |
+
-0.25,
|
| 1211 |
+
-0.125,
|
| 1212 |
+
-0.25,
|
| 1213 |
+
-0.3125,
|
| 1214 |
+
0.1875,
|
| 1215 |
+
-0.125,
|
| 1216 |
+
-0.25,
|
| 1217 |
+
-0.1875,
|
| 1218 |
+
-0.25,
|
| 1219 |
+
-0.125,
|
| 1220 |
+
-0.25,
|
| 1221 |
+
-0.25,
|
| 1222 |
+
-0.25,
|
| 1223 |
+
-0.0625,
|
| 1224 |
+
-0.125,
|
| 1225 |
+
-0.3125,
|
| 1226 |
+
-0.6875,
|
| 1227 |
+
-0.1875,
|
| 1228 |
+
-0.25,
|
| 1229 |
+
-0.375,
|
| 1230 |
+
0.3000469207763672,
|
| 1231 |
+
0.3000378906726837,
|
| 1232 |
+
0.300070583820343,
|
| 1233 |
+
0.3319503664970398,
|
| 1234 |
+
0.4941388964653015,
|
| 1235 |
+
0.0,
|
| 1236 |
+
0.2999802529811859,
|
| 1237 |
+
0.3000173270702362,
|
| 1238 |
+
0.3000636100769043,
|
| 1239 |
+
0.32894015312194824,
|
| 1240 |
+
0.5052923560142517,
|
| 1241 |
+
0.0
|
| 1242 |
+
],
|
| 1243 |
+
"q99": [
|
| 1244 |
+
0.125,
|
| 1245 |
+
0.1875,
|
| 1246 |
+
-0.0625,
|
| 1247 |
+
0.125,
|
| 1248 |
+
0.1875,
|
| 1249 |
+
0.4375,
|
| 1250 |
+
0.25,
|
| 1251 |
+
0.1875,
|
| 1252 |
+
0.25,
|
| 1253 |
+
0.0,
|
| 1254 |
+
-0.0625,
|
| 1255 |
+
0.125,
|
| 1256 |
+
0.25,
|
| 1257 |
+
0.5625,
|
| 1258 |
+
0.375,
|
| 1259 |
+
0.1875,
|
| 1260 |
+
0.25,
|
| 1261 |
+
0.3125,
|
| 1262 |
+
0.0,
|
| 1263 |
+
0.375,
|
| 1264 |
+
0.125,
|
| 1265 |
+
0.25,
|
| 1266 |
+
0.1875,
|
| 1267 |
+
0.375,
|
| 1268 |
+
0.1875,
|
| 1269 |
+
0.25,
|
| 1270 |
+
0.0,
|
| 1271 |
+
0.4375,
|
| 1272 |
+
0.25,
|
| 1273 |
+
0.3125,
|
| 1274 |
+
0.4375,
|
| 1275 |
+
0.375,
|
| 1276 |
+
0.375,
|
| 1277 |
+
0.375,
|
| 1278 |
+
0.25,
|
| 1279 |
+
0.0,
|
| 1280 |
+
0.5625,
|
| 1281 |
+
0.125,
|
| 1282 |
+
0.3125,
|
| 1283 |
+
0.0,
|
| 1284 |
+
0.125,
|
| 1285 |
+
0.125,
|
| 1286 |
+
0.0625,
|
| 1287 |
+
0.0625,
|
| 1288 |
+
0.25,
|
| 1289 |
+
0.125,
|
| 1290 |
+
0.1875,
|
| 1291 |
+
0.1875,
|
| 1292 |
+
0.625,
|
| 1293 |
+
0.5,
|
| 1294 |
+
0.3125,
|
| 1295 |
+
0.375,
|
| 1296 |
+
0.25,
|
| 1297 |
+
0.25,
|
| 1298 |
+
0.125,
|
| 1299 |
+
0.125,
|
| 1300 |
+
0.125,
|
| 1301 |
+
0.1875,
|
| 1302 |
+
0.125,
|
| 1303 |
+
0.125,
|
| 1304 |
+
-0.5,
|
| 1305 |
+
0.1875,
|
| 1306 |
+
0.25,
|
| 1307 |
+
0.25,
|
| 1308 |
+
0.9997493028640747,
|
| 1309 |
+
0.9996715849637985,
|
| 1310 |
+
0.9996342724561691,
|
| 1311 |
+
0.9996714061498642,
|
| 1312 |
+
1.0,
|
| 1313 |
+
0.9991828799247742,
|
| 1314 |
+
0.9997599720954895,
|
| 1315 |
+
0.9996874332427979,
|
| 1316 |
+
0.9996535778045654,
|
| 1317 |
+
0.9996883869171143,
|
| 1318 |
+
1.0,
|
| 1319 |
+
0.9991675019264221
|
| 1320 |
+
],
|
| 1321 |
+
"unit_dims": [
|
| 1322 |
+
64,
|
| 1323 |
+
65,
|
| 1324 |
+
66,
|
| 1325 |
+
67,
|
| 1326 |
+
68,
|
| 1327 |
+
69,
|
| 1328 |
+
70,
|
| 1329 |
+
71,
|
| 1330 |
+
72,
|
| 1331 |
+
73,
|
| 1332 |
+
74,
|
| 1333 |
+
75
|
| 1334 |
+
]
|
| 1335 |
+
}
|
| 1336 |
+
},
|
| 1337 |
+
"code_commit": "d20968588471ede76533662de44fd0df9e124b49",
|
| 1338 |
+
"task": "a10v3",
|
| 1339 |
+
"dataset_id": "a10-trolley-push-v3@6e410c5 (inferred from the directory name)"
|
| 1340 |
+
}
|
a10-trolley-push-v3/b512/step-005000/training_records/train.log
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
HB_AUG_SEED=42
|
| 2 |
+
{"event": "preflight", "augmentation": "hb-aug-v2-20261109", "samples": 64, "state_dim": 44, "body_dims": 29, "images_changed": 64, "body_values_moved": 1.0, "max_body_offset_deg": 2.5974, "actions_bit_identical": true, "non_body_state_bit_identical": true, "eval_items_deterministic": 8}
|
| 3 |
+
{"event": "save_points", "steps": [750, 1750, 2500, 3250, 4250, 5000]}
|
| 4 |
+
HB_INLOOP ode_mlp installed: task a10v3 split train10, every 250 steps, cache checked on episodes [0, 16, 33, 49, 65, 82, 98, 114, 131, 147], code /mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse, G=<default>
|
| 5 |
+
/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/envs/hb-baselines/lib/python3.12/site-packages/torch/utils/data/dataloader.py:627: UserWarning: This DataLoader will create 32 worker processes in total. Our suggested max number of worker in current system is 15, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
|
| 6 |
+
warnings.warn(
|
| 7 |
+
{"event": "start", "policy": "ode_mlp", "params": 26481536, "backbone_params": 22353024, "backbone_weights": null, "backbone_norm": "group", "train_frames": 125290, "steps": 5000, "from_step": 0, "total_steps": 5000, "cameras": ["ego_view", "chest"], "hw": [168, 224], "seed": 42}
|
| 8 |
+
{"event": "train", "step": 50, "lr": 1e-05, "backbone_lr": 1e-05, "ema_decay": 0.946005, "it_s": 0.35, "data_frac": 0.877, "body": 0.06513909347355366, "hand": 0.6013984763622284, "loss": 0.14981162860989572}
|
| 9 |
+
{"event": "train", "step": 100, "lr": 2e-05, "backbone_lr": 2e-05, "ema_decay": 0.968138, "it_s": 0.4, "data_frac": 0.866, "body": 0.04237557604908943, "hand": 0.42254840075969696, "loss": 0.10240286514163018}
|
| 10 |
+
{"event": "train", "step": 150, "lr": 3e-05, "backbone_lr": 3e-05, "ema_decay": 0.976552, "it_s": 0.68, "data_frac": 0.76, "body": 0.03262204635888338, "hand": 0.3115090620517731, "loss": 0.07665683850646018}
|
| 11 |
+
{"event": "train", "step": 200, "lr": 4e-05, "backbone_lr": 4e-05, "ema_decay": 0.981126, "it_s": 0.41, "data_frac": 0.832, "body": 0.028599193692207335, "hand": 0.19342354625463487, "loss": 0.05462409123778343}
|
| 12 |
+
{"event": "train", "step": 250, "lr": 5e-05, "backbone_lr": 5e-05, "ema_decay": 0.984047, "it_s": 0.43, "data_frac": 0.878, "body": 0.026692122109234332, "hand": 0.08858390457928181, "loss": 0.036464509330689905}
|
| 13 |
+
HB_INLOOP ode_mlp ready: task a10v3 split train10 queries 533 (rank 0/1: 533), every 250 steps, batch 8, cams ['ego_view', 'chest']
|
| 14 |
+
HB_INLOOP ode_mlp step 250: a10v3/train10 nMSE 0.1764 (motion_token 0.1466 hands 0.3356) on 533 queries, 38.8 s
|
| 15 |
+
{"event": "train", "step": 300, "lr": 6e-05, "backbone_lr": 6e-05, "ema_decay": 0.986093, "it_s": 0.61, "data_frac": 0.311, "body": 0.024466413892805575, "hand": 0.039901202470064165, "loss": 0.02690348610281944}
|
| 16 |
+
{"event": "train", "step": 350, "lr": 7e-05, "backbone_lr": 7e-05, "ema_decay": 0.987615, "it_s": 0.45, "data_frac": 0.849, "body": 0.021800094097852708, "hand": 0.02659136138856411, "loss": 0.022556610330939295}
|
| 17 |
+
{"event": "train", "step": 400, "lr": 8e-05, "backbone_lr": 8e-05, "ema_decay": 0.988799, "it_s": 0.7, "data_frac": 0.73, "body": 0.02074779346585274, "hand": 0.022561052329838276, "loss": 0.021034097634255886}
|
| 18 |
+
{"event": "train", "step": 450, "lr": 9e-05, "backbone_lr": 9e-05, "ema_decay": 0.989748, "it_s": 0.45, "data_frac": 0.855, "body": 0.020191945172846316, "hand": 0.022484816648066043, "loss": 0.020553977712988853}
|
| 19 |
+
{"event": "train", "step": 500, "lr": 0.0001, "backbone_lr": 0.0001, "ema_decay": 0.990528, "it_s": 0.45, "data_frac": 0.848, "body": 0.019205691851675512, "hand": 0.02002813048660755, "loss": 0.0193355505913496}
|
| 20 |
+
HB_INLOOP ode_mlp step 500: a10v3/train10 nMSE 0.1003 (motion_token 0.1067 hands 0.0663) on 533 queries, 13.8 s
|
| 21 |
+
{"event": "train", "step": 550, "lr": 9.99695413509548e-05, "backbone_lr": 9.99695413509548e-05, "ema_decay": 0.991183, "it_s": 0.68, "data_frac": 0.557, "body": 0.018336771689355373, "hand": 0.018207793701440097, "loss": 0.01831640675663948}
|
| 22 |
+
{"event": "train", "step": 600, "lr": 9.987820251299122e-05, "backbone_lr": 9.987820251299122e-05, "ema_decay": 0.991741, "it_s": 0.41, "data_frac": 0.853, "body": 0.01788102386519313, "hand": 0.018060154020786284, "loss": 0.017909307554364203}
|
| 23 |
+
{"event": "train", "step": 650, "lr": 9.972609476841367e-05, "backbone_lr": 9.972609476841367e-05, "ema_decay": 0.992223, "it_s": 0.45, "data_frac": 0.821, "body": 0.01751692460849881, "hand": 0.018808946292847396, "loss": 0.017720928229391576}
|
| 24 |
+
{"event": "train", "step": 700, "lr": 9.951340343707852e-05, "backbone_lr": 9.951340343707852e-05, "ema_decay": 0.992644, "it_s": 0.68, "data_frac": 0.768, "body": 0.017280160412192345, "hand": 0.01769401378929615, "loss": 0.01734550591558218}
|
| 25 |
+
{"event": "train", "step": 750, "lr": 9.924038765061042e-05, "backbone_lr": 9.924038765061042e-05, "ema_decay": 0.993015, "it_s": 0.44, "data_frac": 0.867, "body": 0.016696290075778962, "hand": 0.016393626853823662, "loss": 0.016648501120507718}
|
| 26 |
+
HB_INLOOP ode_mlp step 750: a10v3/train10 nMSE 0.0846 (motion_token 0.0902 hands 0.0547) on 533 queries, 5.8 s
|
| 27 |
+
{"event": "save", "step": 750, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-000750", "mse": 0.01584344170987606, "mse_row0": 0.0069050295278429985, "mse_motion_token": 0.01636628434062004, "mse_inspire_left_hand_state": 0.014969469979405403, "mse_inspire_right_hand_state": 0.01114042941480875}
|
| 28 |
+
{"event": "train", "step": 800, "lr": 9.890738003669029e-05, "backbone_lr": 9.890738003669029e-05, "ema_decay": 0.993346, "it_s": 0.43, "data_frac": 0.601, "body": 0.01608904741704464, "hand": 0.01572256173938513, "loss": 0.016031181421130896}
|
| 29 |
+
{"event": "train", "step": 850, "lr": 9.851478631379982e-05, "backbone_lr": 9.851478631379982e-05, "ema_decay": 0.993642, "it_s": 0.54, "data_frac": 0.801, "body": 0.015728988200426102, "hand": 0.014815160166472196, "loss": 0.015584699604660272}
|
| 30 |
+
{"event": "train", "step": 900, "lr": 9.806308479691595e-05, "backbone_lr": 9.806308479691595e-05, "ema_decay": 0.993909, "it_s": 0.51, "data_frac": 0.815, "body": 0.015649665854871275, "hand": 0.014087484870105981, "loss": 0.015403005760163069}
|
| 31 |
+
{"event": "train", "step": 950, "lr": 9.755282581475769e-05, "backbone_lr": 9.755282581475769e-05, "ema_decay": 0.994151, "it_s": 0.75, "data_frac": 0.752, "body": 0.015115906689316035, "hand": 0.01387902807444334, "loss": 0.014920610170811414}
|
| 32 |
+
{"event": "train", "step": 1000, "lr": 9.698463103929542e-05, "backbone_lr": 9.698463103929542e-05, "ema_decay": 0.994372, "it_s": 0.43, "data_frac": 0.866, "body": 0.01529649544507265, "hand": 0.013686228152364492, "loss": 0.015042242947965861}
|
| 33 |
+
HB_INLOOP ode_mlp step 1000: a10v3/train10 nMSE 0.0748 (motion_token 0.0793 hands 0.0503) on 533 queries, 7.5 s
|
| 34 |
+
{"event": "train", "step": 1050, "lr": 9.635919272833938e-05, "backbone_lr": 9.635919272833938e-05, "ema_decay": 0.994575, "it_s": 0.4, "data_frac": 0.796, "body": 0.01483850983902812, "hand": 0.014321533292531967, "loss": 0.01475688213482499}
|
| 35 |
+
{"event": "train", "step": 1100, "lr": 9.567727288213005e-05, "backbone_lr": 9.567727288213005e-05, "ema_decay": 0.994761, "it_s": 0.62, "data_frac": 0.788, "body": 0.01430736694484949, "hand": 0.013174182828515768, "loss": 0.01412844330072403}
|
| 36 |
+
{"event": "train", "step": 1150, "lr": 9.493970231495835e-05, "backbone_lr": 9.493970231495835e-05, "ema_decay": 0.994933, "it_s": 0.4, "data_frac": 0.853, "body": 0.014167168512940406, "hand": 0.012242081575095654, "loss": 0.013863207399845123}
|
| 37 |
+
{"event": "train", "step": 1200, "lr": 9.414737964294636e-05, "backbone_lr": 9.414737964294636e-05, "ema_decay": 0.995092, "it_s": 0.92, "data_frac": 0.71, "body": 0.014111344162374735, "hand": 0.013296586759388447, "loss": 0.013982698377221823}
|
| 38 |
+
{"event": "train", "step": 1250, "lr": 9.330127018922194e-05, "backbone_lr": 9.330127018922194e-05, "ema_decay": 0.99524, "it_s": 0.46, "data_frac": 0.866, "body": 0.014027759023010731, "hand": 0.012223192285746335, "loss": 0.013742827512323856}
|
| 39 |
+
HB_INLOOP ode_mlp step 1250: a10v3/train10 nMSE 0.0676 (motion_token 0.0715 hands 0.0472) on 533 queries, 16.4 s
|
| 40 |
+
{"event": "train", "step": 1300, "lr": 9.24024048078213e-05, "backbone_lr": 9.24024048078213e-05, "ema_decay": 0.995378, "it_s": 0.39, "data_frac": 0.745, "body": 0.013737850692123174, "hand": 0.011563339121639728, "loss": 0.013394506890326738}
|
| 41 |
+
{"event": "train", "step": 1350, "lr": 9.145187862775209e-05, "backbone_lr": 9.145187862775209e-05, "ema_decay": 0.995507, "it_s": 0.44, "data_frac": 0.826, "body": 0.01370096581056714, "hand": 0.011124116238206624, "loss": 0.01329409496858716}
|
| 42 |
+
{"event": "train", "step": 1400, "lr": 9.045084971874738e-05, "backbone_lr": 9.045084971874738e-05, "ema_decay": 0.995628, "it_s": 0.54, "data_frac": 0.805, "body": 0.01345079243183136, "hand": 0.011065232157707215, "loss": 0.013074125144630671}
|
| 43 |
+
{"event": "train", "step": 1450, "lr": 8.940053768033609e-05, "backbone_lr": 8.940053768033609e-05, "ema_decay": 0.995742, "it_s": 0.71, "data_frac": 0.775, "body": 0.013135993517935277, "hand": 0.010427033491432668, "loss": 0.012708263024687767}
|
| 44 |
+
{"event": "train", "step": 1500, "lr": 8.83022221559489e-05, "backbone_lr": 8.83022221559489e-05, "ema_decay": 0.995849, "it_s": 0.34, "data_frac": 0.883, "body": 0.013002028092741966, "hand": 0.009918215423822404, "loss": 0.012515110410749913}
|
| 45 |
+
HB_INLOOP ode_mlp step 1500: a10v3/train10 nMSE 0.0629 (motion_token 0.0663 hands 0.0447) on 533 queries, 14.1 s
|
| 46 |
+
{"event": "train", "step": 1550, "lr": 8.715724127386972e-05, "backbone_lr": 8.715724127386972e-05, "ema_decay": 0.99595, "it_s": 0.46, "data_frac": 0.72, "body": 0.012765842322260142, "hand": 0.009784376919269562, "loss": 0.012295084688812494}
|
| 47 |
+
{"event": "train", "step": 1600, "lr": 8.596699001693255e-05, "backbone_lr": 8.596699001693255e-05, "ema_decay": 0.996045, "it_s": 0.49, "data_frac": 0.83, "body": 0.01282741017639637, "hand": 0.009686256824061275, "loss": 0.012331438772380353}
|
| 48 |
+
{"event": "train", "step": 1650, "lr": 8.473291852294987e-05, "backbone_lr": 8.473291852294987e-05, "ema_decay": 0.996136, "it_s": 0.46, "data_frac": 0.835, "body": 0.012750195190310478, "hand": 0.009716446669772267, "loss": 0.012271182350814343}
|
| 49 |
+
{"event": "train", "step": 1700, "lr": 8.345653031794292e-05, "backbone_lr": 8.345653031794292e-05, "ema_decay": 0.996221, "it_s": 0.61, "data_frac": 0.809, "body": 0.012666237074881792, "hand": 0.009753998294472694, "loss": 0.01220641002058983}
|
| 50 |
+
{"event": "train", "step": 1750, "lr": 8.213938048432697e-05, "backbone_lr": 8.213938048432697e-05, "ema_decay": 0.996303, "it_s": 0.29, "data_frac": 0.901, "body": 0.012470988817512988, "hand": 0.009243713011965155, "loss": 0.011961419060826302}
|
| 51 |
+
HB_INLOOP ode_mlp step 1750: a10v3/train10 nMSE 0.0590 (motion_token 0.0622 hands 0.0420) on 533 queries, 16.7 s
|
| 52 |
+
{"event": "save", "step": 1750, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-001750", "mse": 0.011792803183197975, "mse_row0": 0.006072668824344873, "mse_motion_token": 0.012571108527481556, "mse_inspire_left_hand_state": 0.008814436383545399, "mse_inspire_right_hand_state": 0.006469234358519316}
|
| 53 |
+
{"event": "train", "step": 1800, "lr": 8.07830737662829e-05, "backbone_lr": 8.07830737662829e-05, "ema_decay": 0.99638, "it_s": 0.54, "data_frac": 0.373, "body": 0.01234058128669858, "hand": 0.00874731141142547, "loss": 0.011773222982883453}
|
| 54 |
+
{"event": "train", "step": 1850, "lr": 7.938926261462366e-05, "backbone_lr": 7.938926261462366e-05, "ema_decay": 0.996454, "it_s": 0.31, "data_frac": 0.859, "body": 0.012391490861773491, "hand": 0.008736443156376481, "loss": 0.011814378146082162}
|
| 55 |
+
{"event": "train", "step": 1900, "lr": 7.795964517353735e-05, "backbone_lr": 7.795964517353735e-05, "ema_decay": 0.996524, "it_s": 0.56, "data_frac": 0.765, "body": 0.012170084044337273, "hand": 0.008223563991487026, "loss": 0.011546949408948421}
|
| 56 |
+
{"event": "train", "step": 1950, "lr": 7.649596321166024e-05, "backbone_lr": 7.649596321166024e-05, "ema_decay": 0.996591, "it_s": 0.41, "data_frac": 0.847, "body": 0.012192513085901737, "hand": 0.007989131454378367, "loss": 0.011528821382671594}
|
| 57 |
+
{"event": "train", "step": 2000, "lr": 7.500000000000001e-05, "backbone_lr": 7.500000000000001e-05, "ema_decay": 0.996655, "it_s": 0.25, "data_frac": 0.907, "body": 0.012091861180961132, "hand": 0.007370140831917524, "loss": 0.01134632647037506}
|
| 58 |
+
HB_INLOOP ode_mlp step 2000: a10v3/train10 nMSE 0.0560 (motion_token 0.0592 hands 0.0389) on 533 queries, 15.3 s
|
| 59 |
+
{"event": "train", "step": 2050, "lr": 7.347357813929454e-05, "backbone_lr": 7.347357813929454e-05, "ema_decay": 0.996716, "it_s": 0.37, "data_frac": 0.749, "body": 0.01192480843514204, "hand": 0.007385166184976697, "loss": 0.011208023000508547}
|
| 60 |
+
{"event": "train", "step": 2100, "lr": 7.191855733945387e-05, "backbone_lr": 7.191855733945387e-05, "ema_decay": 0.996775, "it_s": 0.42, "data_frac": 0.816, "body": 0.011694086734205484, "hand": 0.00760137707926333, "loss": 0.011047869510948658}
|
| 61 |
+
{"event": "train", "step": 2150, "lr": 7.033683215379002e-05, "backbone_lr": 7.033683215379002e-05, "ema_decay": 0.996832, "it_s": 0.39, "data_frac": 0.837, "body": 0.011681383568793535, "hand": 0.007038239287212491, "loss": 0.010948255639523268}
|
| 62 |
+
{"event": "train", "step": 2200, "lr": 6.873032967079561e-05, "backbone_lr": 6.873032967079561e-05, "ema_decay": 0.996886, "it_s": 0.28, "data_frac": 0.889, "body": 0.011698467843234538, "hand": 0.006745968507602811, "loss": 0.010916494317352771}
|
| 63 |
+
{"event": "train", "step": 2250, "lr": 6.710100716628344e-05, "backbone_lr": 6.710100716628344e-05, "ema_decay": 0.996938, "it_s": 0.47, "data_frac": 0.808, "body": 0.011429029926657676, "hand": 0.006665063546970487, "loss": 0.010676824748516082}
|
| 64 |
+
HB_INLOOP ode_mlp step 2250: a10v3/train10 nMSE 0.0535 (motion_token 0.0569 hands 0.0356) on 533 queries, 15.8 s
|
| 65 |
+
{"event": "train", "step": 2300, "lr": 6.545084971874738e-05, "backbone_lr": 6.545084971874738e-05, "ema_decay": 0.996988, "it_s": 0.36, "data_frac": 0.754, "body": 0.011454758122563363, "hand": 0.006818852219730616, "loss": 0.010722773056477309}
|
| 66 |
+
{"event": "train", "step": 2350, "lr": 6.378186779084995e-05, "backbone_lr": 6.378186779084995e-05, "ema_decay": 0.997036, "it_s": 0.55, "data_frac": 0.753, "body": 0.011513961832970382, "hand": 0.006357619715854526, "loss": 0.01069980263710022}
|
| 67 |
+
{"event": "train", "step": 2400, "lr": 6.209609477998338e-05, "backbone_lr": 6.209609477998338e-05, "ema_decay": 0.997083, "it_s": 0.3, "data_frac": 0.883, "body": 0.011205308698117733, "hand": 0.006124373646453023, "loss": 0.01040305582806468}
|
| 68 |
+
{"event": "train", "step": 2450, "lr": 6.0395584540887963e-05, "backbone_lr": 6.0395584540887963e-05, "ema_decay": 0.997128, "it_s": 0.35, "data_frac": 0.876, "body": 0.01116760915145278, "hand": 0.00587683410383761, "loss": 0.010332223661243915}
|
| 69 |
+
{"event": "train", "step": 2500, "lr": 5.868240888334653e-05, "backbone_lr": 5.868240888334653e-05, "ema_decay": 0.997171, "it_s": 0.55, "data_frac": 0.764, "body": 0.010950445719063282, "hand": 0.005675070257857442, "loss": 0.010117491893470287}
|
| 70 |
+
HB_INLOOP ode_mlp step 2500: a10v3/train10 nMSE 0.0512 (motion_token 0.0548 hands 0.0322) on 533 queries, 18.5 s
|
| 71 |
+
{"event": "save", "step": 2500, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-002500", "mse": 0.010239099152386189, "mse_row0": 0.005394075531512499, "mse_motion_token": 0.011197189800441265, "mse_inspire_left_hand_state": 0.005753542762249708, "mse_inspire_right_hand_state": 0.004504995420575142}
|
| 72 |
+
{"event": "train", "step": 2550, "lr": 5.695865504800327e-05, "backbone_lr": 5.695865504800327e-05, "ema_decay": 0.997212, "it_s": 0.32, "data_frac": 0.637, "body": 0.01112655719742179, "hand": 0.0055884172394871715, "loss": 0.010252114161849022}
|
| 73 |
+
{"event": "train", "step": 2600, "lr": 5.522642316338268e-05, "backbone_lr": 5.522642316338268e-05, "ema_decay": 0.997253, "it_s": 0.62, "data_frac": 0.787, "body": 0.010986197963356972, "hand": 0.0056386303156614305, "loss": 0.010141845196485519}
|
| 74 |
+
{"event": "train", "step": 2650, "lr": 5.348782368720626e-05, "backbone_lr": 5.348782368720626e-05, "ema_decay": 0.997292, "it_s": 0.33, "data_frac": 0.873, "body": 0.01095138929784298, "hand": 0.005395165588706732, "loss": 0.010074090957641602}
|
| 75 |
+
{"event": "train", "step": 2700, "lr": 5.174497483512506e-05, "backbone_lr": 5.174497483512506e-05, "ema_decay": 0.997329, "it_s": 0.33, "data_frac": 0.885, "body": 0.01081872383132577, "hand": 0.005269359136000276, "loss": 0.009942508470267057}
|
| 76 |
+
{"event": "train", "step": 2750, "lr": 5e-05, "backbone_lr": 5e-05, "ema_decay": 0.997366, "it_s": 0.35, "data_frac": 0.858, "body": 0.010710362810641527, "hand": 0.0051571991294622425, "loss": 0.009833547584712506}
|
| 77 |
+
HB_INLOOP ode_mlp step 2750: a10v3/train10 nMSE 0.0493 (motion_token 0.0531 hands 0.0291) on 533 queries, 14.4 s
|
| 78 |
+
{"event": "train", "step": 2800, "lr": 4.825502516487497e-05, "backbone_lr": 4.825502516487497e-05, "ema_decay": 0.997401, "it_s": 0.4, "data_frac": 0.721, "body": 0.010635388530790806, "hand": 0.005128038702532649, "loss": 0.00976580698043108}
|
| 79 |
+
{"event": "train", "step": 2850, "lr": 4.6512176312793736e-05, "backbone_lr": 4.6512176312793736e-05, "ema_decay": 0.997436, "it_s": 0.35, "data_frac": 0.86, "body": 0.010640210025012493, "hand": 0.005057012746110558, "loss": 0.009758652672171592}
|
| 80 |
+
{"event": "train", "step": 2900, "lr": 4.477357683661734e-05, "backbone_lr": 4.477357683661734e-05, "ema_decay": 0.997469, "it_s": 0.57, "data_frac": 0.784, "body": 0.010584526285529137, "hand": 0.004843156384304166, "loss": 0.009677994307130575}
|
| 81 |
+
{"event": "train", "step": 2950, "lr": 4.3041344951996746e-05, "backbone_lr": 4.3041344951996746e-05, "ema_decay": 0.997501, "it_s": 0.32, "data_frac": 0.891, "body": 0.010498265083879233, "hand": 0.004831112800166011, "loss": 0.009603451658040284}
|
| 82 |
+
{"event": "train", "step": 3000, "lr": 4.131759111665349e-05, "backbone_lr": 4.131759111665349e-05, "ema_decay": 0.997532, "it_s": 0.32, "data_frac": 0.88, "body": 0.010380456130951643, "hand": 0.004778847647830844, "loss": 0.009495991710573436}
|
| 83 |
+
HB_INLOOP ode_mlp step 3000: a10v3/train10 nMSE 0.0477 (motion_token 0.0517 hands 0.0267) on 533 queries, 15.9 s
|
| 84 |
+
{"event": "train", "step": 3050, "lr": 3.960441545911204e-05, "backbone_lr": 3.960441545911204e-05, "ema_decay": 0.997563, "it_s": 0.54, "data_frac": 0.604, "body": 0.010362722482532262, "hand": 0.004651008392684162, "loss": 0.009460872896015644}
|
| 85 |
+
{"event": "train", "step": 3100, "lr": 3.790390522001662e-05, "backbone_lr": 3.790390522001662e-05, "ema_decay": 0.997592, "it_s": 0.33, "data_frac": 0.852, "body": 0.01029719229787588, "hand": 0.004552642144262791, "loss": 0.009390158131718635}
|
| 86 |
+
{"event": "train", "step": 3150, "lr": 3.6218132209150045e-05, "backbone_lr": 3.6218132209150045e-05, "ema_decay": 0.997621, "it_s": 0.55, "data_frac": 0.808, "body": 0.010266914013773203, "hand": 0.004755943031050265, "loss": 0.00939676072448492}
|
| 87 |
+
{"event": "train", "step": 3200, "lr": 3.4549150281252636e-05, "backbone_lr": 3.4549150281252636e-05, "ema_decay": 0.997649, "it_s": 0.3, "data_frac": 0.884, "body": 0.010259189773350955, "hand": 0.0045078527508303524, "loss": 0.009351084027439355}
|
| 88 |
+
{"event": "train", "step": 3250, "lr": 3.289899283371657e-05, "backbone_lr": 3.289899283371657e-05, "ema_decay": 0.997676, "it_s": 0.28, "data_frac": 0.894, "body": 0.010171602740883827, "hand": 0.004385735322721303, "loss": 0.009258044883608818}
|
| 89 |
+
HB_INLOOP ode_mlp step 3250: a10v3/train10 nMSE 0.0463 (motion_token 0.0504 hands 0.0246) on 533 queries, 13.0 s
|
| 90 |
+
{"event": "save", "step": 3250, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-003250", "mse": 0.00941071379929781, "mse_row0": 0.005006206221878529, "mse_motion_token": 0.010452115908265114, "mse_inspire_left_hand_state": 0.004181319382041693, "mse_inspire_right_hand_state": 0.003531822469085455}
|
| 91 |
+
{"event": "train", "step": 3300, "lr": 3.12696703292044e-05, "backbone_lr": 3.12696703292044e-05, "ema_decay": 0.997703, "it_s": 0.53, "data_frac": 0.475, "body": 0.010156897027045489, "hand": 0.004336452009156346, "loss": 0.009237879421561956}
|
| 92 |
+
{"event": "train", "step": 3350, "lr": 2.9663167846209998e-05, "backbone_lr": 2.9663167846209998e-05, "ema_decay": 0.997728, "it_s": 0.39, "data_frac": 0.848, "body": 0.010096398964524269, "hand": 0.004494422287680208, "loss": 0.009211876224726438}
|
| 93 |
+
{"event": "train", "step": 3400, "lr": 2.8081442660546125e-05, "backbone_lr": 2.8081442660546125e-05, "ema_decay": 0.997754, "it_s": 0.33, "data_frac": 0.869, "body": 0.009998862370848656, "hand": 0.0044281924702227115, "loss": 0.009119282867759466}
|
| 94 |
+
{"event": "train", "step": 3450, "lr": 2.6526421860705473e-05, "backbone_lr": 2.6526421860705473e-05, "ema_decay": 0.997778, "it_s": 0.27, "data_frac": 0.901, "body": 0.010021406784653663, "hand": 0.00401109813246876, "loss": 0.009072410650551319}
|
| 95 |
+
{"event": "train", "step": 3500, "lr": 2.500000000000001e-05, "backbone_lr": 2.500000000000001e-05, "ema_decay": 0.997802, "it_s": 0.49, "data_frac": 0.803, "body": 0.009950864631682634, "hand": 0.003994120163843036, "loss": 0.009010326098650694}
|
| 96 |
+
HB_INLOOP ode_mlp step 3500: a10v3/train10 nMSE 0.0453 (motion_token 0.0494 hands 0.0231) on 533 queries, 13.6 s
|
| 97 |
+
{"event": "train", "step": 3550, "lr": 2.350403678833976e-05, "backbone_lr": 2.350403678833976e-05, "ema_decay": 0.997825, "it_s": 0.3, "data_frac": 0.792, "body": 0.009866843987256289, "hand": 0.003940053740516305, "loss": 0.00893103500828147}
|
| 98 |
+
{"event": "train", "step": 3600, "lr": 2.2040354826462668e-05, "backbone_lr": 2.2040354826462668e-05, "ema_decay": 0.997848, "it_s": 0.49, "data_frac": 0.791, "body": 0.009838415440171958, "hand": 0.0038808573829010127, "loss": 0.008897748496383428}
|
| 99 |
+
{"event": "train", "step": 3650, "lr": 2.061073738537635e-05, "backbone_lr": 2.061073738537635e-05, "ema_decay": 0.99787, "it_s": 0.51, "data_frac": 0.779, "body": 0.009828066509217024, "hand": 0.003845121948979795, "loss": 0.008883391059935093}
|
| 100 |
+
{"event": "train", "step": 3700, "lr": 1.9216926233717085e-05, "backbone_lr": 1.9216926233717085e-05, "ema_decay": 0.997892, "it_s": 0.26, "data_frac": 0.892, "body": 0.009775288794189691, "hand": 0.003888912666589022, "loss": 0.008845861069858074}
|
| 101 |
+
{"event": "train", "step": 3750, "lr": 1.7860619515673033e-05, "backbone_lr": 1.7860619515673033e-05, "ema_decay": 0.997913, "it_s": 0.5, "data_frac": 0.792, "body": 0.009676096085458994, "hand": 0.0038274109130725263, "loss": 0.008752619568258523}
|
| 102 |
+
HB_INLOOP ode_mlp step 3750: a10v3/train10 nMSE 0.0443 (motion_token 0.0486 hands 0.0218) on 533 queries, 13.6 s
|
| 103 |
+
{"event": "train", "step": 3800, "lr": 1.6543469682057106e-05, "backbone_lr": 1.6543469682057106e-05, "ema_decay": 0.997933, "it_s": 0.3, "data_frac": 0.79, "body": 0.009705723877996206, "hand": 0.0038426768593490123, "loss": 0.008779979720711708}
|
| 104 |
+
{"event": "train", "step": 3850, "lr": 1.526708147705013e-05, "backbone_lr": 1.526708147705013e-05, "ema_decay": 0.997954, "it_s": 0.56, "data_frac": 0.774, "body": 0.009733090829104184, "hand": 0.0037291327910497787, "loss": 0.008785097524523736}
|
| 105 |
+
{"event": "train", "step": 3900, "lr": 1.4033009983067452e-05, "backbone_lr": 1.4033009983067452e-05, "ema_decay": 0.997973, "it_s": 0.43, "data_frac": 0.837, "body": 0.009665802977979183, "hand": 0.0037904380680993197, "loss": 0.0087381137534976}
|
| 106 |
+
{"event": "train", "step": 3950, "lr": 1.2842758726130283e-05, "backbone_lr": 1.2842758726130283e-05, "ema_decay": 0.997993, "it_s": 0.28, "data_frac": 0.891, "body": 0.009584392458200454, "hand": 0.0037201829021796585, "loss": 0.008658464653417469}
|
| 107 |
+
{"event": "train", "step": 4000, "lr": 1.1697777844051105e-05, "backbone_lr": 1.1697777844051105e-05, "ema_decay": 0.998011, "it_s": 0.45, "data_frac": 0.812, "body": 0.00957692151889205, "hand": 0.003646115572191775, "loss": 0.008640478495508433}
|
| 108 |
+
HB_INLOOP ode_mlp step 4000: a10v3/train10 nMSE 0.0436 (motion_token 0.0479 hands 0.0208) on 533 queries, 16.4 s
|
| 109 |
+
{"event": "train", "step": 4050, "lr": 1.0599462319663905e-05, "backbone_lr": 1.0599462319663905e-05, "ema_decay": 0.99803, "it_s": 0.3, "data_frac": 0.764, "body": 0.009583831932395696, "hand": 0.003722233837470412, "loss": 0.00865831658244133}
|
| 110 |
+
{"event": "train", "step": 4100, "lr": 9.549150281252633e-06, "backbone_lr": 9.549150281252633e-06, "ema_decay": 0.998048, "it_s": 0.38, "data_frac": 0.854, "body": 0.009542494751513005, "hand": 0.003596667326055467, "loss": 0.008603679817169904}
|
| 111 |
+
{"event": "train", "step": 4150, "lr": 8.548121372247918e-06, "backbone_lr": 8.548121372247918e-06, "ema_decay": 0.998066, "it_s": 0.32, "data_frac": 0.858, "body": 0.009555964935570956, "hand": 0.0036209885170683264, "loss": 0.008618863448500633}
|
| 112 |
+
{"event": "train", "step": 4200, "lr": 7.597595192178702e-06, "backbone_lr": 7.597595192178702e-06, "ema_decay": 0.998083, "it_s": 0.51, "data_frac": 0.772, "body": 0.009523146729916334, "hand": 0.003544916124083102, "loss": 0.00857921563088894}
|
| 113 |
+
{"event": "train", "step": 4250, "lr": 6.698729810778065e-06, "backbone_lr": 6.698729810778065e-06, "ema_decay": 0.9981, "it_s": 0.29, "data_frac": 0.888, "body": 0.009471456278115511, "hand": 0.0034999356651678683, "loss": 0.008528584595769644}
|
| 114 |
+
HB_INLOOP ode_mlp step 4250: a10v3/train10 nMSE 0.0430 (motion_token 0.0474 hands 0.0200) on 533 queries, 8.4 s
|
| 115 |
+
{"event": "save", "step": 4250, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-004250", "mse": 0.008807788603007793, "mse_row0": 0.004809974692761898, "mse_motion_token": 0.009853889234364033, "mse_inspire_left_hand_state": 0.0034390364307910204, "mse_inspire_right_hand_state": 0.003018138464540243}
|
| 116 |
+
{"event": "train", "step": 4300, "lr": 5.852620357053651e-06, "backbone_lr": 5.852620357053651e-06, "ema_decay": 0.998116, "it_s": 0.5, "data_frac": 0.552, "body": 0.009420220088213683, "hand": 0.003532490408979356, "loss": 0.008490578699856997}
|
| 117 |
+
{"event": "train", "step": 4350, "lr": 5.060297685041659e-06, "backbone_lr": 5.060297685041659e-06, "ema_decay": 0.998133, "it_s": 0.39, "data_frac": 0.861, "body": 0.00944553893059492, "hand": 0.003467131736688316, "loss": 0.008501579910516739}
|
| 118 |
+
{"event": "train", "step": 4400, "lr": 4.322727117869951e-06, "backbone_lr": 4.322727117869951e-06, "ema_decay": 0.998149, "it_s": 0.3, "data_frac": 0.889, "body": 0.0094324398227036, "hand": 0.003485148176550865, "loss": 0.008493393864482642}
|
| 119 |
+
{"event": "train", "step": 4450, "lr": 3.6408072716606346e-06, "backbone_lr": 3.6408072716606346e-06, "ema_decay": 0.998164, "it_s": 0.52, "data_frac": 0.798, "body": 0.009429152775555848, "hand": 0.0034750971337780354, "loss": 0.008489038776606322}
|
| 120 |
+
{"event": "train", "step": 4500, "lr": 3.0153689607045845e-06, "backbone_lr": 3.0153689607045845e-06, "ema_decay": 0.99818, "it_s": 0.35, "data_frac": 0.869, "body": 0.00937174802646041, "hand": 0.0034892314253374933, "loss": 0.008442929647862911}
|
| 121 |
+
HB_INLOOP ode_mlp step 4500: a10v3/train10 nMSE 0.0426 (motion_token 0.0470 hands 0.0193) on 533 queries, 13.8 s
|
| 122 |
+
{"event": "train", "step": 4550, "lr": 2.4471741852423237e-06, "backbone_lr": 2.4471741852423237e-06, "ema_decay": 0.998195, "it_s": 0.43, "data_frac": 0.709, "body": 0.009341708179563283, "hand": 0.0034247005823999643, "loss": 0.00840744387358427}
|
| 123 |
+
{"event": "train", "step": 4600, "lr": 1.9369152030840556e-06, "backbone_lr": 1.9369152030840556e-06, "ema_decay": 0.998209, "it_s": 0.4, "data_frac": 0.853, "body": 0.009352872390300035, "hand": 0.0033892662124708293, "loss": 0.008411250431090594}
|
| 124 |
+
{"event": "train", "step": 4650, "lr": 1.4852136862001764e-06, "backbone_lr": 1.4852136862001764e-06, "ema_decay": 0.998224, "it_s": 0.41, "data_frac": 0.869, "body": 0.009416687451303005, "hand": 0.003381293285638094, "loss": 0.008463730588555336}
|
| 125 |
+
{"event": "train", "step": 4700, "lr": 1.0926199633097157e-06, "backbone_lr": 1.0926199633097157e-06, "ema_decay": 0.998238, "it_s": 0.62, "data_frac": 0.768, "body": 0.009351183231920003, "hand": 0.0034055143594741823, "loss": 0.008412393443286419}
|
| 126 |
+
{"event": "train", "step": 4750, "lr": 7.596123493895991e-07, "backbone_lr": 7.596123493895991e-07, "ema_decay": 0.998252, "it_s": 0.34, "data_frac": 0.867, "body": 0.009311069399118424, "hand": 0.0033910943707451224, "loss": 0.008376336582005024}
|
| 127 |
+
HB_INLOOP ode_mlp step 4750: a10v3/train10 nMSE 0.0423 (motion_token 0.0467 hands 0.0189) on 533 queries, 16.0 s
|
| 128 |
+
{"event": "train", "step": 4800, "lr": 4.865965629214819e-07, "backbone_lr": 4.865965629214819e-07, "ema_decay": 0.998266, "it_s": 0.38, "data_frac": 0.732, "body": 0.009338868279010058, "hand": 0.003405394973233342, "loss": 0.0084020041115582}
|
| 129 |
+
{"event": "train", "step": 4850, "lr": 2.7390523158633554e-07, "backbone_lr": 2.7390523158633554e-07, "ema_decay": 0.998279, "it_s": 0.56, "data_frac": 0.79, "body": 0.009344917591661214, "hand": 0.003430539178662002, "loss": 0.008411068432033063}
|
| 130 |
+
{"event": "train", "step": 4900, "lr": 1.2179748700879012e-07, "backbone_lr": 1.2179748700879012e-07, "ema_decay": 0.998292, "it_s": 0.37, "data_frac": 0.882, "body": 0.00935862984508276, "hand": 0.0033892499376088382, "loss": 0.008416096270084382}
|
| 131 |
+
{"event": "train", "step": 4950, "lr": 3.04586490452119e-08, "backbone_lr": 3.04586490452119e-08, "ema_decay": 0.998305, "it_s": 0.3, "data_frac": 0.88, "body": 0.009349980056285859, "hand": 0.003399594989605248, "loss": 0.008410445638000965}
|
| 132 |
+
{"event": "train", "step": 5000, "lr": 0.0, "backbone_lr": 0.0, "ema_decay": 0.998318, "it_s": 0.46, "data_frac": 0.82, "body": 0.00929649844765663, "hand": 0.0033691781898960473, "loss": 0.008360605910420418}
|
| 133 |
+
HB_INLOOP ode_mlp step 5000: a10v3/train10 nMSE 0.0421 (motion_token 0.0465 hands 0.0186) on 533 queries, 15.7 s
|
| 134 |
+
{"event": "save", "step": 5000, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-005000", "mse": 0.008637136779725552, "mse_row0": 0.004760934505611658, "mse_motion_token": 0.00967626366764307, "mse_inspire_left_hand_state": 0.003269098000600934, "mse_inspire_right_hand_state": 0.0029211402870714664}
|
| 135 |
+
{"event": "done", "step": 5000, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/final"}
|
a10-trolley-push-v3/b512/step-005000/training_records/train_log.jsonl
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"event": "train", "step": 50, "lr": 1e-05, "backbone_lr": 1e-05, "ema_decay": 0.946005, "it_s": 0.35, "data_frac": 0.877, "body": 0.06513909347355366, "hand": 0.6013984763622284, "loss": 0.14981162860989572}
|
| 2 |
+
{"event": "train", "step": 100, "lr": 2e-05, "backbone_lr": 2e-05, "ema_decay": 0.968138, "it_s": 0.4, "data_frac": 0.866, "body": 0.04237557604908943, "hand": 0.42254840075969696, "loss": 0.10240286514163018}
|
| 3 |
+
{"event": "train", "step": 150, "lr": 3e-05, "backbone_lr": 3e-05, "ema_decay": 0.976552, "it_s": 0.68, "data_frac": 0.76, "body": 0.03262204635888338, "hand": 0.3115090620517731, "loss": 0.07665683850646018}
|
| 4 |
+
{"event": "train", "step": 200, "lr": 4e-05, "backbone_lr": 4e-05, "ema_decay": 0.981126, "it_s": 0.41, "data_frac": 0.832, "body": 0.028599193692207335, "hand": 0.19342354625463487, "loss": 0.05462409123778343}
|
| 5 |
+
{"event": "train", "step": 250, "lr": 5e-05, "backbone_lr": 5e-05, "ema_decay": 0.984047, "it_s": 0.43, "data_frac": 0.878, "body": 0.026692122109234332, "hand": 0.08858390457928181, "loss": 0.036464509330689905}
|
| 6 |
+
{"event": "train", "step": 300, "lr": 6e-05, "backbone_lr": 6e-05, "ema_decay": 0.986093, "it_s": 0.61, "data_frac": 0.311, "body": 0.024466413892805575, "hand": 0.039901202470064165, "loss": 0.02690348610281944}
|
| 7 |
+
{"event": "train", "step": 350, "lr": 7e-05, "backbone_lr": 7e-05, "ema_decay": 0.987615, "it_s": 0.45, "data_frac": 0.849, "body": 0.021800094097852708, "hand": 0.02659136138856411, "loss": 0.022556610330939295}
|
| 8 |
+
{"event": "train", "step": 400, "lr": 8e-05, "backbone_lr": 8e-05, "ema_decay": 0.988799, "it_s": 0.7, "data_frac": 0.73, "body": 0.02074779346585274, "hand": 0.022561052329838276, "loss": 0.021034097634255886}
|
| 9 |
+
{"event": "train", "step": 450, "lr": 9e-05, "backbone_lr": 9e-05, "ema_decay": 0.989748, "it_s": 0.45, "data_frac": 0.855, "body": 0.020191945172846316, "hand": 0.022484816648066043, "loss": 0.020553977712988853}
|
| 10 |
+
{"event": "train", "step": 500, "lr": 0.0001, "backbone_lr": 0.0001, "ema_decay": 0.990528, "it_s": 0.45, "data_frac": 0.848, "body": 0.019205691851675512, "hand": 0.02002813048660755, "loss": 0.0193355505913496}
|
| 11 |
+
{"event": "train", "step": 550, "lr": 9.99695413509548e-05, "backbone_lr": 9.99695413509548e-05, "ema_decay": 0.991183, "it_s": 0.68, "data_frac": 0.557, "body": 0.018336771689355373, "hand": 0.018207793701440097, "loss": 0.01831640675663948}
|
| 12 |
+
{"event": "train", "step": 600, "lr": 9.987820251299122e-05, "backbone_lr": 9.987820251299122e-05, "ema_decay": 0.991741, "it_s": 0.41, "data_frac": 0.853, "body": 0.01788102386519313, "hand": 0.018060154020786284, "loss": 0.017909307554364203}
|
| 13 |
+
{"event": "train", "step": 650, "lr": 9.972609476841367e-05, "backbone_lr": 9.972609476841367e-05, "ema_decay": 0.992223, "it_s": 0.45, "data_frac": 0.821, "body": 0.01751692460849881, "hand": 0.018808946292847396, "loss": 0.017720928229391576}
|
| 14 |
+
{"event": "train", "step": 700, "lr": 9.951340343707852e-05, "backbone_lr": 9.951340343707852e-05, "ema_decay": 0.992644, "it_s": 0.68, "data_frac": 0.768, "body": 0.017280160412192345, "hand": 0.01769401378929615, "loss": 0.01734550591558218}
|
| 15 |
+
{"event": "train", "step": 750, "lr": 9.924038765061042e-05, "backbone_lr": 9.924038765061042e-05, "ema_decay": 0.993015, "it_s": 0.44, "data_frac": 0.867, "body": 0.016696290075778962, "hand": 0.016393626853823662, "loss": 0.016648501120507718}
|
| 16 |
+
{"event": "save", "step": 750, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-000750", "mse": 0.01584344170987606, "mse_row0": 0.0069050295278429985, "mse_motion_token": 0.01636628434062004, "mse_inspire_left_hand_state": 0.014969469979405403, "mse_inspire_right_hand_state": 0.01114042941480875}
|
| 17 |
+
{"event": "train", "step": 800, "lr": 9.890738003669029e-05, "backbone_lr": 9.890738003669029e-05, "ema_decay": 0.993346, "it_s": 0.43, "data_frac": 0.601, "body": 0.01608904741704464, "hand": 0.01572256173938513, "loss": 0.016031181421130896}
|
| 18 |
+
{"event": "train", "step": 850, "lr": 9.851478631379982e-05, "backbone_lr": 9.851478631379982e-05, "ema_decay": 0.993642, "it_s": 0.54, "data_frac": 0.801, "body": 0.015728988200426102, "hand": 0.014815160166472196, "loss": 0.015584699604660272}
|
| 19 |
+
{"event": "train", "step": 900, "lr": 9.806308479691595e-05, "backbone_lr": 9.806308479691595e-05, "ema_decay": 0.993909, "it_s": 0.51, "data_frac": 0.815, "body": 0.015649665854871275, "hand": 0.014087484870105981, "loss": 0.015403005760163069}
|
| 20 |
+
{"event": "train", "step": 950, "lr": 9.755282581475769e-05, "backbone_lr": 9.755282581475769e-05, "ema_decay": 0.994151, "it_s": 0.75, "data_frac": 0.752, "body": 0.015115906689316035, "hand": 0.01387902807444334, "loss": 0.014920610170811414}
|
| 21 |
+
{"event": "train", "step": 1000, "lr": 9.698463103929542e-05, "backbone_lr": 9.698463103929542e-05, "ema_decay": 0.994372, "it_s": 0.43, "data_frac": 0.866, "body": 0.01529649544507265, "hand": 0.013686228152364492, "loss": 0.015042242947965861}
|
| 22 |
+
{"event": "train", "step": 1050, "lr": 9.635919272833938e-05, "backbone_lr": 9.635919272833938e-05, "ema_decay": 0.994575, "it_s": 0.4, "data_frac": 0.796, "body": 0.01483850983902812, "hand": 0.014321533292531967, "loss": 0.01475688213482499}
|
| 23 |
+
{"event": "train", "step": 1100, "lr": 9.567727288213005e-05, "backbone_lr": 9.567727288213005e-05, "ema_decay": 0.994761, "it_s": 0.62, "data_frac": 0.788, "body": 0.01430736694484949, "hand": 0.013174182828515768, "loss": 0.01412844330072403}
|
| 24 |
+
{"event": "train", "step": 1150, "lr": 9.493970231495835e-05, "backbone_lr": 9.493970231495835e-05, "ema_decay": 0.994933, "it_s": 0.4, "data_frac": 0.853, "body": 0.014167168512940406, "hand": 0.012242081575095654, "loss": 0.013863207399845123}
|
| 25 |
+
{"event": "train", "step": 1200, "lr": 9.414737964294636e-05, "backbone_lr": 9.414737964294636e-05, "ema_decay": 0.995092, "it_s": 0.92, "data_frac": 0.71, "body": 0.014111344162374735, "hand": 0.013296586759388447, "loss": 0.013982698377221823}
|
| 26 |
+
{"event": "train", "step": 1250, "lr": 9.330127018922194e-05, "backbone_lr": 9.330127018922194e-05, "ema_decay": 0.99524, "it_s": 0.46, "data_frac": 0.866, "body": 0.014027759023010731, "hand": 0.012223192285746335, "loss": 0.013742827512323856}
|
| 27 |
+
{"event": "train", "step": 1300, "lr": 9.24024048078213e-05, "backbone_lr": 9.24024048078213e-05, "ema_decay": 0.995378, "it_s": 0.39, "data_frac": 0.745, "body": 0.013737850692123174, "hand": 0.011563339121639728, "loss": 0.013394506890326738}
|
| 28 |
+
{"event": "train", "step": 1350, "lr": 9.145187862775209e-05, "backbone_lr": 9.145187862775209e-05, "ema_decay": 0.995507, "it_s": 0.44, "data_frac": 0.826, "body": 0.01370096581056714, "hand": 0.011124116238206624, "loss": 0.01329409496858716}
|
| 29 |
+
{"event": "train", "step": 1400, "lr": 9.045084971874738e-05, "backbone_lr": 9.045084971874738e-05, "ema_decay": 0.995628, "it_s": 0.54, "data_frac": 0.805, "body": 0.01345079243183136, "hand": 0.011065232157707215, "loss": 0.013074125144630671}
|
| 30 |
+
{"event": "train", "step": 1450, "lr": 8.940053768033609e-05, "backbone_lr": 8.940053768033609e-05, "ema_decay": 0.995742, "it_s": 0.71, "data_frac": 0.775, "body": 0.013135993517935277, "hand": 0.010427033491432668, "loss": 0.012708263024687767}
|
| 31 |
+
{"event": "train", "step": 1500, "lr": 8.83022221559489e-05, "backbone_lr": 8.83022221559489e-05, "ema_decay": 0.995849, "it_s": 0.34, "data_frac": 0.883, "body": 0.013002028092741966, "hand": 0.009918215423822404, "loss": 0.012515110410749913}
|
| 32 |
+
{"event": "train", "step": 1550, "lr": 8.715724127386972e-05, "backbone_lr": 8.715724127386972e-05, "ema_decay": 0.99595, "it_s": 0.46, "data_frac": 0.72, "body": 0.012765842322260142, "hand": 0.009784376919269562, "loss": 0.012295084688812494}
|
| 33 |
+
{"event": "train", "step": 1600, "lr": 8.596699001693255e-05, "backbone_lr": 8.596699001693255e-05, "ema_decay": 0.996045, "it_s": 0.49, "data_frac": 0.83, "body": 0.01282741017639637, "hand": 0.009686256824061275, "loss": 0.012331438772380353}
|
| 34 |
+
{"event": "train", "step": 1650, "lr": 8.473291852294987e-05, "backbone_lr": 8.473291852294987e-05, "ema_decay": 0.996136, "it_s": 0.46, "data_frac": 0.835, "body": 0.012750195190310478, "hand": 0.009716446669772267, "loss": 0.012271182350814343}
|
| 35 |
+
{"event": "train", "step": 1700, "lr": 8.345653031794292e-05, "backbone_lr": 8.345653031794292e-05, "ema_decay": 0.996221, "it_s": 0.61, "data_frac": 0.809, "body": 0.012666237074881792, "hand": 0.009753998294472694, "loss": 0.01220641002058983}
|
| 36 |
+
{"event": "train", "step": 1750, "lr": 8.213938048432697e-05, "backbone_lr": 8.213938048432697e-05, "ema_decay": 0.996303, "it_s": 0.29, "data_frac": 0.901, "body": 0.012470988817512988, "hand": 0.009243713011965155, "loss": 0.011961419060826302}
|
| 37 |
+
{"event": "save", "step": 1750, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-001750", "mse": 0.011792803183197975, "mse_row0": 0.006072668824344873, "mse_motion_token": 0.012571108527481556, "mse_inspire_left_hand_state": 0.008814436383545399, "mse_inspire_right_hand_state": 0.006469234358519316}
|
| 38 |
+
{"event": "train", "step": 1800, "lr": 8.07830737662829e-05, "backbone_lr": 8.07830737662829e-05, "ema_decay": 0.99638, "it_s": 0.54, "data_frac": 0.373, "body": 0.01234058128669858, "hand": 0.00874731141142547, "loss": 0.011773222982883453}
|
| 39 |
+
{"event": "train", "step": 1850, "lr": 7.938926261462366e-05, "backbone_lr": 7.938926261462366e-05, "ema_decay": 0.996454, "it_s": 0.31, "data_frac": 0.859, "body": 0.012391490861773491, "hand": 0.008736443156376481, "loss": 0.011814378146082162}
|
| 40 |
+
{"event": "train", "step": 1900, "lr": 7.795964517353735e-05, "backbone_lr": 7.795964517353735e-05, "ema_decay": 0.996524, "it_s": 0.56, "data_frac": 0.765, "body": 0.012170084044337273, "hand": 0.008223563991487026, "loss": 0.011546949408948421}
|
| 41 |
+
{"event": "train", "step": 1950, "lr": 7.649596321166024e-05, "backbone_lr": 7.649596321166024e-05, "ema_decay": 0.996591, "it_s": 0.41, "data_frac": 0.847, "body": 0.012192513085901737, "hand": 0.007989131454378367, "loss": 0.011528821382671594}
|
| 42 |
+
{"event": "train", "step": 2000, "lr": 7.500000000000001e-05, "backbone_lr": 7.500000000000001e-05, "ema_decay": 0.996655, "it_s": 0.25, "data_frac": 0.907, "body": 0.012091861180961132, "hand": 0.007370140831917524, "loss": 0.01134632647037506}
|
| 43 |
+
{"event": "train", "step": 2050, "lr": 7.347357813929454e-05, "backbone_lr": 7.347357813929454e-05, "ema_decay": 0.996716, "it_s": 0.37, "data_frac": 0.749, "body": 0.01192480843514204, "hand": 0.007385166184976697, "loss": 0.011208023000508547}
|
| 44 |
+
{"event": "train", "step": 2100, "lr": 7.191855733945387e-05, "backbone_lr": 7.191855733945387e-05, "ema_decay": 0.996775, "it_s": 0.42, "data_frac": 0.816, "body": 0.011694086734205484, "hand": 0.00760137707926333, "loss": 0.011047869510948658}
|
| 45 |
+
{"event": "train", "step": 2150, "lr": 7.033683215379002e-05, "backbone_lr": 7.033683215379002e-05, "ema_decay": 0.996832, "it_s": 0.39, "data_frac": 0.837, "body": 0.011681383568793535, "hand": 0.007038239287212491, "loss": 0.010948255639523268}
|
| 46 |
+
{"event": "train", "step": 2200, "lr": 6.873032967079561e-05, "backbone_lr": 6.873032967079561e-05, "ema_decay": 0.996886, "it_s": 0.28, "data_frac": 0.889, "body": 0.011698467843234538, "hand": 0.006745968507602811, "loss": 0.010916494317352771}
|
| 47 |
+
{"event": "train", "step": 2250, "lr": 6.710100716628344e-05, "backbone_lr": 6.710100716628344e-05, "ema_decay": 0.996938, "it_s": 0.47, "data_frac": 0.808, "body": 0.011429029926657676, "hand": 0.006665063546970487, "loss": 0.010676824748516082}
|
| 48 |
+
{"event": "train", "step": 2300, "lr": 6.545084971874738e-05, "backbone_lr": 6.545084971874738e-05, "ema_decay": 0.996988, "it_s": 0.36, "data_frac": 0.754, "body": 0.011454758122563363, "hand": 0.006818852219730616, "loss": 0.010722773056477309}
|
| 49 |
+
{"event": "train", "step": 2350, "lr": 6.378186779084995e-05, "backbone_lr": 6.378186779084995e-05, "ema_decay": 0.997036, "it_s": 0.55, "data_frac": 0.753, "body": 0.011513961832970382, "hand": 0.006357619715854526, "loss": 0.01069980263710022}
|
| 50 |
+
{"event": "train", "step": 2400, "lr": 6.209609477998338e-05, "backbone_lr": 6.209609477998338e-05, "ema_decay": 0.997083, "it_s": 0.3, "data_frac": 0.883, "body": 0.011205308698117733, "hand": 0.006124373646453023, "loss": 0.01040305582806468}
|
| 51 |
+
{"event": "train", "step": 2450, "lr": 6.0395584540887963e-05, "backbone_lr": 6.0395584540887963e-05, "ema_decay": 0.997128, "it_s": 0.35, "data_frac": 0.876, "body": 0.01116760915145278, "hand": 0.00587683410383761, "loss": 0.010332223661243915}
|
| 52 |
+
{"event": "train", "step": 2500, "lr": 5.868240888334653e-05, "backbone_lr": 5.868240888334653e-05, "ema_decay": 0.997171, "it_s": 0.55, "data_frac": 0.764, "body": 0.010950445719063282, "hand": 0.005675070257857442, "loss": 0.010117491893470287}
|
| 53 |
+
{"event": "save", "step": 2500, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-002500", "mse": 0.010239099152386189, "mse_row0": 0.005394075531512499, "mse_motion_token": 0.011197189800441265, "mse_inspire_left_hand_state": 0.005753542762249708, "mse_inspire_right_hand_state": 0.004504995420575142}
|
| 54 |
+
{"event": "train", "step": 2550, "lr": 5.695865504800327e-05, "backbone_lr": 5.695865504800327e-05, "ema_decay": 0.997212, "it_s": 0.32, "data_frac": 0.637, "body": 0.01112655719742179, "hand": 0.0055884172394871715, "loss": 0.010252114161849022}
|
| 55 |
+
{"event": "train", "step": 2600, "lr": 5.522642316338268e-05, "backbone_lr": 5.522642316338268e-05, "ema_decay": 0.997253, "it_s": 0.62, "data_frac": 0.787, "body": 0.010986197963356972, "hand": 0.0056386303156614305, "loss": 0.010141845196485519}
|
| 56 |
+
{"event": "train", "step": 2650, "lr": 5.348782368720626e-05, "backbone_lr": 5.348782368720626e-05, "ema_decay": 0.997292, "it_s": 0.33, "data_frac": 0.873, "body": 0.01095138929784298, "hand": 0.005395165588706732, "loss": 0.010074090957641602}
|
| 57 |
+
{"event": "train", "step": 2700, "lr": 5.174497483512506e-05, "backbone_lr": 5.174497483512506e-05, "ema_decay": 0.997329, "it_s": 0.33, "data_frac": 0.885, "body": 0.01081872383132577, "hand": 0.005269359136000276, "loss": 0.009942508470267057}
|
| 58 |
+
{"event": "train", "step": 2750, "lr": 5e-05, "backbone_lr": 5e-05, "ema_decay": 0.997366, "it_s": 0.35, "data_frac": 0.858, "body": 0.010710362810641527, "hand": 0.0051571991294622425, "loss": 0.009833547584712506}
|
| 59 |
+
{"event": "train", "step": 2800, "lr": 4.825502516487497e-05, "backbone_lr": 4.825502516487497e-05, "ema_decay": 0.997401, "it_s": 0.4, "data_frac": 0.721, "body": 0.010635388530790806, "hand": 0.005128038702532649, "loss": 0.00976580698043108}
|
| 60 |
+
{"event": "train", "step": 2850, "lr": 4.6512176312793736e-05, "backbone_lr": 4.6512176312793736e-05, "ema_decay": 0.997436, "it_s": 0.35, "data_frac": 0.86, "body": 0.010640210025012493, "hand": 0.005057012746110558, "loss": 0.009758652672171592}
|
| 61 |
+
{"event": "train", "step": 2900, "lr": 4.477357683661734e-05, "backbone_lr": 4.477357683661734e-05, "ema_decay": 0.997469, "it_s": 0.57, "data_frac": 0.784, "body": 0.010584526285529137, "hand": 0.004843156384304166, "loss": 0.009677994307130575}
|
| 62 |
+
{"event": "train", "step": 2950, "lr": 4.3041344951996746e-05, "backbone_lr": 4.3041344951996746e-05, "ema_decay": 0.997501, "it_s": 0.32, "data_frac": 0.891, "body": 0.010498265083879233, "hand": 0.004831112800166011, "loss": 0.009603451658040284}
|
| 63 |
+
{"event": "train", "step": 3000, "lr": 4.131759111665349e-05, "backbone_lr": 4.131759111665349e-05, "ema_decay": 0.997532, "it_s": 0.32, "data_frac": 0.88, "body": 0.010380456130951643, "hand": 0.004778847647830844, "loss": 0.009495991710573436}
|
| 64 |
+
{"event": "train", "step": 3050, "lr": 3.960441545911204e-05, "backbone_lr": 3.960441545911204e-05, "ema_decay": 0.997563, "it_s": 0.54, "data_frac": 0.604, "body": 0.010362722482532262, "hand": 0.004651008392684162, "loss": 0.009460872896015644}
|
| 65 |
+
{"event": "train", "step": 3100, "lr": 3.790390522001662e-05, "backbone_lr": 3.790390522001662e-05, "ema_decay": 0.997592, "it_s": 0.33, "data_frac": 0.852, "body": 0.01029719229787588, "hand": 0.004552642144262791, "loss": 0.009390158131718635}
|
| 66 |
+
{"event": "train", "step": 3150, "lr": 3.6218132209150045e-05, "backbone_lr": 3.6218132209150045e-05, "ema_decay": 0.997621, "it_s": 0.55, "data_frac": 0.808, "body": 0.010266914013773203, "hand": 0.004755943031050265, "loss": 0.00939676072448492}
|
| 67 |
+
{"event": "train", "step": 3200, "lr": 3.4549150281252636e-05, "backbone_lr": 3.4549150281252636e-05, "ema_decay": 0.997649, "it_s": 0.3, "data_frac": 0.884, "body": 0.010259189773350955, "hand": 0.0045078527508303524, "loss": 0.009351084027439355}
|
| 68 |
+
{"event": "train", "step": 3250, "lr": 3.289899283371657e-05, "backbone_lr": 3.289899283371657e-05, "ema_decay": 0.997676, "it_s": 0.28, "data_frac": 0.894, "body": 0.010171602740883827, "hand": 0.004385735322721303, "loss": 0.009258044883608818}
|
| 69 |
+
{"event": "save", "step": 3250, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-003250", "mse": 0.00941071379929781, "mse_row0": 0.005006206221878529, "mse_motion_token": 0.010452115908265114, "mse_inspire_left_hand_state": 0.004181319382041693, "mse_inspire_right_hand_state": 0.003531822469085455}
|
| 70 |
+
{"event": "train", "step": 3300, "lr": 3.12696703292044e-05, "backbone_lr": 3.12696703292044e-05, "ema_decay": 0.997703, "it_s": 0.53, "data_frac": 0.475, "body": 0.010156897027045489, "hand": 0.004336452009156346, "loss": 0.009237879421561956}
|
| 71 |
+
{"event": "train", "step": 3350, "lr": 2.9663167846209998e-05, "backbone_lr": 2.9663167846209998e-05, "ema_decay": 0.997728, "it_s": 0.39, "data_frac": 0.848, "body": 0.010096398964524269, "hand": 0.004494422287680208, "loss": 0.009211876224726438}
|
| 72 |
+
{"event": "train", "step": 3400, "lr": 2.8081442660546125e-05, "backbone_lr": 2.8081442660546125e-05, "ema_decay": 0.997754, "it_s": 0.33, "data_frac": 0.869, "body": 0.009998862370848656, "hand": 0.0044281924702227115, "loss": 0.009119282867759466}
|
| 73 |
+
{"event": "train", "step": 3450, "lr": 2.6526421860705473e-05, "backbone_lr": 2.6526421860705473e-05, "ema_decay": 0.997778, "it_s": 0.27, "data_frac": 0.901, "body": 0.010021406784653663, "hand": 0.00401109813246876, "loss": 0.009072410650551319}
|
| 74 |
+
{"event": "train", "step": 3500, "lr": 2.500000000000001e-05, "backbone_lr": 2.500000000000001e-05, "ema_decay": 0.997802, "it_s": 0.49, "data_frac": 0.803, "body": 0.009950864631682634, "hand": 0.003994120163843036, "loss": 0.009010326098650694}
|
| 75 |
+
{"event": "train", "step": 3550, "lr": 2.350403678833976e-05, "backbone_lr": 2.350403678833976e-05, "ema_decay": 0.997825, "it_s": 0.3, "data_frac": 0.792, "body": 0.009866843987256289, "hand": 0.003940053740516305, "loss": 0.00893103500828147}
|
| 76 |
+
{"event": "train", "step": 3600, "lr": 2.2040354826462668e-05, "backbone_lr": 2.2040354826462668e-05, "ema_decay": 0.997848, "it_s": 0.49, "data_frac": 0.791, "body": 0.009838415440171958, "hand": 0.0038808573829010127, "loss": 0.008897748496383428}
|
| 77 |
+
{"event": "train", "step": 3650, "lr": 2.061073738537635e-05, "backbone_lr": 2.061073738537635e-05, "ema_decay": 0.99787, "it_s": 0.51, "data_frac": 0.779, "body": 0.009828066509217024, "hand": 0.003845121948979795, "loss": 0.008883391059935093}
|
| 78 |
+
{"event": "train", "step": 3700, "lr": 1.9216926233717085e-05, "backbone_lr": 1.9216926233717085e-05, "ema_decay": 0.997892, "it_s": 0.26, "data_frac": 0.892, "body": 0.009775288794189691, "hand": 0.003888912666589022, "loss": 0.008845861069858074}
|
| 79 |
+
{"event": "train", "step": 3750, "lr": 1.7860619515673033e-05, "backbone_lr": 1.7860619515673033e-05, "ema_decay": 0.997913, "it_s": 0.5, "data_frac": 0.792, "body": 0.009676096085458994, "hand": 0.0038274109130725263, "loss": 0.008752619568258523}
|
| 80 |
+
{"event": "train", "step": 3800, "lr": 1.6543469682057106e-05, "backbone_lr": 1.6543469682057106e-05, "ema_decay": 0.997933, "it_s": 0.3, "data_frac": 0.79, "body": 0.009705723877996206, "hand": 0.0038426768593490123, "loss": 0.008779979720711708}
|
| 81 |
+
{"event": "train", "step": 3850, "lr": 1.526708147705013e-05, "backbone_lr": 1.526708147705013e-05, "ema_decay": 0.997954, "it_s": 0.56, "data_frac": 0.774, "body": 0.009733090829104184, "hand": 0.0037291327910497787, "loss": 0.008785097524523736}
|
| 82 |
+
{"event": "train", "step": 3900, "lr": 1.4033009983067452e-05, "backbone_lr": 1.4033009983067452e-05, "ema_decay": 0.997973, "it_s": 0.43, "data_frac": 0.837, "body": 0.009665802977979183, "hand": 0.0037904380680993197, "loss": 0.0087381137534976}
|
| 83 |
+
{"event": "train", "step": 3950, "lr": 1.2842758726130283e-05, "backbone_lr": 1.2842758726130283e-05, "ema_decay": 0.997993, "it_s": 0.28, "data_frac": 0.891, "body": 0.009584392458200454, "hand": 0.0037201829021796585, "loss": 0.008658464653417469}
|
| 84 |
+
{"event": "train", "step": 4000, "lr": 1.1697777844051105e-05, "backbone_lr": 1.1697777844051105e-05, "ema_decay": 0.998011, "it_s": 0.45, "data_frac": 0.812, "body": 0.00957692151889205, "hand": 0.003646115572191775, "loss": 0.008640478495508433}
|
| 85 |
+
{"event": "train", "step": 4050, "lr": 1.0599462319663905e-05, "backbone_lr": 1.0599462319663905e-05, "ema_decay": 0.99803, "it_s": 0.3, "data_frac": 0.764, "body": 0.009583831932395696, "hand": 0.003722233837470412, "loss": 0.00865831658244133}
|
| 86 |
+
{"event": "train", "step": 4100, "lr": 9.549150281252633e-06, "backbone_lr": 9.549150281252633e-06, "ema_decay": 0.998048, "it_s": 0.38, "data_frac": 0.854, "body": 0.009542494751513005, "hand": 0.003596667326055467, "loss": 0.008603679817169904}
|
| 87 |
+
{"event": "train", "step": 4150, "lr": 8.548121372247918e-06, "backbone_lr": 8.548121372247918e-06, "ema_decay": 0.998066, "it_s": 0.32, "data_frac": 0.858, "body": 0.009555964935570956, "hand": 0.0036209885170683264, "loss": 0.008618863448500633}
|
| 88 |
+
{"event": "train", "step": 4200, "lr": 7.597595192178702e-06, "backbone_lr": 7.597595192178702e-06, "ema_decay": 0.998083, "it_s": 0.51, "data_frac": 0.772, "body": 0.009523146729916334, "hand": 0.003544916124083102, "loss": 0.00857921563088894}
|
| 89 |
+
{"event": "train", "step": 4250, "lr": 6.698729810778065e-06, "backbone_lr": 6.698729810778065e-06, "ema_decay": 0.9981, "it_s": 0.29, "data_frac": 0.888, "body": 0.009471456278115511, "hand": 0.0034999356651678683, "loss": 0.008528584595769644}
|
| 90 |
+
{"event": "save", "step": 4250, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-004250", "mse": 0.008807788603007793, "mse_row0": 0.004809974692761898, "mse_motion_token": 0.009853889234364033, "mse_inspire_left_hand_state": 0.0034390364307910204, "mse_inspire_right_hand_state": 0.003018138464540243}
|
| 91 |
+
{"event": "train", "step": 4300, "lr": 5.852620357053651e-06, "backbone_lr": 5.852620357053651e-06, "ema_decay": 0.998116, "it_s": 0.5, "data_frac": 0.552, "body": 0.009420220088213683, "hand": 0.003532490408979356, "loss": 0.008490578699856997}
|
| 92 |
+
{"event": "train", "step": 4350, "lr": 5.060297685041659e-06, "backbone_lr": 5.060297685041659e-06, "ema_decay": 0.998133, "it_s": 0.39, "data_frac": 0.861, "body": 0.00944553893059492, "hand": 0.003467131736688316, "loss": 0.008501579910516739}
|
| 93 |
+
{"event": "train", "step": 4400, "lr": 4.322727117869951e-06, "backbone_lr": 4.322727117869951e-06, "ema_decay": 0.998149, "it_s": 0.3, "data_frac": 0.889, "body": 0.0094324398227036, "hand": 0.003485148176550865, "loss": 0.008493393864482642}
|
| 94 |
+
{"event": "train", "step": 4450, "lr": 3.6408072716606346e-06, "backbone_lr": 3.6408072716606346e-06, "ema_decay": 0.998164, "it_s": 0.52, "data_frac": 0.798, "body": 0.009429152775555848, "hand": 0.0034750971337780354, "loss": 0.008489038776606322}
|
| 95 |
+
{"event": "train", "step": 4500, "lr": 3.0153689607045845e-06, "backbone_lr": 3.0153689607045845e-06, "ema_decay": 0.99818, "it_s": 0.35, "data_frac": 0.869, "body": 0.00937174802646041, "hand": 0.0034892314253374933, "loss": 0.008442929647862911}
|
| 96 |
+
{"event": "train", "step": 4550, "lr": 2.4471741852423237e-06, "backbone_lr": 2.4471741852423237e-06, "ema_decay": 0.998195, "it_s": 0.43, "data_frac": 0.709, "body": 0.009341708179563283, "hand": 0.0034247005823999643, "loss": 0.00840744387358427}
|
| 97 |
+
{"event": "train", "step": 4600, "lr": 1.9369152030840556e-06, "backbone_lr": 1.9369152030840556e-06, "ema_decay": 0.998209, "it_s": 0.4, "data_frac": 0.853, "body": 0.009352872390300035, "hand": 0.0033892662124708293, "loss": 0.008411250431090594}
|
| 98 |
+
{"event": "train", "step": 4650, "lr": 1.4852136862001764e-06, "backbone_lr": 1.4852136862001764e-06, "ema_decay": 0.998224, "it_s": 0.41, "data_frac": 0.869, "body": 0.009416687451303005, "hand": 0.003381293285638094, "loss": 0.008463730588555336}
|
| 99 |
+
{"event": "train", "step": 4700, "lr": 1.0926199633097157e-06, "backbone_lr": 1.0926199633097157e-06, "ema_decay": 0.998238, "it_s": 0.62, "data_frac": 0.768, "body": 0.009351183231920003, "hand": 0.0034055143594741823, "loss": 0.008412393443286419}
|
| 100 |
+
{"event": "train", "step": 4750, "lr": 7.596123493895991e-07, "backbone_lr": 7.596123493895991e-07, "ema_decay": 0.998252, "it_s": 0.34, "data_frac": 0.867, "body": 0.009311069399118424, "hand": 0.0033910943707451224, "loss": 0.008376336582005024}
|
| 101 |
+
{"event": "train", "step": 4800, "lr": 4.865965629214819e-07, "backbone_lr": 4.865965629214819e-07, "ema_decay": 0.998266, "it_s": 0.38, "data_frac": 0.732, "body": 0.009338868279010058, "hand": 0.003405394973233342, "loss": 0.0084020041115582}
|
| 102 |
+
{"event": "train", "step": 4850, "lr": 2.7390523158633554e-07, "backbone_lr": 2.7390523158633554e-07, "ema_decay": 0.998279, "it_s": 0.56, "data_frac": 0.79, "body": 0.009344917591661214, "hand": 0.003430539178662002, "loss": 0.008411068432033063}
|
| 103 |
+
{"event": "train", "step": 4900, "lr": 1.2179748700879012e-07, "backbone_lr": 1.2179748700879012e-07, "ema_decay": 0.998292, "it_s": 0.37, "data_frac": 0.882, "body": 0.00935862984508276, "hand": 0.0033892499376088382, "loss": 0.008416096270084382}
|
| 104 |
+
{"event": "train", "step": 4950, "lr": 3.04586490452119e-08, "backbone_lr": 3.04586490452119e-08, "ema_decay": 0.998305, "it_s": 0.3, "data_frac": 0.88, "body": 0.009349980056285859, "hand": 0.003399594989605248, "loss": 0.008410445638000965}
|
| 105 |
+
{"event": "train", "step": 5000, "lr": 0.0, "backbone_lr": 0.0, "ema_decay": 0.998318, "it_s": 0.46, "data_frac": 0.82, "body": 0.00929649844765663, "hand": 0.0033691781898960473, "loss": 0.008360605910420418}
|
| 106 |
+
{"event": "save", "step": 5000, "checkpoint": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/ode-runs/a10v3-b512-s5000/checkpoints/step-005000", "mse": 0.008637136779725552, "mse_row0": 0.004760934505611658, "mse_motion_token": 0.00967626366764307, "mse_inspire_left_hand_state": 0.003269098000600934, "mse_inspire_right_hand_state": 0.0029211402870714664}
|
a14-unscrew-bulb/b512-trim3f/step-005000/SHA256SUMS
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
8bbee489176bcb685f8a38781e10ead01c15818b6a847ec51b7d86f3f3ad175f config.json
|
| 2 |
+
8b20163261126c0998f83d9ede659baa3ad47f7bc1acd278b52a055f98ec1a4b model.pt
|
| 3 |
+
3dc3b8fa0c1ea037ab58437aae44363297a42d00e9189ee57d1f43ebd7b00274 protocol.json
|
| 4 |
+
2bd274128b9cc8d9a4b574220e19f456b6c33858b7a180583691ca8458a626f8 training_records/code_commit.txt
|
| 5 |
+
9f7713cea4f846efcfc924234267ced48210357f419d67915c10b504316bedde training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py
|
| 6 |
+
bfbb52f85ac5d91e37f3cfc24bb8671de447b5b566760bfe091204ae69e1f7f6 training_records/code_d2096858/evaluation/baselines/__init__.py
|
| 7 |
+
3db95cd8e4e436875e11f1054a99d250ca7d94e0127909090b58730402340f19 training_records/code_d2096858/evaluation/baselines/act_nets.py
|
| 8 |
+
87e47332381fcb34e75d08cb258475c200519cb5cf17fd0e218bf2a1b21fa890 training_records/code_d2096858/evaluation/baselines/adapters.py
|
| 9 |
+
aa7fc175f50de83b130427cc30533a45220e70d0ed8c807f33ca44d39cb9fb81 training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py
|
| 10 |
+
91f714aa3b7ec6b5c28764496163671cadabe4a833c0b06b6bc4c155cec7f66f training_records/code_d2096858/evaluation/baselines/check_flash_parity.py
|
| 11 |
+
c8b0817f7fe3bdec71b13e94a2e2fea231e0c6c05bd16614b564419ff024e8e2 training_records/code_d2096858/evaluation/baselines/data.py
|
| 12 |
+
35c01a4e2edd80f85878b37928069c09ed3238127bbb51a5443e7f1c92703e53 training_records/code_d2096858/evaluation/baselines/flash.py
|
| 13 |
+
c987d9e641f5e5266703a8154b708d9ccab203b06d5ab82774d39a1cba602d62 training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py
|
| 14 |
+
0e6343d7d28893c4107864b943193eb4a402cf97b1625e94eb2acb1d163ca85c training_records/code_d2096858/evaluation/baselines/inloop.py
|
| 15 |
+
2d72e3c455d5e376a6f5954886fd4c7a6478eb516380c6a05515fa043c62fbce training_records/code_d2096858/evaluation/baselines/nets.py
|
| 16 |
+
38f2ea6050fa45e6c0d5e3f19caf21f1a72a50f80e356044dddcf76da22b144a training_records/code_d2096858/evaluation/baselines/ode_nets.py
|
| 17 |
+
74ca169fe453f64bf6ffc3f3a85a4208aed2961d0abd9eb3e92b96457f86daf1 training_records/code_d2096858/evaluation/baselines/policies.py
|
| 18 |
+
4b79b9dcc98f05bfe7bc9e64e3492f4565728f6d1f75cbdecc1c817d03ff32a5 training_records/code_d2096858/evaluation/baselines/requirements.lock.txt
|
| 19 |
+
56a8db94a98c5256028b475d9a0293cdee4cf475e415df763b3a0232433663ba training_records/code_d2096858/evaluation/baselines/requirements.txt
|
| 20 |
+
8cd8963bb87cdc453293a369658c97a97aadbef77281538d8a4c484925af00c5 training_records/code_d2096858/evaluation/baselines/runtime.py
|
| 21 |
+
cd74f1af7a382eea1903cc20142a19e82b06fe99dd03d5e75a9a42f0ae8ecf04 training_records/code_d2096858/evaluation/baselines/train.py
|
| 22 |
+
2c58049b2fca0406dce9adb4716412371ebe9fead24e4dbd751e10a5d78fcf7d training_records/code_d2096858/evaluation/policy/ODEMLP/deploy.yml
|
| 23 |
+
71f82a6b7c4802c87489a37c80c47b39492e2c4a35fe58fd544eee341e339d0e training_records/code_d2096858/evaluation/policy/ODEMLP/model.py
|
| 24 |
+
fb06bed959e9fa965dfd76f82c48cfee0af18b650ba70d0074e7b08ef9a74339 training_records/inloop-mse.jsonl
|
| 25 |
+
7333ac66d63dfdf95987bbc6277a406706599fed092a923e67089d8974d4f342 training_records/launch.sh
|
| 26 |
+
72942d6f1c95ab99ba51fcf641bfd0e4cb34943c5b19a2a39d8da72ef5daa6b2 training_records/pip_freeze_hb-baselines.txt
|
| 27 |
+
7d8e0ee33a9c85bf602299b0e259035793ab088d659f535254e38f18f7f01796 training_records/run.json
|
| 28 |
+
9cc2f806dd9a0b63f52be45758800be6870b6d11689c1240b6e5304a9f0f745c training_records/train.log
|
| 29 |
+
6c464b1a9788a614f4236886d1f25a3e26eff004ddc4bccd461002c767bcdd51 training_records/train_log.jsonl
|
a14-unscrew-bulb/b512-trim3f/step-005000/config.json
ADDED
|
@@ -0,0 +1,1432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"policy": {
|
| 3 |
+
"policy": "ode_mlp",
|
| 4 |
+
"n_cameras": 2,
|
| 5 |
+
"state_dim": 78,
|
| 6 |
+
"action_dim": 82,
|
| 7 |
+
"horizon": 16,
|
| 8 |
+
"backbone": "resnet18",
|
| 9 |
+
"backbone_weights": null,
|
| 10 |
+
"backbone_norm": "group",
|
| 11 |
+
"hidden_dim": 384,
|
| 12 |
+
"num_layers": 4,
|
| 13 |
+
"num_heads": 8,
|
| 14 |
+
"mlp_ratio": 4.0,
|
| 15 |
+
"dropout": 0.1,
|
| 16 |
+
"time_embed_dim": 128,
|
| 17 |
+
"num_inference_steps": null,
|
| 18 |
+
"num_train_timesteps": 100,
|
| 19 |
+
"beta_schedule": "squaredcos_cap_v2",
|
| 20 |
+
"prediction_type": "epsilon",
|
| 21 |
+
"clip_sample": true,
|
| 22 |
+
"act_hidden_dim": 512,
|
| 23 |
+
"dim_feedforward": 3200,
|
| 24 |
+
"enc_layers": 4,
|
| 25 |
+
"dec_layers": 7,
|
| 26 |
+
"nheads": 8,
|
| 27 |
+
"latent_dim": 32,
|
| 28 |
+
"kl_weight": 10.0,
|
| 29 |
+
"ode_body_dim": 31,
|
| 30 |
+
"ode_width": 512,
|
| 31 |
+
"ode_layers": 4,
|
| 32 |
+
"ode_cond_dim": 512,
|
| 33 |
+
"ode_field_scale": 1.0,
|
| 34 |
+
"ode_dit_hidden": 512,
|
| 35 |
+
"ode_dit_layers": 4,
|
| 36 |
+
"ode_dit_heads": 8,
|
| 37 |
+
"ode_dit_tokens": 4,
|
| 38 |
+
"extra": {}
|
| 39 |
+
},
|
| 40 |
+
"contract": {
|
| 41 |
+
"name": "h2_sharpa_planner",
|
| 42 |
+
"robot": "h2_sharpa",
|
| 43 |
+
"cameras": [
|
| 44 |
+
"head",
|
| 45 |
+
"chest"
|
| 46 |
+
],
|
| 47 |
+
"state": [
|
| 48 |
+
[
|
| 49 |
+
"observation.state",
|
| 50 |
+
0,
|
| 51 |
+
75
|
| 52 |
+
],
|
| 53 |
+
[
|
| 54 |
+
"observation.projected_gravity",
|
| 55 |
+
0,
|
| 56 |
+
3
|
| 57 |
+
]
|
| 58 |
+
],
|
| 59 |
+
"action": [
|
| 60 |
+
[
|
| 61 |
+
"action.body_target",
|
| 62 |
+
0,
|
| 63 |
+
31
|
| 64 |
+
],
|
| 65 |
+
[
|
| 66 |
+
"action.hands",
|
| 67 |
+
0,
|
| 68 |
+
44
|
| 69 |
+
],
|
| 70 |
+
[
|
| 71 |
+
"action.planner",
|
| 72 |
+
0,
|
| 73 |
+
7
|
| 74 |
+
]
|
| 75 |
+
],
|
| 76 |
+
"state_dim": 78,
|
| 77 |
+
"action_dim": 82,
|
| 78 |
+
"action_space": null,
|
| 79 |
+
"body_dims": 31
|
| 80 |
+
},
|
| 81 |
+
"image_hw": [
|
| 82 |
+
168,
|
| 83 |
+
224
|
| 84 |
+
],
|
| 85 |
+
"task_text": "Walk to the table's short edge, pick up the bulb with the left hand, walk along the table to the socket, insert the bulb with the left hand, turn to face the table and screw it in with the right hand's fingers until it lights up.",
|
| 86 |
+
"dataset": {
|
| 87 |
+
"name": "data",
|
| 88 |
+
"root": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/a14-screw-bulb-cropped-v5-33beae7/data",
|
| 89 |
+
"robot_type": "h2_sharpa",
|
| 90 |
+
"fps": 30.0,
|
| 91 |
+
"episodes": [
|
| 92 |
+
0,
|
| 93 |
+
1,
|
| 94 |
+
2,
|
| 95 |
+
3,
|
| 96 |
+
4,
|
| 97 |
+
5,
|
| 98 |
+
6,
|
| 99 |
+
7,
|
| 100 |
+
8,
|
| 101 |
+
9,
|
| 102 |
+
10,
|
| 103 |
+
11,
|
| 104 |
+
12,
|
| 105 |
+
13,
|
| 106 |
+
14,
|
| 107 |
+
15,
|
| 108 |
+
16,
|
| 109 |
+
17,
|
| 110 |
+
18,
|
| 111 |
+
19,
|
| 112 |
+
20,
|
| 113 |
+
21,
|
| 114 |
+
22,
|
| 115 |
+
23,
|
| 116 |
+
24,
|
| 117 |
+
25,
|
| 118 |
+
26,
|
| 119 |
+
27,
|
| 120 |
+
28,
|
| 121 |
+
29,
|
| 122 |
+
30,
|
| 123 |
+
31,
|
| 124 |
+
32,
|
| 125 |
+
33,
|
| 126 |
+
34,
|
| 127 |
+
35,
|
| 128 |
+
36,
|
| 129 |
+
37,
|
| 130 |
+
38,
|
| 131 |
+
39,
|
| 132 |
+
40,
|
| 133 |
+
41,
|
| 134 |
+
42,
|
| 135 |
+
43,
|
| 136 |
+
44,
|
| 137 |
+
45,
|
| 138 |
+
46,
|
| 139 |
+
47,
|
| 140 |
+
48,
|
| 141 |
+
49,
|
| 142 |
+
50,
|
| 143 |
+
51,
|
| 144 |
+
52,
|
| 145 |
+
53,
|
| 146 |
+
54,
|
| 147 |
+
55,
|
| 148 |
+
56,
|
| 149 |
+
57,
|
| 150 |
+
58,
|
| 151 |
+
59,
|
| 152 |
+
60,
|
| 153 |
+
61,
|
| 154 |
+
62,
|
| 155 |
+
63,
|
| 156 |
+
64,
|
| 157 |
+
65,
|
| 158 |
+
66,
|
| 159 |
+
67,
|
| 160 |
+
68,
|
| 161 |
+
69,
|
| 162 |
+
70,
|
| 163 |
+
71,
|
| 164 |
+
72,
|
| 165 |
+
73,
|
| 166 |
+
74,
|
| 167 |
+
75,
|
| 168 |
+
76,
|
| 169 |
+
77,
|
| 170 |
+
78,
|
| 171 |
+
79,
|
| 172 |
+
80,
|
| 173 |
+
81,
|
| 174 |
+
82,
|
| 175 |
+
83,
|
| 176 |
+
84,
|
| 177 |
+
85,
|
| 178 |
+
86,
|
| 179 |
+
87,
|
| 180 |
+
88,
|
| 181 |
+
89,
|
| 182 |
+
90,
|
| 183 |
+
91,
|
| 184 |
+
92,
|
| 185 |
+
93,
|
| 186 |
+
94,
|
| 187 |
+
95,
|
| 188 |
+
96,
|
| 189 |
+
97,
|
| 190 |
+
98,
|
| 191 |
+
99
|
| 192 |
+
],
|
| 193 |
+
"train_episodes": [
|
| 194 |
+
0,
|
| 195 |
+
1,
|
| 196 |
+
2,
|
| 197 |
+
3,
|
| 198 |
+
4,
|
| 199 |
+
5,
|
| 200 |
+
6,
|
| 201 |
+
7,
|
| 202 |
+
8,
|
| 203 |
+
9,
|
| 204 |
+
10,
|
| 205 |
+
11,
|
| 206 |
+
12,
|
| 207 |
+
13,
|
| 208 |
+
14,
|
| 209 |
+
15,
|
| 210 |
+
16,
|
| 211 |
+
17,
|
| 212 |
+
18,
|
| 213 |
+
19,
|
| 214 |
+
20,
|
| 215 |
+
21,
|
| 216 |
+
22,
|
| 217 |
+
23,
|
| 218 |
+
24,
|
| 219 |
+
25,
|
| 220 |
+
26,
|
| 221 |
+
27,
|
| 222 |
+
28,
|
| 223 |
+
29,
|
| 224 |
+
30,
|
| 225 |
+
31,
|
| 226 |
+
32,
|
| 227 |
+
33,
|
| 228 |
+
34,
|
| 229 |
+
35,
|
| 230 |
+
36,
|
| 231 |
+
37,
|
| 232 |
+
38,
|
| 233 |
+
39,
|
| 234 |
+
40,
|
| 235 |
+
41,
|
| 236 |
+
42,
|
| 237 |
+
43,
|
| 238 |
+
44,
|
| 239 |
+
45,
|
| 240 |
+
46,
|
| 241 |
+
47,
|
| 242 |
+
48,
|
| 243 |
+
49,
|
| 244 |
+
50,
|
| 245 |
+
51,
|
| 246 |
+
52,
|
| 247 |
+
53,
|
| 248 |
+
54,
|
| 249 |
+
55,
|
| 250 |
+
56,
|
| 251 |
+
57,
|
| 252 |
+
58,
|
| 253 |
+
59,
|
| 254 |
+
60,
|
| 255 |
+
61,
|
| 256 |
+
62,
|
| 257 |
+
63,
|
| 258 |
+
64,
|
| 259 |
+
65,
|
| 260 |
+
66,
|
| 261 |
+
67,
|
| 262 |
+
68,
|
| 263 |
+
69,
|
| 264 |
+
70,
|
| 265 |
+
71,
|
| 266 |
+
72,
|
| 267 |
+
73,
|
| 268 |
+
74,
|
| 269 |
+
75,
|
| 270 |
+
76,
|
| 271 |
+
77,
|
| 272 |
+
78,
|
| 273 |
+
79,
|
| 274 |
+
80,
|
| 275 |
+
81,
|
| 276 |
+
82,
|
| 277 |
+
83,
|
| 278 |
+
84,
|
| 279 |
+
85,
|
| 280 |
+
86,
|
| 281 |
+
87,
|
| 282 |
+
88,
|
| 283 |
+
89,
|
| 284 |
+
90,
|
| 285 |
+
91,
|
| 286 |
+
92,
|
| 287 |
+
93,
|
| 288 |
+
94,
|
| 289 |
+
95,
|
| 290 |
+
96,
|
| 291 |
+
97,
|
| 292 |
+
98,
|
| 293 |
+
99
|
| 294 |
+
],
|
| 295 |
+
"val_episodes": [],
|
| 296 |
+
"train_frames": 137710,
|
| 297 |
+
"git_commit": "48f5b360b342e04ce7b709b1ffb486260b5bf5db"
|
| 298 |
+
},
|
| 299 |
+
"training": {
|
| 300 |
+
"steps": 5000,
|
| 301 |
+
"batch_size": 512,
|
| 302 |
+
"lr": 0.0001,
|
| 303 |
+
"betas": [
|
| 304 |
+
0.95,
|
| 305 |
+
0.999
|
| 306 |
+
],
|
| 307 |
+
"weight_decay": 1e-06,
|
| 308 |
+
"warmup": 500,
|
| 309 |
+
"schedule": "diffusers_cosine",
|
| 310 |
+
"backbone_lr_scale": 1.0,
|
| 311 |
+
"ema": 0.9999,
|
| 312 |
+
"shift_px": 0,
|
| 313 |
+
"amp": true,
|
| 314 |
+
"seed": 42,
|
| 315 |
+
"augmentation": {
|
| 316 |
+
"spec": "docs/augmentation_v2.md",
|
| 317 |
+
"version": "hb-aug-v2-20261109",
|
| 318 |
+
"implementation": "evaluation/augmentation/hb_aug_v2.py",
|
| 319 |
+
"visual": {
|
| 320 |
+
"effects": [
|
| 321 |
+
"exposure",
|
| 322 |
+
"contrast",
|
| 323 |
+
"saturation",
|
| 324 |
+
"hue",
|
| 325 |
+
"gamma",
|
| 326 |
+
"temperature",
|
| 327 |
+
"rotation_crop",
|
| 328 |
+
"noise",
|
| 329 |
+
"gaussian_blur",
|
| 330 |
+
"jpeg",
|
| 331 |
+
"motion_blur",
|
| 332 |
+
"sharpen",
|
| 333 |
+
"defocus",
|
| 334 |
+
"light_shadow",
|
| 335 |
+
"wb_channel"
|
| 336 |
+
],
|
| 337 |
+
"boosted_per_sample": 1,
|
| 338 |
+
"boost": 1.5,
|
| 339 |
+
"pixel_scale": "H / 224",
|
| 340 |
+
"future_targets": "none (one observation frame)"
|
| 341 |
+
},
|
| 342 |
+
"proprio": {
|
| 343 |
+
"robot": "h2_sharpa",
|
| 344 |
+
"body_dims": 31,
|
| 345 |
+
"bias_deg": 2.0,
|
| 346 |
+
"bias_scope": "per_sample",
|
| 347 |
+
"noise_deg": 0.25,
|
| 348 |
+
"noise_clip_sigma": 3,
|
| 349 |
+
"delay_probability": 0.0,
|
| 350 |
+
"history_drop_probability": 0.0,
|
| 351 |
+
"velocity": false
|
| 352 |
+
},
|
| 353 |
+
"native_image_augmentation": "off",
|
| 354 |
+
"evaluation": "off"
|
| 355 |
+
},
|
| 356 |
+
"preflight": {
|
| 357 |
+
"samples": 64,
|
| 358 |
+
"state_dim": 78,
|
| 359 |
+
"body_dims": 31,
|
| 360 |
+
"images_changed": 64,
|
| 361 |
+
"body_values_moved": 1.0,
|
| 362 |
+
"max_body_offset_deg": 2.487,
|
| 363 |
+
"actions_bit_identical": true,
|
| 364 |
+
"non_body_state_bit_identical": true,
|
| 365 |
+
"eval_items_deterministic": 8
|
| 366 |
+
},
|
| 367 |
+
"aug_seed": 42,
|
| 368 |
+
"layout": {
|
| 369 |
+
"nodes": 1,
|
| 370 |
+
"gpus": 1,
|
| 371 |
+
"per_gpu_batch": 512,
|
| 372 |
+
"global_batch": 512,
|
| 373 |
+
"gradient_accumulation": 1,
|
| 374 |
+
"num_workers": 32,
|
| 375 |
+
"prefetch": 2
|
| 376 |
+
},
|
| 377 |
+
"continuation": null,
|
| 378 |
+
"total_steps": 5000,
|
| 379 |
+
"save_steps": [
|
| 380 |
+
750,
|
| 381 |
+
1750,
|
| 382 |
+
2500,
|
| 383 |
+
3250,
|
| 384 |
+
4250,
|
| 385 |
+
5000
|
| 386 |
+
],
|
| 387 |
+
"save_rule": "6 checkpoints spread evenly over the steps on the 250-step grid (owner 2026-11-27)",
|
| 388 |
+
"protocol_exceptions": [],
|
| 389 |
+
"ema_schedule": "diffusion_policy_emamodel",
|
| 390 |
+
"inloop": {
|
| 391 |
+
"task": "a14cr5",
|
| 392 |
+
"code": "/mnt/nas/cross/Team/RobotAgent/Personal/baijiaqi/humanoid-benchmark-work/preflight-20261104T1648Z/policies-20261109/eval-action-mse",
|
| 393 |
+
"every": 250,
|
| 394 |
+
"exception": null,
|
| 395 |
+
"code_sha256": {
|
| 396 |
+
"hb_inloop_core.py": "6c7c160f05cc624eeebd0721c5241b52d2b6b64ac25cd1e9fd72e0b8a6aca8e6",
|
| 397 |
+
"hb_eval_common.py": "c26efcb8e6c49be8b5883ec187e5b7292bd19d81c4442ba5ee1ba35e9bb8c8a6"
|
| 398 |
+
}
|
| 399 |
+
},
|
| 400 |
+
"protocol_recipe": {
|
| 401 |
+
"batch_size": 512,
|
| 402 |
+
"steps": 5000,
|
| 403 |
+
"warmup": 500,
|
| 404 |
+
"workers": 32,
|
| 405 |
+
"long_task_factor": 1
|
| 406 |
+
},
|
| 407 |
+
"protocol_deviations": [],
|
| 408 |
+
"environment": {
|
| 409 |
+
"python": "3.12.12",
|
| 410 |
+
"torch": "2.9.0+cu128",
|
| 411 |
+
"numpy": "2.2.6",
|
| 412 |
+
"cuda": "12.8",
|
| 413 |
+
"cudnn": 91002,
|
| 414 |
+
"torchvision": "0.24.0+cu128",
|
| 415 |
+
"pillow": "13.0.0",
|
| 416 |
+
"gpu": "NVIDIA A800-SXM4-80GB",
|
| 417 |
+
"driver": "570.133.20"
|
| 418 |
+
},
|
| 419 |
+
"code_dirty": null,
|
| 420 |
+
"allow_dirty_tree": false,
|
| 421 |
+
"augmentation_sha256": "9f7713cea4f846efcfc924234267ced48210357f419d67915c10b504316bedde",
|
| 422 |
+
"order": "EpochSampler: default_rng([seed, 1, epoch]) permutation; augmentation default_rng([aug_seed, draw])",
|
| 423 |
+
"upstream": "NTUMARS/ODE-POLICY real-g1@fd8bec47 (G1 port, HumanWAM packages/ode_g1) + main@cea26d94 (encoder, ode_dit field, default_train.yaml)"
|
| 424 |
+
},
|
| 425 |
+
"stats": {
|
| 426 |
+
"state": {
|
| 427 |
+
"min": [
|
| 428 |
+
-0.6128958463668823,
|
| 429 |
+
-0.19324859976768494,
|
| 430 |
+
-0.8298172950744629,
|
| 431 |
+
0.10861875116825104,
|
| 432 |
+
-0.20572978258132935,
|
| 433 |
+
-1.0465019941329956,
|
| 434 |
+
-0.814046323299408,
|
| 435 |
+
-0.3444327712059021,
|
| 436 |
+
-0.874907910823822,
|
| 437 |
+
0.1267164647579193,
|
| 438 |
+
-0.1505868136882782,
|
| 439 |
+
-0.7191075682640076,
|
| 440 |
+
-0.15643762052059174,
|
| 441 |
+
-0.39456242322921753,
|
| 442 |
+
-0.04761948063969612,
|
| 443 |
+
-0.6826726198196411,
|
| 444 |
+
-0.3249562680721283,
|
| 445 |
+
-0.8324018716812134,
|
| 446 |
+
-0.9995133280754089,
|
| 447 |
+
-1.9461172819137573,
|
| 448 |
+
-0.4419930875301361,
|
| 449 |
+
-0.6200801730155945,
|
| 450 |
+
-1.3342407941818237,
|
| 451 |
+
-1.6312137842178345,
|
| 452 |
+
-2.5693843364715576,
|
| 453 |
+
-1.015097975730896,
|
| 454 |
+
-2.498225212097168,
|
| 455 |
+
-0.46122172474861145,
|
| 456 |
+
-1.2372018098831177,
|
| 457 |
+
-0.32443222403526306,
|
| 458 |
+
-0.5137076377868652,
|
| 459 |
+
2.4212948801505263e-07,
|
| 460 |
+
1.9910926596367062e-07,
|
| 461 |
+
-0.006993828807026148,
|
| 462 |
+
1.551115076381393e-07,
|
| 463 |
+
-0.04919465631246567,
|
| 464 |
+
-0.0009927804348990321,
|
| 465 |
+
-0.000999723095446825,
|
| 466 |
+
1.1005165134747585e-07,
|
| 467 |
+
-0.041222814470529556,
|
| 468 |
+
-0.35059306025505066,
|
| 469 |
+
4.015005217183898e-08,
|
| 470 |
+
3.39188943598856e-08,
|
| 471 |
+
-0.044367291033267975,
|
| 472 |
+
2.7533335611451548e-08,
|
| 473 |
+
-0.12385445088148117,
|
| 474 |
+
6.039768241095089e-09,
|
| 475 |
+
5.28672128297103e-09,
|
| 476 |
+
2.0993535798652374e-08,
|
| 477 |
+
4.511860662859135e-09,
|
| 478 |
+
-0.34986552596092224,
|
| 479 |
+
3.718351404558007e-09,
|
| 480 |
+
-0.0007463634246960282,
|
| 481 |
+
-0.17600925266742706,
|
| 482 |
+
-0.19547110795974731,
|
| 483 |
+
-0.001285196398384869,
|
| 484 |
+
-0.1261255443096161,
|
| 485 |
+
-0.18237802386283875,
|
| 486 |
+
-0.3570866286754608,
|
| 487 |
+
-0.35529616475105286,
|
| 488 |
+
-0.01663997583091259,
|
| 489 |
+
-0.33883997797966003,
|
| 490 |
+
-0.3577636480331421,
|
| 491 |
+
-0.007328241132199764,
|
| 492 |
+
-0.02236497588455677,
|
| 493 |
+
-0.15625543892383575,
|
| 494 |
+
-0.0035276319831609726,
|
| 495 |
+
-0.35315313935279846,
|
| 496 |
+
-0.008533859625458717,
|
| 497 |
+
-0.004321299493312836,
|
| 498 |
+
-0.0037566684186458588,
|
| 499 |
+
-0.003450079122558236,
|
| 500 |
+
-0.3511973023414612,
|
| 501 |
+
-0.004400239791721106,
|
| 502 |
+
-0.004646706394851208,
|
| 503 |
+
-0.6133120656013489,
|
| 504 |
+
-0.17329253256320953,
|
| 505 |
+
-1.0
|
| 506 |
+
],
|
| 507 |
+
"max": [
|
| 508 |
+
0.2436567097902298,
|
| 509 |
+
0.46225106716156006,
|
| 510 |
+
0.3263247013092041,
|
| 511 |
+
1.9302681684494019,
|
| 512 |
+
0.1985584944486618,
|
| 513 |
+
0.1742379069328308,
|
| 514 |
+
0.23584064841270447,
|
| 515 |
+
0.18926510214805603,
|
| 516 |
+
0.3123853802680969,
|
| 517 |
+
1.7143502235412598,
|
| 518 |
+
0.2334698885679245,
|
| 519 |
+
0.24713154137134552,
|
| 520 |
+
0.2847904860973358,
|
| 521 |
+
0.1842348724603653,
|
| 522 |
+
0.5673450231552124,
|
| 523 |
+
0.7763772010803223,
|
| 524 |
+
0.570816695690155,
|
| 525 |
+
1.1427453756332397,
|
| 526 |
+
1.2946008443832397,
|
| 527 |
+
0.396441251039505,
|
| 528 |
+
0.4460962414741516,
|
| 529 |
+
1.149983286857605,
|
| 530 |
+
1.3257502317428589,
|
| 531 |
+
0.28701746463775635,
|
| 532 |
+
1.3928301334381104,
|
| 533 |
+
1.9761289358139038,
|
| 534 |
+
1.6500089168548584,
|
| 535 |
+
0.4516933560371399,
|
| 536 |
+
1.073415756225586,
|
| 537 |
+
0.8440645337104797,
|
| 538 |
+
0.9505477547645569,
|
| 539 |
+
0.6654372215270996,
|
| 540 |
+
0.754692554473877,
|
| 541 |
+
0.211256742477417,
|
| 542 |
+
0.7687531113624573,
|
| 543 |
+
1.6420538425445557,
|
| 544 |
+
0.17422638833522797,
|
| 545 |
+
0.1434764564037323,
|
| 546 |
+
0.87432861328125,
|
| 547 |
+
0.11292567104101181,
|
| 548 |
+
-0.00012538969167508185,
|
| 549 |
+
1.1350568532943726,
|
| 550 |
+
1.087564468383789,
|
| 551 |
+
0.2749204635620117,
|
| 552 |
+
0.9347710013389587,
|
| 553 |
+
0.3845101594924927,
|
| 554 |
+
0.23132097721099854,
|
| 555 |
+
0.0563536174595356,
|
| 556 |
+
0.6765928268432617,
|
| 557 |
+
0.060973163694143295,
|
| 558 |
+
0.044674504548311234,
|
| 559 |
+
0.20326904952526093,
|
| 560 |
+
0.3997642695903778,
|
| 561 |
+
0.8941553235054016,
|
| 562 |
+
0.7032538056373596,
|
| 563 |
+
0.26894673705101013,
|
| 564 |
+
0.699828565120697,
|
| 565 |
+
0.9366040229797363,
|
| 566 |
+
0.18415626883506775,
|
| 567 |
+
0.35696694254875183,
|
| 568 |
+
1.241142749786377,
|
| 569 |
+
0.3237578570842743,
|
| 570 |
+
-7.032287248875946e-05,
|
| 571 |
+
1.1046971082687378,
|
| 572 |
+
1.0755008459091187,
|
| 573 |
+
0.3284328877925873,
|
| 574 |
+
1.123056173324585,
|
| 575 |
+
1.209879994392395,
|
| 576 |
+
1.3894870281219482,
|
| 577 |
+
1.1016167402267456,
|
| 578 |
+
1.4017410278320312,
|
| 579 |
+
1.034745693206787,
|
| 580 |
+
0.18572156131267548,
|
| 581 |
+
1.3946471214294434,
|
| 582 |
+
1.7500405311584473,
|
| 583 |
+
0.07943684607744217,
|
| 584 |
+
0.2704276442527771,
|
| 585 |
+
-0.7421032190322876
|
| 586 |
+
],
|
| 587 |
+
"mean": [
|
| 588 |
+
-0.08354651030561694,
|
| 589 |
+
0.04725753939305331,
|
| 590 |
+
-0.009366752860414006,
|
| 591 |
+
0.30071821119959563,
|
| 592 |
+
-0.019650648648774718,
|
| 593 |
+
-0.18335331935117766,
|
| 594 |
+
-0.07642503593196501,
|
| 595 |
+
-0.034187007835686366,
|
| 596 |
+
-0.14353155823043534,
|
| 597 |
+
0.27623329040399697,
|
| 598 |
+
0.009389511228003244,
|
| 599 |
+
-0.1664798755802125,
|
| 600 |
+
0.028511756491150012,
|
| 601 |
+
-0.0003067224047389682,
|
| 602 |
+
0.1221077126362021,
|
| 603 |
+
-0.049330413981328966,
|
| 604 |
+
0.0292286337621421,
|
| 605 |
+
0.12641751099947796,
|
| 606 |
+
0.4736152319203896,
|
| 607 |
+
-0.6217730908888135,
|
| 608 |
+
0.03767904854445341,
|
| 609 |
+
0.1144942418072655,
|
| 610 |
+
-0.08816607002987384,
|
| 611 |
+
-0.2879288937875049,
|
| 612 |
+
0.24720920416287753,
|
| 613 |
+
0.6812665529775661,
|
| 614 |
+
0.1716690854103586,
|
| 615 |
+
-0.004329388600531067,
|
| 616 |
+
-0.18322983765445108,
|
| 617 |
+
0.17872113307681517,
|
| 618 |
+
0.19337833495517728,
|
| 619 |
+
0.3573360474068501,
|
| 620 |
+
0.42073842595760985,
|
| 621 |
+
0.13288452523175737,
|
| 622 |
+
0.43951335737099095,
|
| 623 |
+
1.033706409349726,
|
| 624 |
+
0.0919490407999961,
|
| 625 |
+
0.07104257237253224,
|
| 626 |
+
0.5031608137308332,
|
| 627 |
+
0.05311895964597188,
|
| 628 |
+
-0.21556434032192714,
|
| 629 |
+
0.5946467378956548,
|
| 630 |
+
0.5935296749112697,
|
| 631 |
+
0.1345905810539888,
|
| 632 |
+
0.518488696171286,
|
| 633 |
+
0.21264374936945574,
|
| 634 |
+
0.12541826195376485,
|
| 635 |
+
0.034716311950507485,
|
| 636 |
+
0.385876234743436,
|
| 637 |
+
0.03755883292991496,
|
| 638 |
+
-0.2122902075274478,
|
| 639 |
+
0.11733440016379194,
|
| 640 |
+
0.14517505148516138,
|
| 641 |
+
0.1368429049239406,
|
| 642 |
+
0.10068217523346666,
|
| 643 |
+
0.019643744280007473,
|
| 644 |
+
0.09585086265384878,
|
| 645 |
+
0.17527774240123942,
|
| 646 |
+
-0.03349648075273464,
|
| 647 |
+
-0.010026619845663087,
|
| 648 |
+
0.13375520167936866,
|
| 649 |
+
0.01956414449185795,
|
| 650 |
+
-0.1393389168116144,
|
| 651 |
+
0.14783187601622946,
|
| 652 |
+
0.1978407668396568,
|
| 653 |
+
0.035016277086429584,
|
| 654 |
+
0.20741543579522234,
|
| 655 |
+
0.16543386414859548,
|
| 656 |
+
0.2802358604228079,
|
| 657 |
+
0.17280826271869693,
|
| 658 |
+
0.23500457033925495,
|
| 659 |
+
0.19546839206602398,
|
| 660 |
+
-0.0504597438801001,
|
| 661 |
+
0.26759623000192806,
|
| 662 |
+
0.34573186400757683,
|
| 663 |
+
-0.02719962657767618,
|
| 664 |
+
0.0061957887464379234,
|
| 665 |
+
-0.9981041500631755
|
| 666 |
+
],
|
| 667 |
+
"std": [
|
| 668 |
+
0.08471564437981204,
|
| 669 |
+
0.05482250924193728,
|
| 670 |
+
0.09843280677952204,
|
| 671 |
+
0.14049032568387773,
|
| 672 |
+
0.03545918992084279,
|
| 673 |
+
0.06217247943560385,
|
| 674 |
+
0.08556624886717316,
|
| 675 |
+
0.05248610851595122,
|
| 676 |
+
0.15842726994482942,
|
| 677 |
+
0.12445736185429294,
|
| 678 |
+
0.03436329146635345,
|
| 679 |
+
0.062001638807817824,
|
| 680 |
+
0.052973426552096435,
|
| 681 |
+
0.05164765174812638,
|
| 682 |
+
0.04112023643372598,
|
| 683 |
+
0.1980785342198492,
|
| 684 |
+
0.14014483643956185,
|
| 685 |
+
0.36758511624187495,
|
| 686 |
+
0.6117925407009206,
|
| 687 |
+
0.6424917108206829,
|
| 688 |
+
0.17313687479865036,
|
| 689 |
+
0.1675665262013517,
|
| 690 |
+
0.34482231800302354,
|
| 691 |
+
0.2902941466808229,
|
| 692 |
+
0.40357445774138845,
|
| 693 |
+
0.7371366258215598,
|
| 694 |
+
0.5019944919091339,
|
| 695 |
+
0.15308532996430774,
|
| 696 |
+
0.2394994164913133,
|
| 697 |
+
0.18928184558438454,
|
| 698 |
+
0.28347481813063763,
|
| 699 |
+
0.1456264214973317,
|
| 700 |
+
0.16756910467898653,
|
| 701 |
+
0.04630924985256937,
|
| 702 |
+
0.1716661502144274,
|
| 703 |
+
0.37854985601660796,
|
| 704 |
+
0.040101087473758734,
|
| 705 |
+
0.03125170517623959,
|
| 706 |
+
0.19084218555982949,
|
| 707 |
+
0.024633556700121493,
|
| 708 |
+
0.08123692981523954,
|
| 709 |
+
0.2591007963093826,
|
| 710 |
+
0.24939541919122166,
|
| 711 |
+
0.060127939732816944,
|
| 712 |
+
0.21152345493431013,
|
| 713 |
+
0.06895790627297965,
|
| 714 |
+
0.05136187138440096,
|
| 715 |
+
0.01143797391104454,
|
| 716 |
+
0.14867316041219122,
|
| 717 |
+
0.012200897390107246,
|
| 718 |
+
0.08860969667802321,
|
| 719 |
+
0.042940195756021295,
|
| 720 |
+
0.05640999356703257,
|
| 721 |
+
0.2556300620297241,
|
| 722 |
+
0.195705250455841,
|
| 723 |
+
0.04616686029950428,
|
| 724 |
+
0.18924823749096756,
|
| 725 |
+
0.2859534281538623,
|
| 726 |
+
0.0850220781144134,
|
| 727 |
+
0.0759159683973645,
|
| 728 |
+
0.2551135931430946,
|
| 729 |
+
0.08380961096709123,
|
| 730 |
+
0.08386966637646585,
|
| 731 |
+
0.2860821074463346,
|
| 732 |
+
0.34733439302984237,
|
| 733 |
+
0.08645578471238119,
|
| 734 |
+
0.3604260573075161,
|
| 735 |
+
0.3316803343004606,
|
| 736 |
+
0.4887722762480838,
|
| 737 |
+
0.305662132265769,
|
| 738 |
+
0.4122015105317262,
|
| 739 |
+
0.3399877655919794,
|
| 740 |
+
0.10833677801165155,
|
| 741 |
+
0.4630749321587679,
|
| 742 |
+
0.5989471246948389,
|
| 743 |
+
0.047716490580767754,
|
| 744 |
+
0.0267984869941054,
|
| 745 |
+
0.0038569193994596
|
| 746 |
+
],
|
| 747 |
+
"q01": [
|
| 748 |
+
-0.36865327388048175,
|
| 749 |
+
-0.1127580863982439,
|
| 750 |
+
-0.34728871047496795,
|
| 751 |
+
0.1617175106704235,
|
| 752 |
+
-0.12184366203844547,
|
| 753 |
+
-0.41059029012918474,
|
| 754 |
+
-0.3887779641151428,
|
| 755 |
+
-0.23312021255493165,
|
| 756 |
+
-0.5871244782209396,
|
| 757 |
+
0.1734321616590023,
|
| 758 |
+
-0.10030872769653798,
|
| 759 |
+
-0.3908775019645691,
|
| 760 |
+
-0.08030304968357087,
|
| 761 |
+
-0.11651539966464043,
|
| 762 |
+
0.029586794525384902,
|
| 763 |
+
-0.528789930343628,
|
| 764 |
+
-0.2419738519191742,
|
| 765 |
+
-0.471008694767952,
|
| 766 |
+
-0.6456307297945023,
|
| 767 |
+
-1.629897071123123,
|
| 768 |
+
-0.3250054171681404,
|
| 769 |
+
-0.19908321693539618,
|
| 770 |
+
-0.9565948736667633,
|
| 771 |
+
-1.1767638576030732,
|
| 772 |
+
-0.7079000532627107,
|
| 773 |
+
-0.9438373678922654,
|
| 774 |
+
-0.3890687566995621,
|
| 775 |
+
-0.4338689804077148,
|
| 776 |
+
-0.9514162755012512,
|
| 777 |
+
-0.2607893216609955,
|
| 778 |
+
-0.36408253222703935,
|
| 779 |
+
0.0008159987616818398,
|
| 780 |
+
0.0008095989708090201,
|
| 781 |
+
1.986896950256778e-05,
|
| 782 |
+
0.0008059207047335803,
|
| 783 |
+
0.03094156991690397,
|
| 784 |
+
-0.0006189257540972904,
|
| 785 |
+
-0.0006326749169966206,
|
| 786 |
+
0.0008053799730259925,
|
| 787 |
+
-0.0006481190776685253,
|
| 788 |
+
-0.34935450553894043,
|
| 789 |
+
0.00015417497270391322,
|
| 790 |
+
0.00015411619402584618,
|
| 791 |
+
-0.0005959716887446121,
|
| 792 |
+
0.0001540800218936056,
|
| 793 |
+
-0.03395858097821474,
|
| 794 |
+
2.7797830080089624e-05,
|
| 795 |
+
2.7792820874310563e-05,
|
| 796 |
+
0.00015404498437419535,
|
| 797 |
+
2.7785525780927855e-05,
|
| 798 |
+
-0.34915900230407715,
|
| 799 |
+
2.778261217827094e-05,
|
| 800 |
+
-1.3460085856422666e-05,
|
| 801 |
+
-0.0045977917546406386,
|
| 802 |
+
-0.08778044536709785,
|
| 803 |
+
-2.293211834967224e-06,
|
| 804 |
+
-0.11982646122574807,
|
| 805 |
+
-0.06734344832599164,
|
| 806 |
+
-0.32813739508390427,
|
| 807 |
+
-0.3230635362863541,
|
| 808 |
+
-0.003186477420385928,
|
| 809 |
+
-0.18947367131710052,
|
| 810 |
+
-0.33909642428159714,
|
| 811 |
+
0.0001553081274323631,
|
| 812 |
+
0.0001591975752671715,
|
| 813 |
+
-0.06794366642832757,
|
| 814 |
+
0.0001566761828144081,
|
| 815 |
+
-0.1087511783093214,
|
| 816 |
+
2.8387169149937107e-05,
|
| 817 |
+
2.8261090119485743e-05,
|
| 818 |
+
0.0001593926569330506,
|
| 819 |
+
2.8411781713657546e-05,
|
| 820 |
+
-0.3408314374089241,
|
| 821 |
+
2.8411443436198168e-05,
|
| 822 |
+
-0.0001166950304468628,
|
| 823 |
+
-0.16964534297585487,
|
| 824 |
+
-0.07413832984864711,
|
| 825 |
+
-0.9999980926513672
|
| 826 |
+
],
|
| 827 |
+
"q99": [
|
| 828 |
+
0.08976203560829167,
|
| 829 |
+
0.21116851821541802,
|
| 830 |
+
0.19317950785160068,
|
| 831 |
+
0.9517350393533708,
|
| 832 |
+
0.08782939523458481,
|
| 833 |
+
-0.017007603030651772,
|
| 834 |
+
0.09091045767068878,
|
| 835 |
+
0.09344155117869388,
|
| 836 |
+
0.13973379328846944,
|
| 837 |
+
0.9032503926753999,
|
| 838 |
+
0.09139453940093523,
|
| 839 |
+
0.025162798836827392,
|
| 840 |
+
0.13370835930109023,
|
| 841 |
+
0.1528695972263813,
|
| 842 |
+
0.21164952516555785,
|
| 843 |
+
0.34143199533224117,
|
| 844 |
+
0.4174712419509889,
|
| 845 |
+
0.9597934979200364,
|
| 846 |
+
1.2113887214660646,
|
| 847 |
+
0.28451963692903526,
|
| 848 |
+
0.42096773922443426,
|
| 849 |
+
0.7387838071584705,
|
| 850 |
+
0.768415585756302,
|
| 851 |
+
-0.07177672140300269,
|
| 852 |
+
1.0232282412052154,
|
| 853 |
+
1.335347754955292,
|
| 854 |
+
1.2553449225425721,
|
| 855 |
+
0.4325573471188546,
|
| 856 |
+
0.535766569375992,
|
| 857 |
+
0.5498085457086578,
|
| 858 |
+
0.7335926795005799,
|
| 859 |
+
0.608335030078888,
|
| 860 |
+
0.7048343402147293,
|
| 861 |
+
0.2029188998043537,
|
| 862 |
+
0.7312266528606415,
|
| 863 |
+
1.5953516852855683,
|
| 864 |
+
0.1657065273821354,
|
| 865 |
+
0.13050649002194406,
|
| 866 |
+
0.8170429712533951,
|
| 867 |
+
0.10265602238476276,
|
| 868 |
+
-0.0848467380553484,
|
| 869 |
+
1.0565450525283815,
|
| 870 |
+
1.0266949927806854,
|
| 871 |
+
0.24463892087340355,
|
| 872 |
+
0.8781646472215653,
|
| 873 |
+
0.32946642488241196,
|
| 874 |
+
0.21401607260108,
|
| 875 |
+
0.05028947308659554,
|
| 876 |
+
0.6334358733892441,
|
| 877 |
+
0.0544988314062357,
|
| 878 |
+
0.0008883542841067548,
|
| 879 |
+
0.18645445957779888,
|
| 880 |
+
0.2526115715503693,
|
| 881 |
+
0.7491098165512089,
|
| 882 |
+
0.577875475883484,
|
| 883 |
+
0.21225890025496483,
|
| 884 |
+
0.5669411057233811,
|
| 885 |
+
0.820576726794243,
|
| 886 |
+
0.0860746577382088,
|
| 887 |
+
0.15325056225061418,
|
| 888 |
+
0.8072744703292847,
|
| 889 |
+
0.2694370052218437,
|
| 890 |
+
-0.04044911105185746,
|
| 891 |
+
1.0983893549442292,
|
| 892 |
+
1.0240691792964935,
|
| 893 |
+
0.3280832740664482,
|
| 894 |
+
1.0697837638854981,
|
| 895 |
+
1.145263661146164,
|
| 896 |
+
1.3780418539047241,
|
| 897 |
+
0.9866052812337875,
|
| 898 |
+
1.38982461810112,
|
| 899 |
+
1.029849886894226,
|
| 900 |
+
0.09714975640177742,
|
| 901 |
+
1.3829617500305176,
|
| 902 |
+
1.7212290227413178,
|
| 903 |
+
0.033693113103509004,
|
| 904 |
+
0.08216409489512451,
|
| 905 |
+
-0.984537740945816
|
| 906 |
+
],
|
| 907 |
+
"unit_dims": []
|
| 908 |
+
},
|
| 909 |
+
"action": {
|
| 910 |
+
"min": [
|
| 911 |
+
-1.3360610008239746,
|
| 912 |
+
-0.556527853012085,
|
| 913 |
+
-0.7912365794181824,
|
| 914 |
+
-0.6635185480117798,
|
| 915 |
+
-0.2566780149936676,
|
| 916 |
+
-2.2260026931762695,
|
| 917 |
+
-1.5023866891860962,
|
| 918 |
+
-0.8661556839942932,
|
| 919 |
+
-0.9158138632774353,
|
| 920 |
+
-0.6750026941299438,
|
| 921 |
+
-0.3781881332397461,
|
| 922 |
+
-2.3237345218658447,
|
| 923 |
+
-0.19714340567588806,
|
| 924 |
+
-0.5128103494644165,
|
| 925 |
+
-0.49847859144210815,
|
| 926 |
+
-0.6817602515220642,
|
| 927 |
+
-0.516617476940155,
|
| 928 |
+
-0.8599881529808044,
|
| 929 |
+
-0.9435862302780151,
|
| 930 |
+
-1.9428762197494507,
|
| 931 |
+
-0.4363322854042053,
|
| 932 |
+
-0.34834763407707214,
|
| 933 |
+
-1.4093296527862549,
|
| 934 |
+
-1.6139307022094727,
|
| 935 |
+
-2.552405834197998,
|
| 936 |
+
-0.9861109852790833,
|
| 937 |
+
-2.500661611557007,
|
| 938 |
+
-0.47342196106910706,
|
| 939 |
+
-1.2217304706573486,
|
| 940 |
+
-0.3470655083656311,
|
| 941 |
+
-0.5276036858558655,
|
| 942 |
+
0.0,
|
| 943 |
+
0.0,
|
| 944 |
+
0.0,
|
| 945 |
+
0.0,
|
| 946 |
+
0.0,
|
| 947 |
+
0.0,
|
| 948 |
+
0.0,
|
| 949 |
+
0.0,
|
| 950 |
+
0.0,
|
| 951 |
+
-0.34934768080711365,
|
| 952 |
+
0.0,
|
| 953 |
+
0.0,
|
| 954 |
+
0.0,
|
| 955 |
+
0.0,
|
| 956 |
+
0.0,
|
| 957 |
+
0.0,
|
| 958 |
+
0.0,
|
| 959 |
+
0.0,
|
| 960 |
+
0.0,
|
| 961 |
+
-0.34914669394493103,
|
| 962 |
+
0.0,
|
| 963 |
+
0.0,
|
| 964 |
+
-0.01080000028014183,
|
| 965 |
+
-0.09933027625083923,
|
| 966 |
+
0.0,
|
| 967 |
+
-0.1306000053882599,
|
| 968 |
+
0.0,
|
| 969 |
+
-0.32910001277923584,
|
| 970 |
+
-0.32909998297691345,
|
| 971 |
+
0.0,
|
| 972 |
+
-0.32909998297691345,
|
| 973 |
+
-0.32910001277923584,
|
| 974 |
+
0.0,
|
| 975 |
+
0.0,
|
| 976 |
+
-0.21770872175693512,
|
| 977 |
+
0.0,
|
| 978 |
+
0.0,
|
| 979 |
+
0.0,
|
| 980 |
+
0.0,
|
| 981 |
+
0.0,
|
| 982 |
+
0.0,
|
| 983 |
+
-0.32909998297691345,
|
| 984 |
+
0.0,
|
| 985 |
+
0.0,
|
| 986 |
+
0.0,
|
| 987 |
+
0.0,
|
| 988 |
+
-0.07298091053962708,
|
| 989 |
+
-1.0,
|
| 990 |
+
0.6693262457847595,
|
| 991 |
+
-0.467713326215744,
|
| 992 |
+
0.0
|
| 993 |
+
],
|
| 994 |
+
"max": [
|
| 995 |
+
0.45084860920906067,
|
| 996 |
+
1.3837697505950928,
|
| 997 |
+
0.4785388708114624,
|
| 998 |
+
1.2688502073287964,
|
| 999 |
+
0.36922043561935425,
|
| 1000 |
+
2.111999988555908,
|
| 1001 |
+
0.71623295545578,
|
| 1002 |
+
0.6330417394638062,
|
| 1003 |
+
0.3554445207118988,
|
| 1004 |
+
1.2778302431106567,
|
| 1005 |
+
0.31986933946609497,
|
| 1006 |
+
2.111999988555908,
|
| 1007 |
+
0.2532210052013397,
|
| 1008 |
+
0.5808194875717163,
|
| 1009 |
+
0.4321470856666565,
|
| 1010 |
+
0.70904141664505,
|
| 1011 |
+
0.6249685883522034,
|
| 1012 |
+
1.1504570245742798,
|
| 1013 |
+
1.307902216911316,
|
| 1014 |
+
0.42155691981315613,
|
| 1015 |
+
0.4363322854042053,
|
| 1016 |
+
1.15058171749115,
|
| 1017 |
+
1.3521455526351929,
|
| 1018 |
+
0.30856841802597046,
|
| 1019 |
+
1.715354084968567,
|
| 1020 |
+
2.028069257736206,
|
| 1021 |
+
1.5654302835464478,
|
| 1022 |
+
0.4363322854042053,
|
| 1023 |
+
1.0768370628356934,
|
| 1024 |
+
0.7877500057220459,
|
| 1025 |
+
0.9628902673721313,
|
| 1026 |
+
0.7311898469924927,
|
| 1027 |
+
0.8207998871803284,
|
| 1028 |
+
0.24490413069725037,
|
| 1029 |
+
0.8429157733917236,
|
| 1030 |
+
1.8877547979354858,
|
| 1031 |
+
0.1810334026813507,
|
| 1032 |
+
0.13143807649612427,
|
| 1033 |
+
0.949565589427948,
|
| 1034 |
+
0.0950046256184578,
|
| 1035 |
+
0.0,
|
| 1036 |
+
1.1989308595657349,
|
| 1037 |
+
1.1410846710205078,
|
| 1038 |
+
0.24130959808826447,
|
| 1039 |
+
0.9818798303604126,
|
| 1040 |
+
0.4285295009613037,
|
| 1041 |
+
0.253095805644989,
|
| 1042 |
+
0.0660354495048523,
|
| 1043 |
+
0.721745491027832,
|
| 1044 |
+
0.06885168701410294,
|
| 1045 |
+
0.0,
|
| 1046 |
+
0.21433521807193756,
|
| 1047 |
+
0.4040643274784088,
|
| 1048 |
+
0.8928331732749939,
|
| 1049 |
+
0.7036266922950745,
|
| 1050 |
+
0.241799995303154,
|
| 1051 |
+
0.6738444566726685,
|
| 1052 |
+
1.016309142112732,
|
| 1053 |
+
0.19733072817325592,
|
| 1054 |
+
0.21058975160121918,
|
| 1055 |
+
0.9845873713493347,
|
| 1056 |
+
0.32909998297691345,
|
| 1057 |
+
0.0,
|
| 1058 |
+
1.0911272764205933,
|
| 1059 |
+
1.1062407493591309,
|
| 1060 |
+
0.32910001277923584,
|
| 1061 |
+
1.0623090267181396,
|
| 1062 |
+
1.2097219228744507,
|
| 1063 |
+
1.3762999773025513,
|
| 1064 |
+
1.1076380014419556,
|
| 1065 |
+
1.3830384016036987,
|
| 1066 |
+
1.0229496955871582,
|
| 1067 |
+
0.01119999960064888,
|
| 1068 |
+
1.3762999773025513,
|
| 1069 |
+
1.7253000736236572,
|
| 1070 |
+
1.0,
|
| 1071 |
+
1.0,
|
| 1072 |
+
1.0,
|
| 1073 |
+
0.15072773396968842,
|
| 1074 |
+
1.0,
|
| 1075 |
+
0.7429686188697815,
|
| 1076 |
+
0.3499999940395355
|
| 1077 |
+
],
|
| 1078 |
+
"mean": [
|
| 1079 |
+
-0.06475033181494105,
|
| 1080 |
+
0.057098523654697086,
|
| 1081 |
+
-0.011897097654485512,
|
| 1082 |
+
0.26709887640232505,
|
| 1083 |
+
0.08334925420830354,
|
| 1084 |
+
0.3441942493191052,
|
| 1085 |
+
0.00022484767466191571,
|
| 1086 |
+
-0.05761208540152456,
|
| 1087 |
+
-0.13382655273049338,
|
| 1088 |
+
0.2940769343015475,
|
| 1089 |
+
-0.07924473004143602,
|
| 1090 |
+
0.47326422706085425,
|
| 1091 |
+
0.026379878074644265,
|
| 1092 |
+
0.015423733482000535,
|
| 1093 |
+
-0.029737654123680377,
|
| 1094 |
+
-0.045331197877702796,
|
| 1095 |
+
0.022916300809103635,
|
| 1096 |
+
0.12698250570266484,
|
| 1097 |
+
0.44820202331367504,
|
| 1098 |
+
-0.6203850728919436,
|
| 1099 |
+
0.03258036172109032,
|
| 1100 |
+
0.11713916782140955,
|
| 1101 |
+
-0.08944663278508772,
|
| 1102 |
+
-0.32730600602243914,
|
| 1103 |
+
0.2439717044262358,
|
| 1104 |
+
0.6454226549211671,
|
| 1105 |
+
0.1688186186825434,
|
| 1106 |
+
-0.012940168459154015,
|
| 1107 |
+
-0.18806532661433703,
|
| 1108 |
+
0.1552108349230285,
|
| 1109 |
+
0.1941116264311829,
|
| 1110 |
+
0.3703516764050984,
|
| 1111 |
+
0.4348416713548777,
|
| 1112 |
+
0.13712443229101076,
|
| 1113 |
+
0.4530558258072317,
|
| 1114 |
+
1.052864947221958,
|
| 1115 |
+
0.09152727345688906,
|
| 1116 |
+
0.06929763021111131,
|
| 1117 |
+
0.516969605567637,
|
| 1118 |
+
0.05006417420824518,
|
| 1119 |
+
-0.20256388216961452,
|
| 1120 |
+
0.6048757575462954,
|
| 1121 |
+
0.6039766779227725,
|
| 1122 |
+
0.12990992738424917,
|
| 1123 |
+
0.528017147240361,
|
| 1124 |
+
0.23902824541865336,
|
| 1125 |
+
0.12925798096528965,
|
| 1126 |
+
0.03726171680773098,
|
| 1127 |
+
0.39450235426603764,
|
| 1128 |
+
0.03995285984414666,
|
| 1129 |
+
-0.211132644209769,
|
| 1130 |
+
0.12068700089978039,
|
| 1131 |
+
0.15298149242168596,
|
| 1132 |
+
0.13532221547416018,
|
| 1133 |
+
0.1007779384898405,
|
| 1134 |
+
0.022262425205976814,
|
| 1135 |
+
0.09442487687902751,
|
| 1136 |
+
0.16106009065290683,
|
| 1137 |
+
-0.02989958354912994,
|
| 1138 |
+
-0.007258400778410945,
|
| 1139 |
+
0.1338247885385292,
|
| 1140 |
+
0.02222226833026917,
|
| 1141 |
+
-0.0646398912028541,
|
| 1142 |
+
0.14768169410577703,
|
| 1143 |
+
0.19862071279153948,
|
| 1144 |
+
0.031888974658866844,
|
| 1145 |
+
0.20788605915394576,
|
| 1146 |
+
0.16909933215190284,
|
| 1147 |
+
0.2794656809399319,
|
| 1148 |
+
0.1727583130855751,
|
| 1149 |
+
0.23477505442550256,
|
| 1150 |
+
0.1952566909685906,
|
| 1151 |
+
-0.05095913558457547,
|
| 1152 |
+
0.2667726989056253,
|
| 1153 |
+
0.3428719602325227,
|
| 1154 |
+
0.34192869072688986,
|
| 1155 |
+
0.22631617166509332,
|
| 1156 |
+
0.9942305799043616,
|
| 1157 |
+
-0.023260789044357667,
|
| 1158 |
+
0.9937866740025567,
|
| 1159 |
+
0.01806171111039402,
|
| 1160 |
+
0.051295509143649914
|
| 1161 |
+
],
|
| 1162 |
+
"std": [
|
| 1163 |
+
0.10601496835973818,
|
| 1164 |
+
0.1049391488942719,
|
| 1165 |
+
0.10081519572143459,
|
| 1166 |
+
0.14161768672682754,
|
| 1167 |
+
0.056354305535126395,
|
| 1168 |
+
0.4024592893596274,
|
| 1169 |
+
0.10873594599432013,
|
| 1170 |
+
0.11364977012703296,
|
| 1171 |
+
0.15185683032532543,
|
| 1172 |
+
0.1245343681291473,
|
| 1173 |
+
0.05677328226190262,
|
| 1174 |
+
0.39924416575382393,
|
| 1175 |
+
0.052282569525360874,
|
| 1176 |
+
0.051468401650661424,
|
| 1177 |
+
0.058230137429165496,
|
| 1178 |
+
0.2069545825248416,
|
| 1179 |
+
0.17322419859463334,
|
| 1180 |
+
0.366802593852756,
|
| 1181 |
+
0.5940533739560672,
|
| 1182 |
+
0.6443454250765919,
|
| 1183 |
+
0.1734223791087576,
|
| 1184 |
+
0.16888119462663687,
|
| 1185 |
+
0.3671665607887838,
|
| 1186 |
+
0.2751992758801098,
|
| 1187 |
+
0.405540019630498,
|
| 1188 |
+
0.7185836667674267,
|
| 1189 |
+
0.5039143680210233,
|
| 1190 |
+
0.15966667828033917,
|
| 1191 |
+
0.2412185844805415,
|
| 1192 |
+
0.17605137337813084,
|
| 1193 |
+
0.2845089572506917,
|
| 1194 |
+
0.16354540502900222,
|
| 1195 |
+
0.18577569931196025,
|
| 1196 |
+
0.05292913979149048,
|
| 1197 |
+
0.18864274559873315,
|
| 1198 |
+
0.41454682607544957,
|
| 1199 |
+
0.04051337367126658,
|
| 1200 |
+
0.02961768788045756,
|
| 1201 |
+
0.20687988107147182,
|
| 1202 |
+
0.021137807585534636,
|
| 1203 |
+
0.06479280720387291,
|
| 1204 |
+
0.26818153606796147,
|
| 1205 |
+
0.25854008506506326,
|
| 1206 |
+
0.053212501070202485,
|
| 1207 |
+
0.22007942709056064,
|
| 1208 |
+
0.09244141821442559,
|
| 1209 |
+
0.05559171029930177,
|
| 1210 |
+
0.014022128182033364,
|
| 1211 |
+
0.15716039583217292,
|
| 1212 |
+
0.014568453815537804,
|
| 1213 |
+
0.08279270885825891,
|
| 1214 |
+
0.04623399742196189,
|
| 1215 |
+
0.06160887641559919,
|
| 1216 |
+
0.25709236177303474,
|
| 1217 |
+
0.19922118137687497,
|
| 1218 |
+
0.05583577379534619,
|
| 1219 |
+
0.19109606735738474,
|
| 1220 |
+
0.2913043262208796,
|
| 1221 |
+
0.08716047543935389,
|
| 1222 |
+
0.07914626450616227,
|
| 1223 |
+
0.25954685863455973,
|
| 1224 |
+
0.09143098715661067,
|
| 1225 |
+
0.11577892741045676,
|
| 1226 |
+
0.28742072274311453,
|
| 1227 |
+
0.35027499820752994,
|
| 1228 |
+
0.08917935994249707,
|
| 1229 |
+
0.36328829952485225,
|
| 1230 |
+
0.32857422048657126,
|
| 1231 |
+
0.48917699851792584,
|
| 1232 |
+
0.30685368847387606,
|
| 1233 |
+
0.41365492944672166,
|
| 1234 |
+
0.3409320309908255,
|
| 1235 |
+
0.10251862040048038,
|
| 1236 |
+
0.4630078218277482,
|
| 1237 |
+
0.5983390036715445,
|
| 1238 |
+
0.47435583814690885,
|
| 1239 |
+
0.418446128083677,
|
| 1240 |
+
0.046325223769759755,
|
| 1241 |
+
0.09390667342750342,
|
| 1242 |
+
0.029742035770768855,
|
| 1243 |
+
0.10572243150603897,
|
| 1244 |
+
0.09798885817386722
|
| 1245 |
+
],
|
| 1246 |
+
"q01": [
|
| 1247 |
+
-0.4258699229359627,
|
| 1248 |
+
-0.18598210588097572,
|
| 1249 |
+
-0.36574397563934324,
|
| 1250 |
+
0.0,
|
| 1251 |
+
-0.07019107498228551,
|
| 1252 |
+
-0.8533171826601028,
|
| 1253 |
+
-0.43710422605276106,
|
| 1254 |
+
-0.4027377113699913,
|
| 1255 |
+
-0.5514881306886673,
|
| 1256 |
+
0.0,
|
| 1257 |
+
-0.27648733973503115,
|
| 1258 |
+
-0.9047904813289642,
|
| 1259 |
+
-0.08013366580009461,
|
| 1260 |
+
-0.12434550277888774,
|
| 1261 |
+
-0.12913744673132896,
|
| 1262 |
+
-0.5261300760507583,
|
| 1263 |
+
-0.38215399146080015,
|
| 1264 |
+
-0.46942271053791046,
|
| 1265 |
+
-0.6404401659965515,
|
| 1266 |
+
-1.6307774567604065,
|
| 1267 |
+
-0.32465869188308716,
|
| 1268 |
+
-0.19981325939297676,
|
| 1269 |
+
-0.916218211054802,
|
| 1270 |
+
-1.1678598415851593,
|
| 1271 |
+
-0.6304313951730729,
|
| 1272 |
+
-0.9706285959482193,
|
| 1273 |
+
-0.39441610157489776,
|
| 1274 |
+
-0.4363322854042053,
|
| 1275 |
+
-0.9648382467031479,
|
| 1276 |
+
-0.2574568685889244,
|
| 1277 |
+
-0.3668474659323692,
|
| 1278 |
+
0.0,
|
| 1279 |
+
0.0,
|
| 1280 |
+
0.0,
|
| 1281 |
+
0.0,
|
| 1282 |
+
0.0,
|
| 1283 |
+
0.0,
|
| 1284 |
+
0.0,
|
| 1285 |
+
0.0,
|
| 1286 |
+
0.0,
|
| 1287 |
+
-0.3072769761085511,
|
| 1288 |
+
0.0,
|
| 1289 |
+
0.0,
|
| 1290 |
+
0.0,
|
| 1291 |
+
0.0,
|
| 1292 |
+
0.0,
|
| 1293 |
+
0.0,
|
| 1294 |
+
0.0,
|
| 1295 |
+
0.0,
|
| 1296 |
+
0.0,
|
| 1297 |
+
-0.3490999937057495,
|
| 1298 |
+
0.0,
|
| 1299 |
+
0.0,
|
| 1300 |
+
-0.01080000028014183,
|
| 1301 |
+
-0.09929999709129333,
|
| 1302 |
+
0.0,
|
| 1303 |
+
-0.1306000053882599,
|
| 1304 |
+
0.0,
|
| 1305 |
+
-0.32910001277923584,
|
| 1306 |
+
-0.32909998297691345,
|
| 1307 |
+
0.0,
|
| 1308 |
+
-0.2134627103805542,
|
| 1309 |
+
-0.32910001277923584,
|
| 1310 |
+
0.0,
|
| 1311 |
+
0.0,
|
| 1312 |
+
-0.12449724726378918,
|
| 1313 |
+
0.0,
|
| 1314 |
+
0.0,
|
| 1315 |
+
0.0,
|
| 1316 |
+
0.0,
|
| 1317 |
+
0.0,
|
| 1318 |
+
0.0,
|
| 1319 |
+
-0.32909998297691345,
|
| 1320 |
+
0.0,
|
| 1321 |
+
0.0,
|
| 1322 |
+
0.0,
|
| 1323 |
+
0.0,
|
| 1324 |
+
0.8438887041807175,
|
| 1325 |
+
-0.5365182769298553,
|
| 1326 |
+
0.8033852863311768,
|
| 1327 |
+
-0.15454178646206856,
|
| 1328 |
+
0.0
|
| 1329 |
+
],
|
| 1330 |
+
"q99": [
|
| 1331 |
+
0.17407412901520733,
|
| 1332 |
+
0.3581392875313762,
|
| 1333 |
+
0.2051144488155843,
|
| 1334 |
+
0.9399846023321156,
|
| 1335 |
+
0.25436547726392755,
|
| 1336 |
+
1.4867067122459414,
|
| 1337 |
+
0.23126163080334675,
|
| 1338 |
+
0.1794275939464569,
|
| 1339 |
+
0.14257357940077803,
|
| 1340 |
+
0.8810967963933947,
|
| 1341 |
+
0.061885762959718704,
|
| 1342 |
+
1.4374998974800115,
|
| 1343 |
+
0.12415816456079484,
|
| 1344 |
+
0.12301700718700886,
|
| 1345 |
+
0.12952485173940662,
|
| 1346 |
+
0.335256299972535,
|
| 1347 |
+
0.4064765360951426,
|
| 1348 |
+
0.9603097575902939,
|
| 1349 |
+
1.181640487909317,
|
| 1350 |
+
0.2883212441205979,
|
| 1351 |
+
0.41062605202198116,
|
| 1352 |
+
0.7542869210243239,
|
| 1353 |
+
0.7519184774160386,
|
| 1354 |
+
0.0,
|
| 1355 |
+
1.0248987221717836,
|
| 1356 |
+
1.3203257322311401,
|
| 1357 |
+
1.2515139865875247,
|
| 1358 |
+
0.4363322854042053,
|
| 1359 |
+
0.5650087982416158,
|
| 1360 |
+
0.5026526004076005,
|
| 1361 |
+
0.7366500645875932,
|
| 1362 |
+
0.6764839887619019,
|
| 1363 |
+
0.7699487209320068,
|
| 1364 |
+
0.22658228874206543,
|
| 1365 |
+
0.7833619117736816,
|
| 1366 |
+
1.73383629322052,
|
| 1367 |
+
0.16742023825645447,
|
| 1368 |
+
0.12320533394813538,
|
| 1369 |
+
0.8694227933883667,
|
| 1370 |
+
0.08777034282684326,
|
| 1371 |
+
0.0,
|
| 1372 |
+
1.1075090169906616,
|
| 1373 |
+
1.0696032047271729,
|
| 1374 |
+
0.22256676852703094,
|
| 1375 |
+
0.9131167531013489,
|
| 1376 |
+
0.3921714723110199,
|
| 1377 |
+
0.23349951207637787,
|
| 1378 |
+
0.06148195266723633,
|
| 1379 |
+
0.6624036431312561,
|
| 1380 |
+
0.06512759625911713,
|
| 1381 |
+
0.0,
|
| 1382 |
+
0.1980258673429489,
|
| 1383 |
+
0.25957074761390686,
|
| 1384 |
+
0.7472417849302292,
|
| 1385 |
+
0.5747254490852356,
|
| 1386 |
+
0.22700965404510498,
|
| 1387 |
+
0.5636868023872376,
|
| 1388 |
+
0.8398461937904358,
|
| 1389 |
+
0.1201881617307663,
|
| 1390 |
+
0.1609884649515152,
|
| 1391 |
+
0.8204325437545776,
|
| 1392 |
+
0.3019275367259979,
|
| 1393 |
+
0.0,
|
| 1394 |
+
1.0910999774932861,
|
| 1395 |
+
1.0164999961853027,
|
| 1396 |
+
0.32910001277923584,
|
| 1397 |
+
1.0622999668121338,
|
| 1398 |
+
1.1383999586105347,
|
| 1399 |
+
1.3762999773025513,
|
| 1400 |
+
0.9796000123023987,
|
| 1401 |
+
1.3830000162124634,
|
| 1402 |
+
1.0228999853134155,
|
| 1403 |
+
0.01119999960064888,
|
| 1404 |
+
1.3762999773025513,
|
| 1405 |
+
1.7253000736236572,
|
| 1406 |
+
1.0,
|
| 1407 |
+
1.0,
|
| 1408 |
+
1.0,
|
| 1409 |
+
0.05139056675136114,
|
| 1410 |
+
1.0,
|
| 1411 |
+
0.5954595875740052,
|
| 1412 |
+
0.346557080745697
|
| 1413 |
+
],
|
| 1414 |
+
"unit_dims": []
|
| 1415 |
+
}
|
| 1416 |
+
},
|
| 1417 |
+
"code_commit": "d20968588471ede76533662de44fd0df9e124b49",
|
| 1418 |
+
"task": "a14cr5",
|
| 1419 |
+
"dataset_id": "a14-screw-bulb-cropped-v5@33beae7 (inferred from the directory name)",
|
| 1420 |
+
"step": 5000,
|
| 1421 |
+
"weights": "ema",
|
| 1422 |
+
"offline_eval": {
|
| 1423 |
+
"mse": 0.011625926941633224,
|
| 1424 |
+
"mse_row0": 0.012754611670970917,
|
| 1425 |
+
"mse_body_target": 0.009895454160869122,
|
| 1426 |
+
"mse_hands": 0.0073944502510130405,
|
| 1427 |
+
"mse_planner": 0.045887283980846405,
|
| 1428 |
+
"samples": 256,
|
| 1429 |
+
"frames": "train"
|
| 1430 |
+
},
|
| 1431 |
+
"format": "hb_baselines/1"
|
| 1432 |
+
}
|
a14-unscrew-bulb/b512-trim3f/step-005000/model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b20163261126c0998f83d9ede659baa3ad47f7bc1acd278b52a055f98ec1a4b
|
| 3 |
+
size 107219949
|
a14-unscrew-bulb/b512-trim3f/step-005000/protocol.json
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format": "hb_baselines/1",
|
| 3 |
+
"step": 5000,
|
| 4 |
+
"policy": "ode_mlp",
|
| 5 |
+
"task": "a14cr5",
|
| 6 |
+
"dataset_id": "a14-screw-bulb-cropped-v5@33beae7 (inferred from the directory name)",
|
| 7 |
+
"episodes": 100,
|
| 8 |
+
"frames": 137710,
|
| 9 |
+
"fps": 30.0,
|
| 10 |
+
"steps": 5000,
|
| 11 |
+
"total_steps": 5000,
|
| 12 |
+
"save_steps": [
|
| 13 |
+
750,
|
| 14 |
+
1750,
|
| 15 |
+
2500,
|
| 16 |
+
3250,
|
| 17 |
+
4250,
|
| 18 |
+
5000
|
| 19 |
+
],
|
| 20 |
+
"global_batch": 512,
|
| 21 |
+
"per_gpu_batch": 512,
|
| 22 |
+
"num_gpus": 1,
|
| 23 |
+
"gradient_accumulation_steps": 1,
|
| 24 |
+
"lr": 0.0001,
|
| 25 |
+
"warmup": 500,
|
| 26 |
+
"schedule": "diffusers_cosine",
|
| 27 |
+
"seed": 42,
|
| 28 |
+
"aug_seed": 42,
|
| 29 |
+
"code_commit": "d20968588471ede76533662de44fd0df9e124b49",
|
| 30 |
+
"code_dirty": null,
|
| 31 |
+
"environment": {
|
| 32 |
+
"python": "3.12.12",
|
| 33 |
+
"torch": "2.9.0+cu128",
|
| 34 |
+
"numpy": "2.2.6",
|
| 35 |
+
"cuda": "12.8",
|
| 36 |
+
"cudnn": 91002,
|
| 37 |
+
"torchvision": "0.24.0+cu128",
|
| 38 |
+
"pillow": "13.0.0",
|
| 39 |
+
"gpu": "NVIDIA A800-SXM4-80GB",
|
| 40 |
+
"driver": "570.133.20"
|
| 41 |
+
},
|
| 42 |
+
"continuation": null,
|
| 43 |
+
"protocol_deviations": [],
|
| 44 |
+
"protocol_exceptions": [],
|
| 45 |
+
"files": {
|
| 46 |
+
"config.json": {
|
| 47 |
+
"bytes": 29823,
|
| 48 |
+
"sha256": "8bbee489176bcb685f8a38781e10ead01c15818b6a847ec51b7d86f3f3ad175f"
|
| 49 |
+
},
|
| 50 |
+
"model.pt": {
|
| 51 |
+
"bytes": 107219949,
|
| 52 |
+
"sha256": "8b20163261126c0998f83d9ede659baa3ad47f7bc1acd278b52a055f98ec1a4b"
|
| 53 |
+
},
|
| 54 |
+
"training_records/code_commit.txt": {
|
| 55 |
+
"bytes": 312,
|
| 56 |
+
"sha256": "2bd274128b9cc8d9a4b574220e19f456b6c33858b7a180583691ca8458a626f8"
|
| 57 |
+
},
|
| 58 |
+
"training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py": {
|
| 59 |
+
"bytes": 7475,
|
| 60 |
+
"sha256": "9f7713cea4f846efcfc924234267ced48210357f419d67915c10b504316bedde"
|
| 61 |
+
},
|
| 62 |
+
"training_records/code_d2096858/evaluation/baselines/__init__.py": {
|
| 63 |
+
"bytes": 1060,
|
| 64 |
+
"sha256": "bfbb52f85ac5d91e37f3cfc24bb8671de447b5b566760bfe091204ae69e1f7f6"
|
| 65 |
+
},
|
| 66 |
+
"training_records/code_d2096858/evaluation/baselines/act_nets.py": {
|
| 67 |
+
"bytes": 22435,
|
| 68 |
+
"sha256": "3db95cd8e4e436875e11f1054a99d250ca7d94e0127909090b58730402340f19"
|
| 69 |
+
},
|
| 70 |
+
"training_records/code_d2096858/evaluation/baselines/adapters.py": {
|
| 71 |
+
"bytes": 3479,
|
| 72 |
+
"sha256": "87e47332381fcb34e75d08cb258475c200519cb5cf17fd0e218bf2a1b21fa890"
|
| 73 |
+
},
|
| 74 |
+
"training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py": {
|
| 75 |
+
"bytes": 6003,
|
| 76 |
+
"sha256": "aa7fc175f50de83b130427cc30533a45220e70d0ed8c807f33ca44d39cb9fb81"
|
| 77 |
+
},
|
| 78 |
+
"training_records/code_d2096858/evaluation/baselines/check_flash_parity.py": {
|
| 79 |
+
"bytes": 7900,
|
| 80 |
+
"sha256": "91f714aa3b7ec6b5c28764496163671cadabe4a833c0b06b6bc4c155cec7f66f"
|
| 81 |
+
},
|
| 82 |
+
"training_records/code_d2096858/evaluation/baselines/data.py": {
|
| 83 |
+
"bytes": 21493,
|
| 84 |
+
"sha256": "c8b0817f7fe3bdec71b13e94a2e2fea231e0c6c05bd16614b564419ff024e8e2"
|
| 85 |
+
},
|
| 86 |
+
"training_records/code_d2096858/evaluation/baselines/flash.py": {
|
| 87 |
+
"bytes": 24032,
|
| 88 |
+
"sha256": "35c01a4e2edd80f85878b37928069c09ed3238127bbb51a5443e7f1c92703e53"
|
| 89 |
+
},
|
| 90 |
+
"training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py": {
|
| 91 |
+
"bytes": 6013,
|
| 92 |
+
"sha256": "c987d9e641f5e5266703a8154b708d9ccab203b06d5ab82774d39a1cba602d62"
|
| 93 |
+
},
|
| 94 |
+
"training_records/code_d2096858/evaluation/baselines/inloop.py": {
|
| 95 |
+
"bytes": 6993,
|
| 96 |
+
"sha256": "0e6343d7d28893c4107864b943193eb4a402cf97b1625e94eb2acb1d163ca85c"
|
| 97 |
+
},
|
| 98 |
+
"training_records/code_d2096858/evaluation/baselines/nets.py": {
|
| 99 |
+
"bytes": 10478,
|
| 100 |
+
"sha256": "2d72e3c455d5e376a6f5954886fd4c7a6478eb516380c6a05515fa043c62fbce"
|
| 101 |
+
},
|
| 102 |
+
"training_records/code_d2096858/evaluation/baselines/ode_nets.py": {
|
| 103 |
+
"bytes": 9148,
|
| 104 |
+
"sha256": "38f2ea6050fa45e6c0d5e3f19caf21f1a72a50f80e356044dddcf76da22b144a"
|
| 105 |
+
},
|
| 106 |
+
"training_records/code_d2096858/evaluation/baselines/policies.py": {
|
| 107 |
+
"bytes": 25760,
|
| 108 |
+
"sha256": "74ca169fe453f64bf6ffc3f3a85a4208aed2961d0abd9eb3e92b96457f86daf1"
|
| 109 |
+
},
|
| 110 |
+
"training_records/code_d2096858/evaluation/baselines/requirements.lock.txt": {
|
| 111 |
+
"bytes": 1481,
|
| 112 |
+
"sha256": "4b79b9dcc98f05bfe7bc9e64e3492f4565728f6d1f75cbdecc1c817d03ff32a5"
|
| 113 |
+
},
|
| 114 |
+
"training_records/code_d2096858/evaluation/baselines/requirements.txt": {
|
| 115 |
+
"bytes": 850,
|
| 116 |
+
"sha256": "56a8db94a98c5256028b475d9a0293cdee4cf475e415df763b3a0232433663ba"
|
| 117 |
+
},
|
| 118 |
+
"training_records/code_d2096858/evaluation/baselines/runtime.py": {
|
| 119 |
+
"bytes": 11034,
|
| 120 |
+
"sha256": "8cd8963bb87cdc453293a369658c97a97aadbef77281538d8a4c484925af00c5"
|
| 121 |
+
},
|
| 122 |
+
"training_records/code_d2096858/evaluation/baselines/train.py": {
|
| 123 |
+
"bytes": 60225,
|
| 124 |
+
"sha256": "cd74f1af7a382eea1903cc20142a19e82b06fe99dd03d5e75a9a42f0ae8ecf04"
|
| 125 |
+
},
|
| 126 |
+
"training_records/code_d2096858/evaluation/policy/ODEMLP/deploy.yml": {
|
| 127 |
+
"bytes": 3320,
|
| 128 |
+
"sha256": "2c58049b2fca0406dce9adb4716412371ebe9fead24e4dbd751e10a5d78fcf7d"
|
| 129 |
+
},
|
| 130 |
+
"training_records/code_d2096858/evaluation/policy/ODEMLP/model.py": {
|
| 131 |
+
"bytes": 607,
|
| 132 |
+
"sha256": "71f82a6b7c4802c87489a37c80c47b39492e2c4a35fe58fd544eee341e339d0e"
|
| 133 |
+
},
|
| 134 |
+
"training_records/inloop-mse.jsonl": {
|
| 135 |
+
"bytes": 34563,
|
| 136 |
+
"sha256": "fb06bed959e9fa965dfd76f82c48cfee0af18b650ba70d0074e7b08ef9a74339"
|
| 137 |
+
},
|
| 138 |
+
"training_records/launch.sh": {
|
| 139 |
+
"bytes": 1562,
|
| 140 |
+
"sha256": "7333ac66d63dfdf95987bbc6277a406706599fed092a923e67089d8974d4f342"
|
| 141 |
+
},
|
| 142 |
+
"training_records/pip_freeze_hb-baselines.txt": {
|
| 143 |
+
"bytes": 1185,
|
| 144 |
+
"sha256": "72942d6f1c95ab99ba51fcf641bfd0e4cb34943c5b19a2a39d8da72ef5daa6b2"
|
| 145 |
+
},
|
| 146 |
+
"training_records/run.json": {
|
| 147 |
+
"bytes": 30465,
|
| 148 |
+
"sha256": "7d8e0ee33a9c85bf602299b0e259035793ab088d659f535254e38f18f7f01796"
|
| 149 |
+
},
|
| 150 |
+
"training_records/train.log": {
|
| 151 |
+
"bytes": 30833,
|
| 152 |
+
"sha256": "9cc2f806dd9a0b63f52be45758800be6870b6d11689c1240b6e5304a9f0f745c"
|
| 153 |
+
},
|
| 154 |
+
"training_records/train_log.jsonl": {
|
| 155 |
+
"bytes": 26437,
|
| 156 |
+
"sha256": "6c464b1a9788a614f4236886d1f25a3e26eff004ddc4bccd461002c767bcdd51"
|
| 157 |
+
}
|
| 158 |
+
},
|
| 159 |
+
"task_dir": "a14-unscrew-bulb",
|
| 160 |
+
"training_data": "humanoid-benchmark/a14-screw-bulb @33beae7c (H2, cropped v5, pause-trimmed with the A29 stationary-frame trim (debug/newton/a29_trim_stationary.py)), all 100 episodes (137,710 frames)",
|
| 161 |
+
"lr_schedule": "diffusers_cosine after a 500-step linear warm-up",
|
| 162 |
+
"ema": 0.9999,
|
| 163 |
+
"augmentation": "Humanoid Benchmark online augmentation spec v2 (hb-aug-v2-20261109): 15 visual effects, one per sample at 1.5x; proprio per-joint bias U(+-2 deg) + N(0, 0.25 deg); no delay, no history drop; model-native image augmentation off",
|
| 164 |
+
"state_dim": 78,
|
| 165 |
+
"action_dim": 82,
|
| 166 |
+
"cameras": [
|
| 167 |
+
"head",
|
| 168 |
+
"chest"
|
| 169 |
+
],
|
| 170 |
+
"contract": "h2_sharpa_planner",
|
| 171 |
+
"image_hw": [
|
| 172 |
+
168,
|
| 173 |
+
224
|
| 174 |
+
],
|
| 175 |
+
"task_text": "Walk to the table's short edge, pick up the bulb with the left hand, walk along the table to the socket, insert the bulb with the left hand, turn to face the table and screw it in with the right hand's fingers until it lights up.",
|
| 176 |
+
"inloop_mse": {
|
| 177 |
+
"task": "a14cr5",
|
| 178 |
+
"split": "train10",
|
| 179 |
+
"every": 250,
|
| 180 |
+
"seed": 1234,
|
| 181 |
+
"weights": "ema",
|
| 182 |
+
"nmse_at_this_step": 0.0433,
|
| 183 |
+
"curve": {
|
| 184 |
+
"250": 0.394,
|
| 185 |
+
"500": 0.1772,
|
| 186 |
+
"750": 0.1207,
|
| 187 |
+
"1000": 0.0979,
|
| 188 |
+
"1250": 0.0839,
|
| 189 |
+
"1500": 0.0731,
|
| 190 |
+
"1750": 0.0657,
|
| 191 |
+
"2000": 0.0606,
|
| 192 |
+
"2250": 0.0571,
|
| 193 |
+
"2500": 0.0545,
|
| 194 |
+
"2750": 0.0523,
|
| 195 |
+
"3000": 0.0503,
|
| 196 |
+
"3250": 0.0487,
|
| 197 |
+
"3500": 0.0474,
|
| 198 |
+
"3750": 0.0462,
|
| 199 |
+
"4000": 0.0453,
|
| 200 |
+
"4250": 0.0445,
|
| 201 |
+
"4500": 0.044,
|
| 202 |
+
"4750": 0.0436,
|
| 203 |
+
"5000": 0.0433
|
| 204 |
+
}
|
| 205 |
+
},
|
| 206 |
+
"reproducibility": {
|
| 207 |
+
"protocol": "https://github.com/zuo-kuangji/HumanWAM/blob/bai/hb_training/REPRODUCIBILITY.md",
|
| 208 |
+
"protocol_commit": "4ab064d",
|
| 209 |
+
"training_seed": 42,
|
| 210 |
+
"training_seed_source": "config.json training.seed of this folder (hb_baselines code, policy ode_mlp; 42 = upstream NTUMARS/ODE-POLICY default_train.yaml training_params.seed)",
|
| 211 |
+
"training_seed_verified_from_run_files": true,
|
| 212 |
+
"augmentation_random_stream": "seeded: per DataLoader worker numpy default_rng([HB_AUG_SEED=42, torch.initial_seed(), worker id]) (protocol.yaml models.ode_mlp aug_rng)",
|
| 213 |
+
"inloop_mse_seed": 1234,
|
| 214 |
+
"layout": {
|
| 215 |
+
"nodes": 1,
|
| 216 |
+
"gpus_per_node": 1,
|
| 217 |
+
"per_gpu_batch": 512,
|
| 218 |
+
"global_batch": 512,
|
| 219 |
+
"gradient_accumulation": 1,
|
| 220 |
+
"num_workers": 32,
|
| 221 |
+
"prefetch": 2
|
| 222 |
+
},
|
| 223 |
+
"environment": "hb-baselines (Humanoid_benchmark evaluation/baselines/requirements.lock.txt: Python 3.12.12, torch 2.9.0+cu128, pillow 13.0.0); training_records/pip_freeze_hb-baselines.txt",
|
| 224 |
+
"hardware": "Alibaba Cloud PAI DLC A800 cluster (dlc19te5fv9wtn5t), 1 x NVIDIA A800-SXM4-80GB, driver 570.133.20",
|
| 225 |
+
"upstream_code": "github.com/zuo-kuangji/Humanoid_benchmark bai @ d20968588471ede76533662de44fd0df9e124b49 (evaluation/baselines/train.py --policy ode_mlp --contract h2_sharpa_planner); policy from NTUMARS/ODE-POLICY real-g1@fd8bec47 (G1 port, HumanWAM packages/ode_g1) + main@cea26d94 (encoder, ode_dit field, default_train.yaml)",
|
| 226 |
+
"determinism": "statistical reproducibility: same data commit, config, seed and layout give the same curves within run-to-run noise; GPU kernels are not bitwise deterministic",
|
| 227 |
+
"exceptions": "see the exception registry, REPRODUCIBILITY.md section 7; ODE recipe: section 4.7",
|
| 228 |
+
"adapter_code": "config.json in this folder records the model, data contract, dataset episodes, training and augmentation settings",
|
| 229 |
+
"upstream_method": "github.com/NTUMARS/ODE-POLICY @ real-g1 fd8bec47 (G1 port) + main cea26d94 (encoder, ode_dit field, default_train.yaml) (Apache-2.0)"
|
| 230 |
+
},
|
| 231 |
+
"inference": {
|
| 232 |
+
"integration": "Euler, one step per action row (dt = 1 row), 16 rows; start row = the last executed action (episode start: BOS = normalized zero)",
|
| 233 |
+
"deploy": "evaluation/policy/ODEMLP"
|
| 234 |
+
},
|
| 235 |
+
"resume_state_included": false,
|
| 236 |
+
"ema_schedule": "diffusion_policy_emamodel",
|
| 237 |
+
"published_steps": [
|
| 238 |
+
5000
|
| 239 |
+
],
|
| 240 |
+
"evaluated_checkpoint": "step-005000"
|
| 241 |
+
}
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_commit.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
d20968588471ede76533662de44fd0df9e124b49
|
| 2 |
+
train.py of bai d2096858 (code_commit fix, verified by sha256) on top of the 07a80dd9 tree; every other file in evaluation/baselines and evaluation/augmentation verified file by file by sha256 (2026-11-27). Not a git work tree: the cluster cannot fetch the private repo.
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/augmentation/hb_aug_v2.py
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Humanoid Benchmark data augmentation v2 (project CLAUDE.md), model-agnostic torch implementation.
|
| 2 |
+
|
| 3 |
+
augment(x, rng, obs_mask=None) takes x: float [T, V, 3, H, W] in [0, 1] (T frames, V cameras) and returns the
|
| 4 |
+
augmented tensor. Each call is one training sample: one of the 15 effects is chosen uniformly and its magnitude
|
| 5 |
+
is scaled by 1.5 around identity; the rest stay at x1. Colour is shared across cameras and time; geometry, light
|
| 6 |
+
patches and white balance are drawn per camera and fixed over time; sensor/optics effects (noise, gaussian blur,
|
| 7 |
+
JPEG, motion blur, sharpen, defocus) apply only to observation frames (obs_mask True).
|
| 8 |
+
Pixel-size parameters are defined at 224 px and scaled by H / 224.
|
| 9 |
+
perturb_joints(q, rng) applies the proprio spec: per-joint bias +-2 deg plus N(0, 0.25 deg) clipped at 3 sigma.
|
| 10 |
+
"""
|
| 11 |
+
import io
|
| 12 |
+
import math
|
| 13 |
+
|
| 14 |
+
import numpy as np
|
| 15 |
+
import torch
|
| 16 |
+
import torch.nn.functional as F
|
| 17 |
+
from PIL import Image
|
| 18 |
+
from torchvision.transforms import InterpolationMode
|
| 19 |
+
from torchvision.transforms import functional as TF
|
| 20 |
+
|
| 21 |
+
EFFECTS = ("exposure", "contrast", "saturation", "hue", "gamma", "temperature", "rotation_crop", "noise",
|
| 22 |
+
"gaussian_blur", "jpeg", "motion_blur", "sharpen", "defocus", "light_shadow", "wb_channel")
|
| 23 |
+
CENTER = {"exposure": 0.0, "contrast": 1.0, "saturation": 1.0, "hue": 0.0, "gamma": 1.0, "temperature": 0.0}
|
| 24 |
+
RANGE = {"exposure": (-0.22, 0.22), "contrast": (0.88, 1.12), "saturation": (0.76, 1.24), "hue": (-0.015, 0.015),
|
| 25 |
+
"gamma": (0.89, 1.11), "temperature": (-0.066, 0.066)}
|
| 26 |
+
VERSION = "hb-aug-v2-20261109"
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def sample(rng, views, height):
|
| 30 |
+
boost = EFFECTS[int(rng.integers(len(EFFECTS)))]
|
| 31 |
+
|
| 32 |
+
def k(name):
|
| 33 |
+
return 1.5 if boost == name else 1.0
|
| 34 |
+
|
| 35 |
+
px = height / 224.0
|
| 36 |
+
p = {"boost": boost}
|
| 37 |
+
for name, (a, b) in RANGE.items():
|
| 38 |
+
c = CENTER[name]
|
| 39 |
+
p[name] = float(rng.uniform(c + k(name) * (a - c), c + k(name) * (b - c)))
|
| 40 |
+
p["geometry"] = []
|
| 41 |
+
for _ in range(views):
|
| 42 |
+
angle = float(rng.uniform(-1.5 * k("rotation_crop"), 1.5 * k("rotation_crop")))
|
| 43 |
+
p["geometry"].append((angle, 1.0 + abs(angle) * 0.015 + float(rng.uniform(0, 0.02 * k("rotation_crop")))))
|
| 44 |
+
p["noise"] = 4.0 / 255.0 * k("noise") if rng.random() < 0.5 else 0.0
|
| 45 |
+
p["gaussian_blur"] = float(rng.uniform(0.25, 0.65)) * k("gaussian_blur") if rng.random() < 0.15 else 0.0
|
| 46 |
+
if rng.random() < 0.35:
|
| 47 |
+
lo = int(round(100 - k("jpeg") * 30))
|
| 48 |
+
hi = int(round(100 - k("jpeg") * 5))
|
| 49 |
+
p["jpeg"] = int(rng.integers(lo, hi + 1))
|
| 50 |
+
else:
|
| 51 |
+
p["jpeg"] = None
|
| 52 |
+
p["motion_blur"] = ((float(rng.uniform(3, 7)) * k("motion_blur") * px, float(rng.uniform(0, 180)))
|
| 53 |
+
if rng.random() < 0.15 else None)
|
| 54 |
+
p["sharpen"] = float(rng.uniform(0.2, 0.6)) * k("sharpen") if rng.random() < 0.15 else 0.0
|
| 55 |
+
p["defocus"] = float(rng.uniform(1, 2)) * k("defocus") * px if rng.random() < 0.10 else 0.0
|
| 56 |
+
if rng.random() < 0.30:
|
| 57 |
+
g = 0.30 * k("light_shadow")
|
| 58 |
+
p["light_shadow"] = [[(float(rng.uniform(0.1, 0.9)), float(rng.uniform(0.1, 0.9)),
|
| 59 |
+
float(rng.uniform(0.15, 0.35)), float(rng.uniform(1 - g, 1 + g)))
|
| 60 |
+
for _ in range(int(rng.integers(1, 3)))] for _ in range(views)]
|
| 61 |
+
else:
|
| 62 |
+
p["light_shadow"] = None
|
| 63 |
+
if rng.random() < 0.30:
|
| 64 |
+
g = 0.10 * k("wb_channel")
|
| 65 |
+
gains = []
|
| 66 |
+
for _ in range(views):
|
| 67 |
+
row = [1.0, 1.0, 1.0]
|
| 68 |
+
row[int(rng.integers(0, 3))] = float(rng.uniform(1 - g, 1 + g))
|
| 69 |
+
gains.append(row)
|
| 70 |
+
p["wb_channel"] = gains
|
| 71 |
+
else:
|
| 72 |
+
p["wb_channel"] = None
|
| 73 |
+
return p
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def _conv(x, kernel):
|
| 77 |
+
n, c, h, w = x.shape
|
| 78 |
+
k = kernel.to(x)[None, None].repeat(c, 1, 1, 1)
|
| 79 |
+
pad = kernel.shape[-1] // 2
|
| 80 |
+
return F.conv2d(F.pad(x, (pad, pad, pad, pad), mode="reflect"), k, groups=c)
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def motion_kernel(length, angle_deg):
|
| 84 |
+
size = max(3, int(round(length)) | 1)
|
| 85 |
+
k = torch.zeros(size, size)
|
| 86 |
+
c = size // 2
|
| 87 |
+
th = math.radians(angle_deg)
|
| 88 |
+
for s in np.linspace(-(length - 1) / 2, (length - 1) / 2, 8 * size):
|
| 89 |
+
k[int(round(c - s * math.sin(th))), int(round(c + s * math.cos(th)))] = 1.0
|
| 90 |
+
return k / k.sum()
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def disk_kernel(r):
|
| 94 |
+
size = 2 * int(math.ceil(r)) + 1
|
| 95 |
+
c = size // 2
|
| 96 |
+
yy, xx = torch.meshgrid(torch.arange(size), torch.arange(size), indexing="ij")
|
| 97 |
+
k = (((yy - c) ** 2 + (xx - c) ** 2) <= (r + 0.5) ** 2).float()
|
| 98 |
+
return k / k.sum()
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
def apply(x, p, obs_mask=None, noise_seed=0):
|
| 102 |
+
t, v, c, h, w = x.shape
|
| 103 |
+
x = x.clone().clamp(0, 1)
|
| 104 |
+
for vi, (angle, scale) in enumerate(p["geometry"]):
|
| 105 |
+
x[:, vi] = TF.affine(x[:, vi], angle=angle, translate=[0, 0], scale=scale, shear=[0, 0],
|
| 106 |
+
interpolation=InterpolationMode.BILINEAR)
|
| 107 |
+
if p["light_shadow"] is not None:
|
| 108 |
+
yy, xx = torch.meshgrid(torch.linspace(0, 1, h), torch.linspace(0, 1, w), indexing="ij")
|
| 109 |
+
for vi, blobs in enumerate(p["light_shadow"]):
|
| 110 |
+
m = torch.ones(h, w)
|
| 111 |
+
for cx, cy, s, g in blobs:
|
| 112 |
+
m = m + (g - 1.0) * torch.exp(-((xx - cx) ** 2 + (yy - cy) ** 2) / (2 * s * s))
|
| 113 |
+
x[:, vi] = (x[:, vi] * m.clamp(min=0).to(x)).clamp(0, 1)
|
| 114 |
+
if p["wb_channel"] is not None:
|
| 115 |
+
for vi, g in enumerate(p["wb_channel"]):
|
| 116 |
+
x[:, vi] = (x[:, vi] * torch.tensor(g, dtype=x.dtype).view(1, 3, 1, 1)).clamp(0, 1)
|
| 117 |
+
y = x.reshape(t * v, c, h, w)
|
| 118 |
+
y = (y * float(2.0 ** p["exposure"])).clamp(0, 1)
|
| 119 |
+
d = p["temperature"]
|
| 120 |
+
y = (y * y.new_tensor([1.0 + d, 1.0, 1.0 - d]).view(1, 3, 1, 1)).clamp(0, 1)
|
| 121 |
+
y = ((y - 0.5) * p["contrast"] + 0.5).clamp(0, 1)
|
| 122 |
+
y = TF.adjust_saturation(y, p["saturation"])
|
| 123 |
+
y = TF.adjust_hue(y, p["hue"])
|
| 124 |
+
y = y.clamp(0, 1).pow(p["gamma"])
|
| 125 |
+
x = y.reshape(t, v, c, h, w)
|
| 126 |
+
mask = torch.ones(t, dtype=torch.bool) if obs_mask is None else torch.as_tensor(obs_mask, dtype=torch.bool)
|
| 127 |
+
if bool(mask.any()):
|
| 128 |
+
o = x[mask].reshape(-1, c, h, w)
|
| 129 |
+
if p["gaussian_blur"] > 0:
|
| 130 |
+
o = TF.gaussian_blur(o, [3, 3], [p["gaussian_blur"]] * 2)
|
| 131 |
+
if p["motion_blur"] is not None:
|
| 132 |
+
o = _conv(o, motion_kernel(*p["motion_blur"]))
|
| 133 |
+
if p["defocus"] > 0:
|
| 134 |
+
o = _conv(o, disk_kernel(p["defocus"]))
|
| 135 |
+
if p["sharpen"] > 0:
|
| 136 |
+
o = o + p["sharpen"] * (o - TF.gaussian_blur(o, [5, 5], [1.0, 1.0]))
|
| 137 |
+
o = o.clamp(0, 1)
|
| 138 |
+
if p["noise"] > 0:
|
| 139 |
+
gen = torch.Generator().manual_seed(int(noise_seed))
|
| 140 |
+
o = (o + torch.randn(o.shape, generator=gen, dtype=o.dtype) * p["noise"]).clamp(0, 1)
|
| 141 |
+
if p["jpeg"] is not None:
|
| 142 |
+
for i in range(o.shape[0]):
|
| 143 |
+
buf = io.BytesIO()
|
| 144 |
+
TF.to_pil_image(o[i]).save(buf, format="JPEG", quality=int(p["jpeg"]))
|
| 145 |
+
buf.seek(0)
|
| 146 |
+
with Image.open(buf) as im:
|
| 147 |
+
o[i] = TF.pil_to_tensor(im.convert("RGB")).to(o.dtype).div(255.0)
|
| 148 |
+
x[mask] = o.reshape(-1, v, c, h, w)
|
| 149 |
+
return x.clamp(0, 1)
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
def augment(x, rng, obs_mask=None):
|
| 153 |
+
p = sample(rng, x.shape[1], x.shape[-2])
|
| 154 |
+
return apply(x, p, obs_mask, noise_seed=int(rng.integers(0, 2 ** 62))), p
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
def perturb_joints(q, rng):
|
| 158 |
+
q = np.asarray(q, dtype=np.float64)
|
| 159 |
+
d = q.shape[-1]
|
| 160 |
+
bias = rng.uniform(-math.radians(2.0), math.radians(2.0), size=d)
|
| 161 |
+
sigma = math.radians(0.25)
|
| 162 |
+
noise = np.clip(rng.normal(0.0, sigma, size=q.shape), -3 * sigma, 3 * sigma)
|
| 163 |
+
return (q + bias + noise).astype(np.float32)
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/__init__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FM-DiT, DP (Diffusion Policy, DDPM-DiT), ACT, FLASH, ODE-MLP and ODE-DiT visuomotor baselines of the Humanoid
|
| 2 |
+
Benchmark.
|
| 3 |
+
|
| 4 |
+
FM-DiT, DP and ACT are ported from DextraVerse's imitation-learning core (`dextraverse/algorithms/il/models/
|
| 5 |
+
{fm_dit,ddpm_dit,act}.py` and their networks), FLASH and FM-DiT v2 (FLASH-Policy's own FM-DiT; `fm_dit_v2.py`, a separate entry from the
|
| 6 |
+
DextraVerse FM-DiT) from NTUMARS/FLASH-Policy @ f47e490 (`flash.py`), ODE-MLP and
|
| 7 |
+
ODE-DiT after ODE Policy's G1 port (github.com/NTUMARS/ODE-POLICY real-g1; networks in ode_nets.py), each in its
|
| 8 |
+
authors' own configuration; torch only. `train.py` trains one on a task's LeRobot v2.1 expert dataset through a robot
|
| 9 |
+
contract (`data.CONTRACTS`: G1 state44/action76 or H2 state78/action75); `runtime.BaselinePolicy` serves a checkpoint
|
| 10 |
+
to the G1 evaluation adapters (`evaluation/policy/{FMDiT,FMDiT_v2,DP,ACT,FLASH,ODEMLP,ODEDiT}/model.py`, via `adapters.py`) and
|
| 11 |
+
to the H2 adapter
|
| 12 |
+
(`debug/newton/h2_policy_adapters/baseline.py`). Usage and the environment: evaluation/README.md#baselines.
|
| 13 |
+
"""
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/act_nets.py
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""ACT (Zhao et al. 2023, "Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware") network core: the
|
| 2 |
+
ResNet backbone with frozen BatchNorm and sine position embedding, the DETR encoder-decoder transformer and the CVAE
|
| 3 |
+
action-chunk decoder.
|
| 4 |
+
|
| 5 |
+
Ported unchanged from DextraVerse (`dextraverse/algorithms/il/models/nets/act/`), which vendors the ACT repository's
|
| 6 |
+
`detr/models/{backbone,position_encoding,transformer,detr_vae}.py` (Apache-2.0, (c) Facebook, Inc. and its
|
| 7 |
+
affiliates; see THIRD_PARTY_NOTICES.md) with the NestedTensor/argparse plumbing removed, explicit `qpos_dim` /
|
| 8 |
+
`action_dim` instead of the ALOHA 14-DoF constants, and one backbone shared by every camera (upstream behaviour).
|
| 9 |
+
The policy uses `return_intermediate_dec=False`: `Transformer.forward(...)[0]` is the final decoder layer.
|
| 10 |
+
"""
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import copy
|
| 14 |
+
import math
|
| 15 |
+
from typing import Optional
|
| 16 |
+
|
| 17 |
+
import numpy as np
|
| 18 |
+
import torch
|
| 19 |
+
import torch.nn.functional as F
|
| 20 |
+
import torchvision
|
| 21 |
+
from torch import Tensor, nn
|
| 22 |
+
from torchvision.models._utils import IntermediateLayerGetter
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class PositionEmbeddingSine(nn.Module):
|
| 26 |
+
"""Standard DETR sine embedding over a ``(B, C, H, W)`` feature map."""
|
| 27 |
+
|
| 28 |
+
def __init__(
|
| 29 |
+
self, num_pos_feats: int = 64, temperature: int = 10000, normalize: bool = False
|
| 30 |
+
) -> None:
|
| 31 |
+
super().__init__()
|
| 32 |
+
self.num_pos_feats = num_pos_feats
|
| 33 |
+
self.temperature = temperature
|
| 34 |
+
self.normalize = normalize
|
| 35 |
+
self.scale = 2 * math.pi
|
| 36 |
+
|
| 37 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 38 |
+
not_mask = torch.ones((1, x.shape[-2], x.shape[-1]), device=x.device)
|
| 39 |
+
y_embed = not_mask.cumsum(1, dtype=torch.float32)
|
| 40 |
+
x_embed = not_mask.cumsum(2, dtype=torch.float32)
|
| 41 |
+
if self.normalize:
|
| 42 |
+
eps = 1e-6
|
| 43 |
+
y_embed = y_embed / (y_embed[:, -1:, :] + eps) * self.scale
|
| 44 |
+
x_embed = x_embed / (x_embed[:, :, -1:] + eps) * self.scale
|
| 45 |
+
|
| 46 |
+
dim_t = torch.arange(self.num_pos_feats, dtype=torch.float32, device=x.device)
|
| 47 |
+
dim_t = self.temperature ** (2 * (dim_t // 2) / self.num_pos_feats)
|
| 48 |
+
|
| 49 |
+
pos_x = x_embed[:, :, :, None] / dim_t
|
| 50 |
+
pos_y = y_embed[:, :, :, None] / dim_t
|
| 51 |
+
pos_x = torch.stack(
|
| 52 |
+
(pos_x[:, :, :, 0::2].sin(), pos_x[:, :, :, 1::2].cos()), dim=4
|
| 53 |
+
).flatten(3)
|
| 54 |
+
pos_y = torch.stack(
|
| 55 |
+
(pos_y[:, :, :, 0::2].sin(), pos_y[:, :, :, 1::2].cos()), dim=4
|
| 56 |
+
).flatten(3)
|
| 57 |
+
return torch.cat((pos_y, pos_x), dim=3).permute(0, 3, 1, 2)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class FrozenBatchNorm2d(nn.Module):
|
| 61 |
+
"""BatchNorm2d with fixed statistics and affine parameters (the DETR/ACT backbone norm)."""
|
| 62 |
+
|
| 63 |
+
def __init__(self, n: int) -> None:
|
| 64 |
+
super().__init__()
|
| 65 |
+
self.register_buffer("weight", torch.ones(n))
|
| 66 |
+
self.register_buffer("bias", torch.zeros(n))
|
| 67 |
+
self.register_buffer("running_mean", torch.zeros(n))
|
| 68 |
+
self.register_buffer("running_var", torch.ones(n))
|
| 69 |
+
|
| 70 |
+
def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, *args):
|
| 71 |
+
state_dict.pop(prefix + "num_batches_tracked", None)
|
| 72 |
+
super()._load_from_state_dict(state_dict, prefix, local_metadata, strict, *args)
|
| 73 |
+
|
| 74 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 75 |
+
w = self.weight.reshape(1, -1, 1, 1)
|
| 76 |
+
b = self.bias.reshape(1, -1, 1, 1)
|
| 77 |
+
rv = self.running_var.reshape(1, -1, 1, 1)
|
| 78 |
+
rm = self.running_mean.reshape(1, -1, 1, 1)
|
| 79 |
+
scale = w * (rv + 1e-5).rsqrt()
|
| 80 |
+
return x * scale + (b - rm * scale)
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
class Backbone(nn.Module):
|
| 84 |
+
"""ResNet trunk returning the layer4 feature map."""
|
| 85 |
+
|
| 86 |
+
def __init__(self, name: str = "resnet18", weights: str | None = None) -> None:
|
| 87 |
+
super().__init__()
|
| 88 |
+
trunk = getattr(torchvision.models, name)(
|
| 89 |
+
replace_stride_with_dilation=[False, False, False],
|
| 90 |
+
weights=weights,
|
| 91 |
+
norm_layer=FrozenBatchNorm2d,
|
| 92 |
+
)
|
| 93 |
+
self.body = IntermediateLayerGetter(trunk, return_layers={"layer4": "0"})
|
| 94 |
+
self.num_channels = 512 if name in ("resnet18", "resnet34") else 2048
|
| 95 |
+
|
| 96 |
+
def forward(self, x: torch.Tensor) -> dict[str, torch.Tensor]:
|
| 97 |
+
return self.body(x)
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
class Joiner(nn.Sequential):
|
| 101 |
+
"""Backbone + position embedding, returning matched feature/position lists."""
|
| 102 |
+
|
| 103 |
+
def __init__(self, backbone: Backbone, position_embedding: PositionEmbeddingSine) -> None:
|
| 104 |
+
super().__init__(backbone, position_embedding)
|
| 105 |
+
self.num_channels = backbone.num_channels
|
| 106 |
+
|
| 107 |
+
def forward(self, x: torch.Tensor) -> tuple[list[torch.Tensor], list[torch.Tensor]]:
|
| 108 |
+
features = list(self[0](x).values())
|
| 109 |
+
pos = [self[1](f).to(f.dtype) for f in features]
|
| 110 |
+
return features, pos
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
def build_backbone(
|
| 114 |
+
name: str = "resnet18", hidden_dim: int = 512, weights: str | None = None
|
| 115 |
+
) -> Joiner:
|
| 116 |
+
"""The ACT camera backbone: ResNet + sine embedding sized to the transformer width."""
|
| 117 |
+
return Joiner(Backbone(name, weights=weights), PositionEmbeddingSine(hidden_dim // 2))
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
class Transformer(nn.Module):
|
| 121 |
+
def __init__(
|
| 122 |
+
self,
|
| 123 |
+
d_model=512,
|
| 124 |
+
nhead=8,
|
| 125 |
+
num_encoder_layers=6,
|
| 126 |
+
num_decoder_layers=6,
|
| 127 |
+
dim_feedforward=2048,
|
| 128 |
+
dropout=0.1,
|
| 129 |
+
activation="relu",
|
| 130 |
+
normalize_before=False,
|
| 131 |
+
return_intermediate_dec=False,
|
| 132 |
+
):
|
| 133 |
+
super().__init__()
|
| 134 |
+
|
| 135 |
+
encoder_layer = TransformerEncoderLayer(
|
| 136 |
+
d_model, nhead, dim_feedforward, dropout, activation, normalize_before
|
| 137 |
+
)
|
| 138 |
+
encoder_norm = nn.LayerNorm(d_model) if normalize_before else None
|
| 139 |
+
self.encoder = TransformerEncoder(encoder_layer, num_encoder_layers, encoder_norm)
|
| 140 |
+
|
| 141 |
+
decoder_layer = TransformerDecoderLayer(
|
| 142 |
+
d_model, nhead, dim_feedforward, dropout, activation, normalize_before
|
| 143 |
+
)
|
| 144 |
+
decoder_norm = nn.LayerNorm(d_model)
|
| 145 |
+
self.decoder = TransformerDecoder(
|
| 146 |
+
decoder_layer,
|
| 147 |
+
num_decoder_layers,
|
| 148 |
+
decoder_norm,
|
| 149 |
+
return_intermediate=return_intermediate_dec,
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
self._reset_parameters()
|
| 153 |
+
|
| 154 |
+
self.d_model = d_model
|
| 155 |
+
self.nhead = nhead
|
| 156 |
+
|
| 157 |
+
def _reset_parameters(self):
|
| 158 |
+
for p in self.parameters():
|
| 159 |
+
if p.dim() > 1:
|
| 160 |
+
nn.init.xavier_uniform_(p)
|
| 161 |
+
|
| 162 |
+
def forward(
|
| 163 |
+
self,
|
| 164 |
+
src,
|
| 165 |
+
mask,
|
| 166 |
+
query_embed,
|
| 167 |
+
pos_embed,
|
| 168 |
+
latent_input=None,
|
| 169 |
+
proprio_input=None,
|
| 170 |
+
additional_pos_embed=None,
|
| 171 |
+
):
|
| 172 |
+
# TODO flatten only when input has H and W
|
| 173 |
+
if len(src.shape) == 4: # has H and W
|
| 174 |
+
# flatten NxCxHxW to HWxNxC
|
| 175 |
+
bs, c, h, w = src.shape
|
| 176 |
+
src = src.flatten(2).permute(2, 0, 1)
|
| 177 |
+
pos_embed = pos_embed.flatten(2).permute(2, 0, 1).repeat(1, bs, 1)
|
| 178 |
+
query_embed = query_embed.unsqueeze(1).repeat(1, bs, 1)
|
| 179 |
+
# mask = mask.flatten(1)
|
| 180 |
+
|
| 181 |
+
additional_pos_embed = additional_pos_embed.unsqueeze(1).repeat(
|
| 182 |
+
1, bs, 1
|
| 183 |
+
) # seq, bs, dim
|
| 184 |
+
pos_embed = torch.cat([additional_pos_embed, pos_embed], axis=0)
|
| 185 |
+
|
| 186 |
+
addition_input = torch.stack([latent_input, proprio_input], axis=0)
|
| 187 |
+
src = torch.cat([addition_input, src], axis=0)
|
| 188 |
+
else:
|
| 189 |
+
assert len(src.shape) == 3
|
| 190 |
+
# flatten NxHWxC to HWxNxC
|
| 191 |
+
bs, hw, c = src.shape
|
| 192 |
+
src = src.permute(1, 0, 2)
|
| 193 |
+
pos_embed = pos_embed.unsqueeze(1).repeat(1, bs, 1)
|
| 194 |
+
query_embed = query_embed.unsqueeze(1).repeat(1, bs, 1)
|
| 195 |
+
|
| 196 |
+
tgt = torch.zeros_like(query_embed)
|
| 197 |
+
memory = self.encoder(src, src_key_padding_mask=mask, pos=pos_embed)
|
| 198 |
+
hs = self.decoder(
|
| 199 |
+
tgt, memory, memory_key_padding_mask=mask, pos=pos_embed, query_pos=query_embed
|
| 200 |
+
)
|
| 201 |
+
hs = hs.transpose(1, 2)
|
| 202 |
+
return hs
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
class TransformerEncoder(nn.Module):
|
| 206 |
+
def __init__(self, encoder_layer, num_layers, norm=None):
|
| 207 |
+
super().__init__()
|
| 208 |
+
self.layers = _get_clones(encoder_layer, num_layers)
|
| 209 |
+
self.num_layers = num_layers
|
| 210 |
+
self.norm = norm
|
| 211 |
+
|
| 212 |
+
def forward(
|
| 213 |
+
self,
|
| 214 |
+
src,
|
| 215 |
+
mask: Optional[Tensor] = None,
|
| 216 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 217 |
+
pos: Optional[Tensor] = None,
|
| 218 |
+
):
|
| 219 |
+
output = src
|
| 220 |
+
|
| 221 |
+
for layer in self.layers:
|
| 222 |
+
output = layer(
|
| 223 |
+
output, src_mask=mask, src_key_padding_mask=src_key_padding_mask, pos=pos
|
| 224 |
+
)
|
| 225 |
+
|
| 226 |
+
if self.norm is not None:
|
| 227 |
+
output = self.norm(output)
|
| 228 |
+
|
| 229 |
+
return output
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
class TransformerDecoder(nn.Module):
|
| 233 |
+
def __init__(self, decoder_layer, num_layers, norm=None, return_intermediate=False):
|
| 234 |
+
super().__init__()
|
| 235 |
+
self.layers = _get_clones(decoder_layer, num_layers)
|
| 236 |
+
self.num_layers = num_layers
|
| 237 |
+
self.norm = norm
|
| 238 |
+
self.return_intermediate = return_intermediate
|
| 239 |
+
|
| 240 |
+
def forward(
|
| 241 |
+
self,
|
| 242 |
+
tgt,
|
| 243 |
+
memory,
|
| 244 |
+
tgt_mask: Optional[Tensor] = None,
|
| 245 |
+
memory_mask: Optional[Tensor] = None,
|
| 246 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 247 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 248 |
+
pos: Optional[Tensor] = None,
|
| 249 |
+
query_pos: Optional[Tensor] = None,
|
| 250 |
+
):
|
| 251 |
+
output = tgt
|
| 252 |
+
|
| 253 |
+
intermediate = []
|
| 254 |
+
|
| 255 |
+
for layer in self.layers:
|
| 256 |
+
output = layer(
|
| 257 |
+
output,
|
| 258 |
+
memory,
|
| 259 |
+
tgt_mask=tgt_mask,
|
| 260 |
+
memory_mask=memory_mask,
|
| 261 |
+
tgt_key_padding_mask=tgt_key_padding_mask,
|
| 262 |
+
memory_key_padding_mask=memory_key_padding_mask,
|
| 263 |
+
pos=pos,
|
| 264 |
+
query_pos=query_pos,
|
| 265 |
+
)
|
| 266 |
+
if self.return_intermediate:
|
| 267 |
+
intermediate.append(self.norm(output))
|
| 268 |
+
|
| 269 |
+
if self.norm is not None:
|
| 270 |
+
output = self.norm(output)
|
| 271 |
+
if self.return_intermediate:
|
| 272 |
+
intermediate.pop()
|
| 273 |
+
intermediate.append(output)
|
| 274 |
+
|
| 275 |
+
if self.return_intermediate:
|
| 276 |
+
return torch.stack(intermediate)
|
| 277 |
+
|
| 278 |
+
return output.unsqueeze(0)
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
class TransformerEncoderLayer(nn.Module):
|
| 282 |
+
def __init__(
|
| 283 |
+
self,
|
| 284 |
+
d_model,
|
| 285 |
+
nhead,
|
| 286 |
+
dim_feedforward=2048,
|
| 287 |
+
dropout=0.1,
|
| 288 |
+
activation="relu",
|
| 289 |
+
normalize_before=False,
|
| 290 |
+
):
|
| 291 |
+
super().__init__()
|
| 292 |
+
self.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
|
| 293 |
+
# Implementation of Feedforward model
|
| 294 |
+
self.linear1 = nn.Linear(d_model, dim_feedforward)
|
| 295 |
+
self.dropout = nn.Dropout(dropout)
|
| 296 |
+
self.linear2 = nn.Linear(dim_feedforward, d_model)
|
| 297 |
+
|
| 298 |
+
self.norm1 = nn.LayerNorm(d_model)
|
| 299 |
+
self.norm2 = nn.LayerNorm(d_model)
|
| 300 |
+
self.dropout1 = nn.Dropout(dropout)
|
| 301 |
+
self.dropout2 = nn.Dropout(dropout)
|
| 302 |
+
|
| 303 |
+
self.activation = _get_activation_fn(activation)
|
| 304 |
+
self.normalize_before = normalize_before
|
| 305 |
+
|
| 306 |
+
def with_pos_embed(self, tensor, pos: Optional[Tensor]):
|
| 307 |
+
return tensor if pos is None else tensor + pos
|
| 308 |
+
|
| 309 |
+
def forward_post(
|
| 310 |
+
self,
|
| 311 |
+
src,
|
| 312 |
+
src_mask: Optional[Tensor] = None,
|
| 313 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 314 |
+
pos: Optional[Tensor] = None,
|
| 315 |
+
):
|
| 316 |
+
q = k = self.with_pos_embed(src, pos)
|
| 317 |
+
src2 = self.self_attn(
|
| 318 |
+
q, k, value=src, attn_mask=src_mask, key_padding_mask=src_key_padding_mask
|
| 319 |
+
)[0]
|
| 320 |
+
src = src + self.dropout1(src2)
|
| 321 |
+
src = self.norm1(src)
|
| 322 |
+
src2 = self.linear2(self.dropout(self.activation(self.linear1(src))))
|
| 323 |
+
src = src + self.dropout2(src2)
|
| 324 |
+
src = self.norm2(src)
|
| 325 |
+
return src
|
| 326 |
+
|
| 327 |
+
def forward_pre(
|
| 328 |
+
self,
|
| 329 |
+
src,
|
| 330 |
+
src_mask: Optional[Tensor] = None,
|
| 331 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 332 |
+
pos: Optional[Tensor] = None,
|
| 333 |
+
):
|
| 334 |
+
src2 = self.norm1(src)
|
| 335 |
+
q = k = self.with_pos_embed(src2, pos)
|
| 336 |
+
src2 = self.self_attn(
|
| 337 |
+
q, k, value=src2, attn_mask=src_mask, key_padding_mask=src_key_padding_mask
|
| 338 |
+
)[0]
|
| 339 |
+
src = src + self.dropout1(src2)
|
| 340 |
+
src2 = self.norm2(src)
|
| 341 |
+
src2 = self.linear2(self.dropout(self.activation(self.linear1(src2))))
|
| 342 |
+
src = src + self.dropout2(src2)
|
| 343 |
+
return src
|
| 344 |
+
|
| 345 |
+
def forward(
|
| 346 |
+
self,
|
| 347 |
+
src,
|
| 348 |
+
src_mask: Optional[Tensor] = None,
|
| 349 |
+
src_key_padding_mask: Optional[Tensor] = None,
|
| 350 |
+
pos: Optional[Tensor] = None,
|
| 351 |
+
):
|
| 352 |
+
if self.normalize_before:
|
| 353 |
+
return self.forward_pre(src, src_mask, src_key_padding_mask, pos)
|
| 354 |
+
return self.forward_post(src, src_mask, src_key_padding_mask, pos)
|
| 355 |
+
|
| 356 |
+
|
| 357 |
+
class TransformerDecoderLayer(nn.Module):
|
| 358 |
+
def __init__(
|
| 359 |
+
self,
|
| 360 |
+
d_model,
|
| 361 |
+
nhead,
|
| 362 |
+
dim_feedforward=2048,
|
| 363 |
+
dropout=0.1,
|
| 364 |
+
activation="relu",
|
| 365 |
+
normalize_before=False,
|
| 366 |
+
):
|
| 367 |
+
super().__init__()
|
| 368 |
+
self.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
|
| 369 |
+
self.multihead_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
|
| 370 |
+
# Implementation of Feedforward model
|
| 371 |
+
self.linear1 = nn.Linear(d_model, dim_feedforward)
|
| 372 |
+
self.dropout = nn.Dropout(dropout)
|
| 373 |
+
self.linear2 = nn.Linear(dim_feedforward, d_model)
|
| 374 |
+
|
| 375 |
+
self.norm1 = nn.LayerNorm(d_model)
|
| 376 |
+
self.norm2 = nn.LayerNorm(d_model)
|
| 377 |
+
self.norm3 = nn.LayerNorm(d_model)
|
| 378 |
+
self.dropout1 = nn.Dropout(dropout)
|
| 379 |
+
self.dropout2 = nn.Dropout(dropout)
|
| 380 |
+
self.dropout3 = nn.Dropout(dropout)
|
| 381 |
+
|
| 382 |
+
self.activation = _get_activation_fn(activation)
|
| 383 |
+
self.normalize_before = normalize_before
|
| 384 |
+
|
| 385 |
+
def with_pos_embed(self, tensor, pos: Optional[Tensor]):
|
| 386 |
+
return tensor if pos is None else tensor + pos
|
| 387 |
+
|
| 388 |
+
def forward_post(
|
| 389 |
+
self,
|
| 390 |
+
tgt,
|
| 391 |
+
memory,
|
| 392 |
+
tgt_mask: Optional[Tensor] = None,
|
| 393 |
+
memory_mask: Optional[Tensor] = None,
|
| 394 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 395 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 396 |
+
pos: Optional[Tensor] = None,
|
| 397 |
+
query_pos: Optional[Tensor] = None,
|
| 398 |
+
):
|
| 399 |
+
q = k = self.with_pos_embed(tgt, query_pos)
|
| 400 |
+
tgt2 = self.self_attn(
|
| 401 |
+
q, k, value=tgt, attn_mask=tgt_mask, key_padding_mask=tgt_key_padding_mask
|
| 402 |
+
)[0]
|
| 403 |
+
tgt = tgt + self.dropout1(tgt2)
|
| 404 |
+
tgt = self.norm1(tgt)
|
| 405 |
+
tgt2 = self.multihead_attn(
|
| 406 |
+
query=self.with_pos_embed(tgt, query_pos),
|
| 407 |
+
key=self.with_pos_embed(memory, pos),
|
| 408 |
+
value=memory,
|
| 409 |
+
attn_mask=memory_mask,
|
| 410 |
+
key_padding_mask=memory_key_padding_mask,
|
| 411 |
+
)[0]
|
| 412 |
+
tgt = tgt + self.dropout2(tgt2)
|
| 413 |
+
tgt = self.norm2(tgt)
|
| 414 |
+
tgt2 = self.linear2(self.dropout(self.activation(self.linear1(tgt))))
|
| 415 |
+
tgt = tgt + self.dropout3(tgt2)
|
| 416 |
+
tgt = self.norm3(tgt)
|
| 417 |
+
return tgt
|
| 418 |
+
|
| 419 |
+
def forward_pre(
|
| 420 |
+
self,
|
| 421 |
+
tgt,
|
| 422 |
+
memory,
|
| 423 |
+
tgt_mask: Optional[Tensor] = None,
|
| 424 |
+
memory_mask: Optional[Tensor] = None,
|
| 425 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 426 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 427 |
+
pos: Optional[Tensor] = None,
|
| 428 |
+
query_pos: Optional[Tensor] = None,
|
| 429 |
+
):
|
| 430 |
+
tgt2 = self.norm1(tgt)
|
| 431 |
+
q = k = self.with_pos_embed(tgt2, query_pos)
|
| 432 |
+
tgt2 = self.self_attn(
|
| 433 |
+
q, k, value=tgt2, attn_mask=tgt_mask, key_padding_mask=tgt_key_padding_mask
|
| 434 |
+
)[0]
|
| 435 |
+
tgt = tgt + self.dropout1(tgt2)
|
| 436 |
+
tgt2 = self.norm2(tgt)
|
| 437 |
+
tgt2 = self.multihead_attn(
|
| 438 |
+
query=self.with_pos_embed(tgt2, query_pos),
|
| 439 |
+
key=self.with_pos_embed(memory, pos),
|
| 440 |
+
value=memory,
|
| 441 |
+
attn_mask=memory_mask,
|
| 442 |
+
key_padding_mask=memory_key_padding_mask,
|
| 443 |
+
)[0]
|
| 444 |
+
tgt = tgt + self.dropout2(tgt2)
|
| 445 |
+
tgt2 = self.norm3(tgt)
|
| 446 |
+
tgt2 = self.linear2(self.dropout(self.activation(self.linear1(tgt2))))
|
| 447 |
+
tgt = tgt + self.dropout3(tgt2)
|
| 448 |
+
return tgt
|
| 449 |
+
|
| 450 |
+
def forward(
|
| 451 |
+
self,
|
| 452 |
+
tgt,
|
| 453 |
+
memory,
|
| 454 |
+
tgt_mask: Optional[Tensor] = None,
|
| 455 |
+
memory_mask: Optional[Tensor] = None,
|
| 456 |
+
tgt_key_padding_mask: Optional[Tensor] = None,
|
| 457 |
+
memory_key_padding_mask: Optional[Tensor] = None,
|
| 458 |
+
pos: Optional[Tensor] = None,
|
| 459 |
+
query_pos: Optional[Tensor] = None,
|
| 460 |
+
):
|
| 461 |
+
if self.normalize_before:
|
| 462 |
+
return self.forward_pre(
|
| 463 |
+
tgt,
|
| 464 |
+
memory,
|
| 465 |
+
tgt_mask,
|
| 466 |
+
memory_mask,
|
| 467 |
+
tgt_key_padding_mask,
|
| 468 |
+
memory_key_padding_mask,
|
| 469 |
+
pos,
|
| 470 |
+
query_pos,
|
| 471 |
+
)
|
| 472 |
+
return self.forward_post(
|
| 473 |
+
tgt,
|
| 474 |
+
memory,
|
| 475 |
+
tgt_mask,
|
| 476 |
+
memory_mask,
|
| 477 |
+
tgt_key_padding_mask,
|
| 478 |
+
memory_key_padding_mask,
|
| 479 |
+
pos,
|
| 480 |
+
query_pos,
|
| 481 |
+
)
|
| 482 |
+
|
| 483 |
+
|
| 484 |
+
def _get_clones(module, N):
|
| 485 |
+
return nn.ModuleList([copy.deepcopy(module) for i in range(N)])
|
| 486 |
+
|
| 487 |
+
|
| 488 |
+
def _get_activation_fn(activation):
|
| 489 |
+
"""Return an activation function given a string."""
|
| 490 |
+
if activation == "relu":
|
| 491 |
+
return F.relu
|
| 492 |
+
if activation == "gelu":
|
| 493 |
+
return F.gelu
|
| 494 |
+
raise RuntimeError(f"activation should be relu/gelu, not {activation}.")
|
| 495 |
+
|
| 496 |
+
|
| 497 |
+
|
| 498 |
+
def reparametrize(mu: torch.Tensor, logvar: torch.Tensor) -> torch.Tensor:
|
| 499 |
+
std = logvar.div(2).exp()
|
| 500 |
+
return mu + std * torch.randn_like(std)
|
| 501 |
+
|
| 502 |
+
|
| 503 |
+
def get_sinusoid_encoding_table(n_position: int, d_hid: int) -> torch.Tensor:
|
| 504 |
+
def angle_vec(position: int) -> list[float]:
|
| 505 |
+
return [position / np.power(10000, 2 * (j // 2) / d_hid) for j in range(d_hid)]
|
| 506 |
+
|
| 507 |
+
table = np.array([angle_vec(i) for i in range(n_position)])
|
| 508 |
+
table[:, 0::2] = np.sin(table[:, 0::2])
|
| 509 |
+
table[:, 1::2] = np.cos(table[:, 1::2])
|
| 510 |
+
return torch.FloatTensor(table).unsqueeze(0)
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
def build_style_encoder(
|
| 514 |
+
hidden_dim: int, nheads: int, dim_feedforward: int, enc_layers: int, dropout: float
|
| 515 |
+
) -> TransformerEncoder:
|
| 516 |
+
"""The CVAE style encoder (a plain transformer encoder over [CLS, qpos, action seq])."""
|
| 517 |
+
layer = TransformerEncoderLayer(hidden_dim, nheads, dim_feedforward, dropout, "relu", False)
|
| 518 |
+
return TransformerEncoder(layer, enc_layers, norm=None)
|
| 519 |
+
|
| 520 |
+
|
| 521 |
+
class DETRVAE(nn.Module):
|
| 522 |
+
"""CVAE decoder: (qpos, images[, action seq]) → ``num_queries`` future actions."""
|
| 523 |
+
|
| 524 |
+
def __init__(
|
| 525 |
+
self,
|
| 526 |
+
backbone: Joiner,
|
| 527 |
+
transformer: Transformer,
|
| 528 |
+
encoder: TransformerEncoder,
|
| 529 |
+
*,
|
| 530 |
+
qpos_dim: int,
|
| 531 |
+
action_dim: int,
|
| 532 |
+
num_queries: int,
|
| 533 |
+
latent_dim: int = 32,
|
| 534 |
+
) -> None:
|
| 535 |
+
super().__init__()
|
| 536 |
+
self.num_queries = num_queries
|
| 537 |
+
self.transformer = transformer
|
| 538 |
+
self.encoder = encoder
|
| 539 |
+
hidden_dim = transformer.d_model
|
| 540 |
+
self.action_head = nn.Linear(hidden_dim, action_dim)
|
| 541 |
+
self.query_embed = nn.Embedding(num_queries, hidden_dim)
|
| 542 |
+
self.backbone = backbone # ONE backbone shared by every camera (upstream behavior)
|
| 543 |
+
self.input_proj = nn.Conv2d(backbone.num_channels, hidden_dim, kernel_size=1)
|
| 544 |
+
self.input_proj_robot_state = nn.Linear(qpos_dim, hidden_dim)
|
| 545 |
+
|
| 546 |
+
# CVAE style encoder inputs
|
| 547 |
+
self.latent_dim = latent_dim
|
| 548 |
+
self.cls_embed = nn.Embedding(1, hidden_dim)
|
| 549 |
+
self.encoder_action_proj = nn.Linear(action_dim, hidden_dim)
|
| 550 |
+
self.encoder_joint_proj = nn.Linear(qpos_dim, hidden_dim)
|
| 551 |
+
self.latent_proj = nn.Linear(hidden_dim, latent_dim * 2)
|
| 552 |
+
self.register_buffer(
|
| 553 |
+
"pos_table", get_sinusoid_encoding_table(1 + 1 + num_queries, hidden_dim)
|
| 554 |
+
)
|
| 555 |
+
# decoder side
|
| 556 |
+
self.latent_out_proj = nn.Linear(latent_dim, hidden_dim)
|
| 557 |
+
self.additional_pos_embed = nn.Embedding(2, hidden_dim) # latent + proprio slots
|
| 558 |
+
|
| 559 |
+
def forward(
|
| 560 |
+
self,
|
| 561 |
+
qpos: torch.Tensor,
|
| 562 |
+
images: torch.Tensor,
|
| 563 |
+
actions: torch.Tensor | None = None,
|
| 564 |
+
is_pad: torch.Tensor | None = None,
|
| 565 |
+
) -> tuple[torch.Tensor, tuple[torch.Tensor | None, torch.Tensor | None]]:
|
| 566 |
+
"""``qpos (B, Dq)``, ``images (B, ncam, C, H, W)``; train passes ``actions (B, T, Da)``."""
|
| 567 |
+
is_training = actions is not None
|
| 568 |
+
bs = qpos.shape[0]
|
| 569 |
+
if is_training:
|
| 570 |
+
action_embed = self.encoder_action_proj(actions)
|
| 571 |
+
qpos_embed = self.encoder_joint_proj(qpos).unsqueeze(1)
|
| 572 |
+
cls_embed = self.cls_embed.weight.unsqueeze(0).repeat(bs, 1, 1)
|
| 573 |
+
encoder_input = torch.cat([cls_embed, qpos_embed, action_embed], dim=1)
|
| 574 |
+
encoder_input = encoder_input.permute(1, 0, 2)
|
| 575 |
+
if is_pad is None:
|
| 576 |
+
is_pad = torch.zeros(bs, actions.shape[1], dtype=torch.bool, device=qpos.device)
|
| 577 |
+
cls_joint_is_pad = torch.full((bs, 2), False, device=qpos.device)
|
| 578 |
+
key_pad = torch.cat([cls_joint_is_pad, is_pad], dim=1)
|
| 579 |
+
pos_embed = self.pos_table.clone().detach().permute(1, 0, 2)
|
| 580 |
+
encoder_output = self.encoder(
|
| 581 |
+
encoder_input, pos=pos_embed, src_key_padding_mask=key_pad
|
| 582 |
+
)[0]
|
| 583 |
+
latent_info = self.latent_proj(encoder_output)
|
| 584 |
+
mu = latent_info[:, : self.latent_dim]
|
| 585 |
+
logvar = latent_info[:, self.latent_dim :]
|
| 586 |
+
latent_input = self.latent_out_proj(reparametrize(mu, logvar))
|
| 587 |
+
else:
|
| 588 |
+
mu = logvar = None
|
| 589 |
+
latent_sample = torch.zeros(bs, self.latent_dim, device=qpos.device)
|
| 590 |
+
latent_input = self.latent_out_proj(latent_sample)
|
| 591 |
+
|
| 592 |
+
all_cam_features, all_cam_pos = [], []
|
| 593 |
+
for cam_id in range(images.shape[1]):
|
| 594 |
+
features, pos = self.backbone(images[:, cam_id])
|
| 595 |
+
all_cam_features.append(self.input_proj(features[0]))
|
| 596 |
+
all_cam_pos.append(pos[0])
|
| 597 |
+
proprio_input = self.input_proj_robot_state(qpos)
|
| 598 |
+
src = torch.cat(all_cam_features, dim=3) # cameras fold into the width axis
|
| 599 |
+
pos = torch.cat(all_cam_pos, dim=3)
|
| 600 |
+
hs = self.transformer(
|
| 601 |
+
src,
|
| 602 |
+
None,
|
| 603 |
+
self.query_embed.weight,
|
| 604 |
+
pos,
|
| 605 |
+
latent_input,
|
| 606 |
+
proprio_input,
|
| 607 |
+
self.additional_pos_embed.weight,
|
| 608 |
+
)[0]
|
| 609 |
+
return self.action_head(hs), (mu, logvar)
|
| 610 |
+
|
| 611 |
+
|
| 612 |
+
def kl_divergence(mu: torch.Tensor, logvar: torch.Tensor) -> torch.Tensor:
|
| 613 |
+
"""Total KL(q(z|x) || N(0, I)), summed over latent dims, meaned over the batch."""
|
| 614 |
+
klds = -0.5 * (1 + logvar - mu.pow(2) - logvar.exp())
|
| 615 |
+
return klds.sum(1).mean()
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/adapters.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The G1 evaluation adapters of the baselines (evaluation/README.md#the-model-interface): `make_model('fm_dit')`
|
| 2 |
+
returns the `Model` class that `evaluation/policy/FMDiT/model.py` exports (likewise DP, ACT, FLASH, ODEMLP, ODEDiT).
|
| 3 |
+
|
| 4 |
+
Observation: the current ego_view and chest frames (480x640 RGB, resized as the training cache) and state44; FM-DiT,
|
| 5 |
+
DP and ACT read no past actions or earlier frames (one frame); FLASH and the ODE policies also read the interface's
|
| 6 |
+
executed rows before the query (`past_actions`, `history_valid`: the token sent and the INSPIRE opening measured at
|
| 7 |
+
each earlier frame): FLASH for its polynomial history, the ODE policies the last one (frame t-1) as their start.
|
| 8 |
+
Output: the checkpoint's whole chunk (16 rows of action76, row 0 executed at the request's frame), `execution_steps`
|
| 9 |
+
rows of it executed before the next query (deploy.yml `config: execution_steps`, default the whole chunk; the runners
|
| 10 |
+
re-query after at most 12 rows), the request's seed for the sampling noise (FM-DiT, DP).
|
| 11 |
+
"""
|
| 12 |
+
from __future__ import annotations
|
| 13 |
+
|
| 14 |
+
from .runtime import BaselinePolicy
|
| 15 |
+
|
| 16 |
+
WIDTH = {'sonic_dfx6': 76}
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def require(condition, message):
|
| 20 |
+
if not condition:
|
| 21 |
+
raise RuntimeError(message)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def make_model(policy_name: str):
|
| 25 |
+
class Model:
|
| 26 |
+
history_length = 1 # the current head and chest frames only
|
| 27 |
+
video_frames = 0
|
| 28 |
+
|
| 29 |
+
def __init__(self, cfg):
|
| 30 |
+
self.policy = BaselinePolicy(cfg['checkpoint_path'], device=cfg.get('device', 'cuda:0'),
|
| 31 |
+
policy=policy_name, robot='g1')
|
| 32 |
+
contract = self.policy.contract
|
| 33 |
+
require(cfg['action_space'] in WIDTH and contract['action_space'] == cfg['action_space']
|
| 34 |
+
and self.policy.action_dim == WIDTH[cfg['action_space']] and self.policy.state_dim == 44
|
| 35 |
+
and list(self.policy.cameras) == ['ego_view', 'chest'],
|
| 36 |
+
f"checkpoint contract {contract['name']} does not serve {cfg['action_space']}")
|
| 37 |
+
extra = cfg.get('config') or {}
|
| 38 |
+
if extra.get('check_task', True):
|
| 39 |
+
require(cfg['task'].strip() == (self.policy.task_text or '').strip(),
|
| 40 |
+
f'task text {cfg["task"]!r} is not the training task {self.policy.task_text!r}')
|
| 41 |
+
self.execution_steps = int(extra.get('execution_steps') or self.policy.horizon)
|
| 42 |
+
require(1 <= self.execution_steps <= self.policy.horizon, f'execution_steps {self.execution_steps}')
|
| 43 |
+
self.uses_history = self.policy.name == 'flash' or self.policy.uses_previous
|
| 44 |
+
self.info = dict(self.policy.info(), execution_steps=self.execution_steps,
|
| 45 |
+
inputs='current frames + state44' + (' + executed-action history' if self.uses_history
|
| 46 |
+
else ''))
|
| 47 |
+
|
| 48 |
+
def get_action(self, obs):
|
| 49 |
+
if self.uses_history:
|
| 50 |
+
action, _ = self.policy.predict(obs['images'], obs['state'], seed=obs['seed'],
|
| 51 |
+
past_actions=obs['past_actions'], history_valid=obs['history_valid'])
|
| 52 |
+
else:
|
| 53 |
+
action, _ = self.policy.predict(obs['images'], obs['state'], seed=obs['seed'])
|
| 54 |
+
return dict(action=action, execution_steps=self.execution_steps,
|
| 55 |
+
sampling_steps=self.policy.sampling_steps)
|
| 56 |
+
|
| 57 |
+
Model.__name__ = Model.__qualname__ = f'Model_{policy_name}'
|
| 58 |
+
return Model
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_adapter.py
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline check of the FLASH adapter against the training path on recorded frames (before any closed-loop run):
|
| 2 |
+
|
| 3 |
+
<baselines env>/bin/python -I evaluation/baselines/check_flash_adapter.py --checkpoint <checkpoints/step-NNNNNN> \\
|
| 4 |
+
--dataset <LeRobot v2.1 root> --episodes 0,60 --queries 8 [--device cuda:0]
|
| 5 |
+
|
| 6 |
+
For query frames t of each episode (0, then evenly spaced) it builds
|
| 7 |
+
(a) the interface observation a runner sends: the 480x640 ego_view / chest frames (decoded from the dataset videos),
|
| 8 |
+
state44 and past_actions = the 40 recorded action rows before t (history_valid 0 before the episode start), and
|
| 9 |
+
calls evaluation/policy/FLASH/model.py Model.get_action, the deployed adapter;
|
| 10 |
+
(b) the training path: FlashChunkDataset's item for the same anchor (frames resized as the frame cache, the dataset's
|
| 11 |
+
history rule) through FlashPolicy.predict.
|
| 12 |
+
Both chunks must be equal bit for bit (same weights, same device); it also prints the normalized MSE of the chunk
|
| 13 |
+
against the recorded rows from t (rows past the episode's end excluded). Exits 1 on a mismatch.
|
| 14 |
+
"""
|
| 15 |
+
from __future__ import annotations
|
| 16 |
+
|
| 17 |
+
import argparse
|
| 18 |
+
import json
|
| 19 |
+
from pathlib import Path
|
| 20 |
+
import sys
|
| 21 |
+
|
| 22 |
+
import numpy as np
|
| 23 |
+
|
| 24 |
+
HERE = Path(__file__).resolve().parent
|
| 25 |
+
EVALUATION = HERE.parent
|
| 26 |
+
if str(EVALUATION) not in sys.path:
|
| 27 |
+
sys.path.insert(0, str(EVALUATION))
|
| 28 |
+
|
| 29 |
+
HISTORY_ROWS = 40 # the interface's past_actions rows (debug/newton/b6_policy_eval.py HISTORY_ROWS)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def decode(path, indices):
|
| 33 |
+
import av
|
| 34 |
+
want, out = set(int(i) for i in indices), {}
|
| 35 |
+
with av.open(str(path)) as container:
|
| 36 |
+
for k, frame in enumerate(container.decode(video=0)):
|
| 37 |
+
if k in want:
|
| 38 |
+
out[k] = frame.to_ndarray(format='rgb24')
|
| 39 |
+
if len(out) == len(want):
|
| 40 |
+
break
|
| 41 |
+
return out
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def main():
|
| 45 |
+
p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
| 46 |
+
p.add_argument('--checkpoint', type=Path, required=True)
|
| 47 |
+
p.add_argument('--dataset', type=Path, required=True)
|
| 48 |
+
p.add_argument('--episodes', default='0')
|
| 49 |
+
p.add_argument('--queries', type=int, default=8)
|
| 50 |
+
p.add_argument('--device', default='cuda:0')
|
| 51 |
+
a = p.parse_args()
|
| 52 |
+
|
| 53 |
+
import torch
|
| 54 |
+
from baselines.data import CONTRACTS, FlashChunkDataset, LeRobotDataset, load_lowdim, resize_frame
|
| 55 |
+
from baselines.runtime import BaselinePolicy
|
| 56 |
+
sys.path.insert(0, str(EVALUATION / 'policy' / 'FLASH'))
|
| 57 |
+
import model as flash_model
|
| 58 |
+
|
| 59 |
+
base = BaselinePolicy(a.checkpoint, device=a.device, policy='flash', robot='g1')
|
| 60 |
+
contract = CONTRACTS[base.contract['name']]
|
| 61 |
+
adapter = flash_model.Model(dict(checkpoint_path=str(a.checkpoint), device=a.device, action_space='sonic_dfx6',
|
| 62 |
+
task=base.task_text or '', config={}))
|
| 63 |
+
policy = adapter.policy.model # the adapter's own loaded weights
|
| 64 |
+
dataset = LeRobotDataset(a.dataset)
|
| 65 |
+
episodes = [int(e) for e in a.episodes.split(',')]
|
| 66 |
+
lowdim = load_lowdim(dataset, contract, episodes)
|
| 67 |
+
report, worst = [], 0.0
|
| 68 |
+
for pos, ep in enumerate(episodes):
|
| 69 |
+
s, n = int(lowdim['starts'][pos]), int(lowdim['lengths'][pos])
|
| 70 |
+
ts = sorted({0, *np.linspace(0, n - 1, a.queries).astype(int).tolist()})[:a.queries]
|
| 71 |
+
frames = {c: decode(dataset.video(ep, c), ts) for c in base.cameras}
|
| 72 |
+
hw = base.image_hw
|
| 73 |
+
maps = {c: np.zeros((lowdim['lengths'].sum(), *hw, 3), np.uint8) for c in base.cameras}
|
| 74 |
+
for t in ts:
|
| 75 |
+
for c in base.cameras:
|
| 76 |
+
maps[c][s + t] = resize_frame(frames[c][t], hw) # the frame cache's resize of the same frame
|
| 77 |
+
f = policy.flash
|
| 78 |
+
H_ext = f['poly_prefix'] + f['n_action'] + f['poly_suffix'] + 2 * f['fit_pad']
|
| 79 |
+
offsets = (np.arange(H_ext) - (f['fit_pad'] + f['poly_prefix'])) * f['stride']
|
| 80 |
+
ds = FlashChunkDataset(lowdim, {}, base.cameras, hw, [pos], offsets=offsets, stride=f['stride'],
|
| 81 |
+
n_history=f['n_history'], rows=f['rows'], with_dense=True)
|
| 82 |
+
ds._maps, ds._pid = maps, __import__('os').getpid()
|
| 83 |
+
for t in ts:
|
| 84 |
+
k = int(np.nonzero(ds.index == s + t)[0][0])
|
| 85 |
+
images, state, _, hist, has, dense, dense_valid = ds[k]
|
| 86 |
+
idx = np.arange(t - HISTORY_ROWS, t)
|
| 87 |
+
past = lowdim['action'][s + np.clip(idx, 0, n - 1)].astype(np.float32)
|
| 88 |
+
valid = (idx >= 0).astype(np.float32)
|
| 89 |
+
past[idx < 0] = 0.0
|
| 90 |
+
obs = dict(images={c: frames[c][t] for c in base.cameras}, state=lowdim['state'][s + t],
|
| 91 |
+
past_actions=past, history_valid=valid, seed=0, frame=t, history_frame=t)
|
| 92 |
+
a_chunk = adapter.get_action(obs)['action']
|
| 93 |
+
with torch.inference_mode():
|
| 94 |
+
img = images[None].to(a.device).permute(0, 1, 4, 2, 3).float().div_(255.)
|
| 95 |
+
b_chunk, _ = policy.predict(img, state[None].to(a.device), hist[None].to(a.device),
|
| 96 |
+
has[None].to(a.device))
|
| 97 |
+
b_chunk = b_chunk[0].float().cpu().numpy()
|
| 98 |
+
diff = float(np.abs(a_chunk - b_chunk).max())
|
| 99 |
+
worst = max(worst, diff)
|
| 100 |
+
nrm = policy.action_norm
|
| 101 |
+
err = (nrm.normalize(torch.from_numpy(a_chunk).to(a.device)) -
|
| 102 |
+
nrm.normalize(dense.to(a.device))).pow(2).cpu().numpy()[dense_valid.numpy()]
|
| 103 |
+
report.append(dict(episode=ep, t=t, has_history=bool(has), max_abs_diff=diff,
|
| 104 |
+
nmse_vs_recorded=float(err.mean()),
|
| 105 |
+
token_cos_row0=float(np.dot(a_chunk[0, :64], dense[0, :64].numpy()) /
|
| 106 |
+
(np.linalg.norm(a_chunk[0, :64]) *
|
| 107 |
+
np.linalg.norm(dense[0, :64].numpy()) + 1e-12))))
|
| 108 |
+
ok = worst == 0.0
|
| 109 |
+
print(json.dumps(dict(ok=ok, max_abs_diff=worst, checkpoint=str(a.checkpoint), queries=report), indent=1))
|
| 110 |
+
sys.exit(0 if ok else 1)
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
if __name__ == '__main__':
|
| 114 |
+
main()
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/check_flash_parity.py
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Check the FLASH port (evaluation/baselines/flash.py) against the upstream policy, on the CPU:
|
| 2 |
+
|
| 3 |
+
<baselines env>/bin/python -I evaluation/baselines/check_flash_parity.py --upstream <FLASH-Policy checkout>
|
| 4 |
+
|
| 5 |
+
Upstream is NTUMARS/FLASH-Policy @ f47e490 (roboverse_learn/il/...); its `zarr` and `einops` imports are shimmed
|
| 6 |
+
when the environment lacks them (only the parts used here run). Compared, for flash.yaml's settings with n_obs_steps =
|
| 7 |
+
n_history (8), n_action_steps 8, horizon 16:
|
| 8 |
+
|
| 9 |
+
- the polynomial buffers: least-squares matrix, coefficient scales, Tikhonov history fit, KKT boundary-constraint
|
| 10 |
+
matrices and pinned indices;
|
| 11 |
+
- target coefficients (least squares + boundary constraint) and history coefficients on random normalized
|
| 12 |
+
trajectories (identity normalizers on both sides);
|
| 13 |
+
- the DiT: upstream FlowTransformer's weights loaded strictly into FlashFlowTransformer, same outputs;
|
| 14 |
+
- the image encoder: upstream MultiImageObsEncoder (two rgb keys, agent_pos) with this port's weights, same features
|
| 15 |
+
(upstream concatenates its rgb keys in sorted order);
|
| 16 |
+
- the 30 Hz output rows: at multiples of the stride they equal upstream's trajectory points from the anchor.
|
| 17 |
+
Prints one JSON line with the largest differences; exits 1 when one exceeds its tolerance.
|
| 18 |
+
"""
|
| 19 |
+
from __future__ import annotations
|
| 20 |
+
|
| 21 |
+
import argparse
|
| 22 |
+
import json
|
| 23 |
+
from pathlib import Path
|
| 24 |
+
import sys
|
| 25 |
+
import types
|
| 26 |
+
|
| 27 |
+
import torch
|
| 28 |
+
|
| 29 |
+
HERE = Path(__file__).resolve().parent
|
| 30 |
+
if str(HERE.parent) not in sys.path:
|
| 31 |
+
sys.path.insert(0, str(HERE.parent))
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def shim_upstream_imports():
|
| 35 |
+
try:
|
| 36 |
+
import zarr # noqa: F401
|
| 37 |
+
except ImportError:
|
| 38 |
+
zarr = types.ModuleType('zarr')
|
| 39 |
+
zarr.Array = type('Array', (), {})
|
| 40 |
+
sys.modules['zarr'] = zarr
|
| 41 |
+
try:
|
| 42 |
+
import einops # noqa: F401
|
| 43 |
+
except ImportError:
|
| 44 |
+
einops = types.ModuleType('einops')
|
| 45 |
+
einops.reduce = lambda x, pattern, op: x.reshape(x.shape[0], -1) # "b ... -> b (...)" (no reduced axis)
|
| 46 |
+
sys.modules['einops'] = einops
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def main():
|
| 50 |
+
p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
| 51 |
+
p.add_argument('--upstream', type=Path, required=True, help='FLASH-Policy checkout (commit f47e490)')
|
| 52 |
+
p.add_argument('--stride', type=int, default=2)
|
| 53 |
+
a = p.parse_args()
|
| 54 |
+
shim_upstream_imports()
|
| 55 |
+
sys.path.insert(0, str(a.upstream.resolve()))
|
| 56 |
+
from roboverse_learn.il.policies.flash.flash_policy import FlashDiTImagePolicy
|
| 57 |
+
from roboverse_learn.il.utils.models.flow_net import FlowTransformer
|
| 58 |
+
from roboverse_learn.il.utils.vision.model_getter import get_resnet
|
| 59 |
+
from roboverse_learn.il.utils.vision.multi_image_obs_encoder import MultiImageObsEncoder
|
| 60 |
+
from baselines.flash import FLASH_DEFAULTS, FLASH_POLICY_FIELDS, FlashFlowTransformer
|
| 61 |
+
from baselines.policies import PolicyConfig, build_policy
|
| 62 |
+
|
| 63 |
+
torch.manual_seed(0)
|
| 64 |
+
Da, Ds, H, W = 76, 44, 48, 64
|
| 65 |
+
f = dict(FLASH_DEFAULTS, stride=a.stride)
|
| 66 |
+
cfg = PolicyConfig.from_dict(dict(policy='flash', n_cameras=2, state_dim=Ds, action_dim=Da, horizon=f['rows'],
|
| 67 |
+
**FLASH_POLICY_FIELDS, extra=dict(flash=f)))
|
| 68 |
+
ours = build_policy(cfg, pretrained=False).eval()
|
| 69 |
+
shape_meta = dict(obs=dict(ego_view=dict(shape=[3, H, W], type='rgb'), chest=dict(shape=[3, H, W], type='rgb'),
|
| 70 |
+
agent_pos=dict(shape=[Ds], type='low_dim')), action=dict(shape=[Da]))
|
| 71 |
+
enc = MultiImageObsEncoder(shape_meta=shape_meta, rgb_model=get_resnet('resnet18', weights=None),
|
| 72 |
+
resize_shape=None, crop_shape=None, random_crop=True, use_group_norm=True,
|
| 73 |
+
share_rgb_model=False, imagenet_norm=True)
|
| 74 |
+
up = FlashDiTImagePolicy(shape_meta=shape_meta, obs_encoder=enc, horizon=f['n_history'] + f['n_action'],
|
| 75 |
+
n_action_steps=f['n_action'], n_obs_steps=f['n_history'], num_inference_steps=1,
|
| 76 |
+
obs_as_global_cond=True, diffusion_step_embed_dim=256, hidden_dim=512, num_layers=4,
|
| 77 |
+
num_heads=8, mlp_ratio=4, dropout=0.0, poly_order=f['poly_order'], basis_type='legendre',
|
| 78 |
+
fit_pad=f['fit_pad'], boundary_constraint=f['boundary_constraint'],
|
| 79 |
+
history_noise_std=f['history_noise_std'], history_reg_lambda=f['history_reg_lambda'],
|
| 80 |
+
consistency_weight=f['consistency_weight'], flash_solver='euler',
|
| 81 |
+
poly_prefix=f['poly_prefix'], poly_suffix=f['poly_suffix']).eval()
|
| 82 |
+
res, tol = {}, {}
|
| 83 |
+
|
| 84 |
+
def diff(name, x, y, t):
|
| 85 |
+
res[name] = float((x.double() - y.double()).abs().max())
|
| 86 |
+
tol[name] = t
|
| 87 |
+
|
| 88 |
+
for b in ('_lstsq_matrix', '_coeff_scale', '_history_lstsq_matrix', '_bc_eval_pos', '_bc_eval_vel',
|
| 89 |
+
'_bc_correction'):
|
| 90 |
+
diff(b, getattr(ours, b), getattr(up, b), 1e-6)
|
| 91 |
+
res['_bc_pos_indices_equal'] = bool(torch.equal(ours._bc_pos_indices, up._bc_pos_indices))
|
| 92 |
+
|
| 93 |
+
# identity normalizers on both sides: compare the polynomial algebra itself
|
| 94 |
+
B = 6
|
| 95 |
+
traj = torch.randn(B, ours.H_ext, Da)
|
| 96 |
+
hist = torch.randn(B, f['n_history'], Da)
|
| 97 |
+
with torch.no_grad():
|
| 98 |
+
t_up = up._apply_boundary_constraint(up._trajectory_to_coefficients(traj), traj)
|
| 99 |
+
t_ours = ours._apply_boundary_constraint(ours._to_coeff(traj), traj)
|
| 100 |
+
diff('target_coeff', t_ours, t_up, 1e-4)
|
| 101 |
+
h_up = up._history_to_coefficients(hist)
|
| 102 |
+
h_ours = torch.einsum('ch,bhd->bcd', ours._history_lstsq_matrix, hist) / ours._coeff_scale
|
| 103 |
+
diff('history_coeff', h_ours, h_up, 1e-5)
|
| 104 |
+
|
| 105 |
+
# DiT: upstream weights into the port
|
| 106 |
+
dit_up = FlowTransformer(input_dim=Da, condition_dim=300, hidden_dim=512, output_dim=Da, num_layers=4,
|
| 107 |
+
num_heads=8, mlp_ratio=4, dropout=0.0, time_embed_dim=256).eval()
|
| 108 |
+
dit_ours = FlashFlowTransformer(input_dim=Da, condition_dim=300, hidden_dim=512, output_dim=Da, num_layers=4,
|
| 109 |
+
num_heads=8, mlp_ratio=4, dropout=0.0, time_embed_dim=256).eval()
|
| 110 |
+
dit_ours.load_state_dict(dit_up.state_dict(), strict=True)
|
| 111 |
+
x, t, c = torch.randn(B, ours.num_coeff, Da), torch.rand(B), torch.randn(B, 300)
|
| 112 |
+
diff('dit', dit_ours(x, t, c), dit_up(x, t, c), 1e-5)
|
| 113 |
+
|
| 114 |
+
# encoder: the port's ResNets into upstream's per-key models (sorted keys: chest, ego_view)
|
| 115 |
+
for i, cam in enumerate(('ego_view', 'chest')):
|
| 116 |
+
enc.key_model_map[cam].load_state_dict(ours.obs_encoder.rgb[i].state_dict(), strict=True)
|
| 117 |
+
imgs, state_n = torch.rand(B, 2, 3, H, W), torch.rand(B, Ds) * 2 - 1
|
| 118 |
+
f_ours = ours.obs_encoder(imgs, state_n)
|
| 119 |
+
f_up = enc({'ego_view': imgs[:, 0] * 2 - 1, 'chest': imgs[:, 1] * 2 - 1, 'agent_pos': state_n})
|
| 120 |
+
n = 512
|
| 121 |
+
f_up_reordered = torch.cat([f_up[:, n:2 * n], f_up[:, :n], f_up[:, 2 * n:]], dim=-1) # chest|ego -> ego|chest
|
| 122 |
+
diff('encoder', f_ours, f_up_reordered, 1e-4)
|
| 123 |
+
|
| 124 |
+
# 30 Hz rows from the anchor vs upstream's points: identity normalizer on ours
|
| 125 |
+
ours.action_norm.scale.fill_(1.0)
|
| 126 |
+
ours.action_norm.offset.zero_()
|
| 127 |
+
coeff = torch.randn(B, ours.num_coeff, Da)
|
| 128 |
+
dense = ours.dense_from_coeff(coeff)
|
| 129 |
+
sparse = up._coefficients_to_trajectory(coeff) # (B, H_poly, Da), anchor at up._anchor_idx
|
| 130 |
+
k = torch.arange(0, ours.rows, a.stride)
|
| 131 |
+
j = up._anchor_idx + k // a.stride
|
| 132 |
+
diff('dense_vs_upstream_points', dense[:, k], sparse[:, j], 1e-4)
|
| 133 |
+
bad = {k: v for k, v in res.items() if k in tol and v > tol[k]}
|
| 134 |
+
ok = not bad and res['_bc_pos_indices_equal']
|
| 135 |
+
print(json.dumps(dict(ok=ok, max_abs_diff=res, tolerance=tol, stride=a.stride,
|
| 136 |
+
upstream_anchor_idx=int(up._anchor_idx), port_anchor=int(ours.anchor))), flush=True)
|
| 137 |
+
sys.exit(0 if ok else 1)
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
if __name__ == '__main__':
|
| 141 |
+
main()
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/data.py
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Training data of the baselines: a task's LeRobot v2.1 expert dataset read through a robot contract.
|
| 2 |
+
|
| 3 |
+
A contract names the cameras and which dataset columns form the policy state and the action rows, the same layouts
|
| 4 |
+
the registered GR00T / Psi0 checkpoints were trained on:
|
| 5 |
+
|
| 6 |
+
- `g1_sonic_dfx6` (G1 + INSPIRE, the evaluation/README.md interface; ego_view, chest): state44 =
|
| 7 |
+
`observation.state[0:29]` body, measured `observation.inspire_{left,right}_hand_state`,
|
| 8 |
+
`observation.projected_gravity`; action76 (`sonic_dfx6`) = `action.motion_token` 64 and the measured DFX6 of the
|
| 9 |
+
same row (row 0 = the current opening);
|
| 10 |
+
- `h2_sharpa` (H2 + Sharpa, debug/newton/h2_sharpa_policy_eval.py; head, chest): state78 = `observation.state` 75,
|
| 11 |
+
`observation.projected_gravity` 3; action75 = `action.body_target` 31, `action.hands` 44 (absolute targets);
|
| 12 |
+
- `h2_sharpa_planner` (H2 + Sharpa a14 v2, h2_policy_planner_eval.py; head, chest): state78; action82 = action75 +
|
| 13 |
+
`action.planner` 7.
|
| 14 |
+
|
| 15 |
+
Frames: every camera's video is decoded once (PyAV), each frame resized with `resize_frame` (OpenCV INTER_AREA, the
|
| 16 |
+
same function the policy runtime applies to live frames) and stored as a uint8 memory map in a cache directory keyed by
|
| 17 |
+
the dataset, episodes, camera and size. A training sample is the frame t of an episode: the cameras and the state at t,
|
| 18 |
+
and the action rows t..t+horizon-1 (rows past the episode's end repeat its last row, as DextraVerse's windows).
|
| 19 |
+
"""
|
| 20 |
+
from __future__ import annotations
|
| 21 |
+
|
| 22 |
+
from dataclasses import dataclass
|
| 23 |
+
import hashlib
|
| 24 |
+
import json
|
| 25 |
+
import os
|
| 26 |
+
from pathlib import Path
|
| 27 |
+
import sys
|
| 28 |
+
|
| 29 |
+
import numpy as np
|
| 30 |
+
|
| 31 |
+
CACHE_VERSION = 1
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@dataclass(frozen=True)
|
| 35 |
+
class Contract:
|
| 36 |
+
name: str
|
| 37 |
+
robot: str
|
| 38 |
+
cameras: tuple
|
| 39 |
+
state: tuple # ((column, start, end), ...) concatenated in order
|
| 40 |
+
action: tuple
|
| 41 |
+
action_space: str | None = None # the G1 evaluation interface's action space, if any
|
| 42 |
+
body_dims: int = 0 # leading raw-radian body joint angles of the state (augmentation spec v2 perturbs these)
|
| 43 |
+
|
| 44 |
+
@property
|
| 45 |
+
def state_dim(self) -> int:
|
| 46 |
+
return sum(end - start for _, start, end in self.state)
|
| 47 |
+
|
| 48 |
+
@property
|
| 49 |
+
def action_dim(self) -> int:
|
| 50 |
+
return sum(end - start for _, start, end in self.action)
|
| 51 |
+
|
| 52 |
+
def to_dict(self, cameras=None) -> dict:
|
| 53 |
+
return dict(name=self.name, robot=self.robot, cameras=list(cameras or self.cameras),
|
| 54 |
+
state=[list(s) for s in self.state], action=[list(a) for a in self.action],
|
| 55 |
+
state_dim=self.state_dim, action_dim=self.action_dim, action_space=self.action_space,
|
| 56 |
+
body_dims=self.body_dims)
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
_G1_HANDS = (('observation.inspire_left_hand_state', 0, 6), ('observation.inspire_right_hand_state', 0, 6))
|
| 60 |
+
_H2_STATE = (('observation.state', 0, 75), ('observation.projected_gravity', 0, 3))
|
| 61 |
+
_H2_ACTION = (('action.body_target', 0, 31), ('action.hands', 0, 44))
|
| 62 |
+
# body_dims: G1 observation.state[0:29] are the 29 body joints; H2 observation.state[0:31] are legs 6+6, waist 3,
|
| 63 |
+
# head 2, arms 7+7 (docs/unitree_h2_sharpa.md), then the Sharpa hands.
|
| 64 |
+
CONTRACTS = {c.name: c for c in (
|
| 65 |
+
Contract('g1_sonic_dfx6', 'g1', ('ego_view', 'chest'),
|
| 66 |
+
(('observation.state', 0, 29), *_G1_HANDS, ('observation.projected_gravity', 0, 3)),
|
| 67 |
+
(('action.motion_token', 0, 64), *_G1_HANDS), action_space='sonic_dfx6', body_dims=29),
|
| 68 |
+
Contract('h2_sharpa', 'h2_sharpa', ('head', 'chest'), _H2_STATE, _H2_ACTION, body_dims=31),
|
| 69 |
+
Contract('h2_sharpa_planner', 'h2_sharpa', ('head', 'chest'), _H2_STATE,
|
| 70 |
+
(*_H2_ACTION, ('action.planner', 0, 7)), body_dims=31),
|
| 71 |
+
)}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def augmentation_module():
|
| 75 |
+
"""evaluation/augmentation: the augmentation spec v2 shared by every model's training (imported on demand)."""
|
| 76 |
+
evaluation = str(Path(__file__).resolve().parents[1])
|
| 77 |
+
if evaluation not in sys.path:
|
| 78 |
+
sys.path.insert(0, evaluation)
|
| 79 |
+
import augmentation
|
| 80 |
+
return augmentation
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def resize_frame(frame: np.ndarray, hw) -> np.ndarray:
|
| 84 |
+
"""(H, W, 3) uint8 RGB -> (h, w, 3) uint8, OpenCV INTER_AREA (training cache and live frames alike)."""
|
| 85 |
+
import cv2
|
| 86 |
+
frame = np.ascontiguousarray(frame, dtype=np.uint8)
|
| 87 |
+
if frame.ndim != 3 or frame.shape[2] != 3:
|
| 88 |
+
raise ValueError(f'expected an (H, W, 3) RGB frame, got {frame.shape}')
|
| 89 |
+
h, w = int(hw[0]), int(hw[1])
|
| 90 |
+
if frame.shape[:2] == (h, w):
|
| 91 |
+
return frame
|
| 92 |
+
return cv2.resize(frame, (w, h), interpolation=cv2.INTER_AREA)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
class LeRobotDataset:
|
| 96 |
+
"""A LeRobot v2.1 dataset directory (meta/info.json, meta/episodes.jsonl, data/, videos/)."""
|
| 97 |
+
|
| 98 |
+
def __init__(self, root):
|
| 99 |
+
self.root = Path(root).expanduser().resolve()
|
| 100 |
+
self.info = json.loads((self.root / 'meta/info.json').read_text())
|
| 101 |
+
if self.info.get('codebase_version') != 'v2.1':
|
| 102 |
+
raise ValueError(f"{self.root}: LeRobot {self.info.get('codebase_version')}, expected v2.1")
|
| 103 |
+
rows = [json.loads(line) for line in (self.root / 'meta/episodes.jsonl').read_text().splitlines() if line]
|
| 104 |
+
self.lengths = {int(r['episode_index']): int(r['length']) for r in rows}
|
| 105 |
+
tasks = [json.loads(line) for line in (self.root / 'meta/tasks.jsonl').read_text().splitlines() if line]
|
| 106 |
+
self.tasks = {int(t['task_index']): t['task'] for t in tasks}
|
| 107 |
+
self.fps = float(self.info['fps'])
|
| 108 |
+
|
| 109 |
+
@property
|
| 110 |
+
def name(self) -> str:
|
| 111 |
+
"""The dataset's folder name (its parent's for an export folder named `lerobot`)."""
|
| 112 |
+
return self.root.parent.name if self.root.name == 'lerobot' else self.root.name
|
| 113 |
+
|
| 114 |
+
def chunk(self, episode: int) -> int:
|
| 115 |
+
return episode // int(self.info['chunks_size'])
|
| 116 |
+
|
| 117 |
+
def parquet(self, episode: int) -> Path:
|
| 118 |
+
return self.root / self.info['data_path'].format(episode_chunk=self.chunk(episode), episode_index=episode)
|
| 119 |
+
|
| 120 |
+
def video(self, episode: int, camera: str) -> Path:
|
| 121 |
+
return self.root / self.info['video_path'].format(episode_chunk=self.chunk(episode), episode_index=episode,
|
| 122 |
+
video_key=f'observation.images.{camera}')
|
| 123 |
+
|
| 124 |
+
def check_contract(self, contract: Contract, cameras):
|
| 125 |
+
features = self.info['features']
|
| 126 |
+
for column, start, end in (*contract.state, *contract.action):
|
| 127 |
+
if column not in features:
|
| 128 |
+
raise KeyError(f'{self.root.name}: no column {column!r} (contract {contract.name})')
|
| 129 |
+
width = int(np.prod(features[column]['shape']))
|
| 130 |
+
if end > width:
|
| 131 |
+
raise ValueError(f'{column} has {width} values; the contract reads {start}:{end}')
|
| 132 |
+
for camera in cameras:
|
| 133 |
+
key = f'observation.images.{camera}'
|
| 134 |
+
if features.get(key, {}).get('dtype') != 'video':
|
| 135 |
+
raise KeyError(f'{self.root.name}: no video {key!r}')
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
def parse_episodes(spec: str | None, available) -> list:
|
| 139 |
+
"""'0:100', '0,3,7' or None (all), restricted to the dataset's episodes, sorted."""
|
| 140 |
+
available = sorted(available)
|
| 141 |
+
if not spec:
|
| 142 |
+
return available
|
| 143 |
+
chosen = set()
|
| 144 |
+
for part in spec.split(','):
|
| 145 |
+
if ':' in part:
|
| 146 |
+
lo, hi = part.split(':')
|
| 147 |
+
chosen.update(range(int(lo or 0), int(hi) if hi else available[-1] + 1))
|
| 148 |
+
else:
|
| 149 |
+
chosen.add(int(part))
|
| 150 |
+
missing = sorted(chosen - set(available))
|
| 151 |
+
if missing:
|
| 152 |
+
raise ValueError(f'episodes not in the dataset: {missing[:10]}')
|
| 153 |
+
return sorted(chosen)
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
def load_lowdim(dataset: LeRobotDataset, contract: Contract, episodes) -> dict:
|
| 157 |
+
"""State (N, state_dim) and action (N, action_dim) float32 of the episodes in order, plus each episode's start
|
| 158 |
+
row, length and task text."""
|
| 159 |
+
import pyarrow.parquet as pq
|
| 160 |
+
columns = sorted({c for c, _, _ in (*contract.state, *contract.action)} | {'frame_index', 'task_index'})
|
| 161 |
+
states, actions, starts, lengths, tasks, offset = [], [], [], [], set(), 0
|
| 162 |
+
for episode in episodes:
|
| 163 |
+
table = pq.read_table(dataset.parquet(episode), columns=columns)
|
| 164 |
+
data = {c: np.asarray(table.column(c).to_pylist(), dtype=np.float64) for c in columns}
|
| 165 |
+
n = len(data['frame_index'])
|
| 166 |
+
if n != dataset.lengths[episode] or not np.array_equal(data['frame_index'], np.arange(n)):
|
| 167 |
+
raise ValueError(f'episode {episode}: {n} rows / frame_index differ from episodes.jsonl')
|
| 168 |
+
|
| 169 |
+
def pick(spec):
|
| 170 |
+
return np.concatenate([data[c].reshape(n, -1)[:, s:e] for c, s, e in spec], axis=1).astype(np.float32)
|
| 171 |
+
|
| 172 |
+
states.append(pick(contract.state))
|
| 173 |
+
actions.append(pick(contract.action))
|
| 174 |
+
tasks.update(dataset.tasks[int(i)] for i in np.unique(data['task_index']))
|
| 175 |
+
starts.append(offset)
|
| 176 |
+
lengths.append(n)
|
| 177 |
+
offset += n
|
| 178 |
+
state, action = np.concatenate(states), np.concatenate(actions)
|
| 179 |
+
if not (np.isfinite(state).all() and np.isfinite(action).all()):
|
| 180 |
+
raise ValueError('non-finite state or action values')
|
| 181 |
+
return dict(state=state, action=action, starts=np.asarray(starts), lengths=np.asarray(lengths),
|
| 182 |
+
episodes=list(episodes), tasks=sorted(tasks))
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
def statistics(lowdim: dict, rows: np.ndarray, quantiles: bool = False) -> dict:
|
| 186 |
+
"""min / max / mean / std of state and action over `rows`; with `quantiles` also their q01 / q99 (the ODE
|
| 187 |
+
policies' normalization bounds, as ODE Policy's G1 port fits them)."""
|
| 188 |
+
out = {}
|
| 189 |
+
for key in ('state', 'action'):
|
| 190 |
+
x = lowdim[key][rows].astype(np.float64)
|
| 191 |
+
out[key] = dict(min=x.min(0).tolist(), max=x.max(0).tolist(), mean=x.mean(0).tolist(), std=x.std(0).tolist())
|
| 192 |
+
if quantiles:
|
| 193 |
+
q01, q99 = np.quantile(x, [0.01, 0.99], axis=0)
|
| 194 |
+
out[key].update(q01=q01.tolist(), q99=q99.tolist())
|
| 195 |
+
return out
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
# Columns recorded in physical [0, 1] (the INSPIRE DFX6 openings): the ODE policies normalize them with these fixed
|
| 199 |
+
# bounds instead of the data's, as ODE Policy's G1 port does.
|
| 200 |
+
UNIT_RANGE_COLUMNS = ('observation.inspire_left_hand_state', 'observation.inspire_right_hand_state')
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
def unit_range_dims(contract: Contract) -> dict:
|
| 204 |
+
"""{'state': [...], 'action': [...]}: the positions of the UNIT_RANGE_COLUMNS values in the contract's layouts."""
|
| 205 |
+
out = {}
|
| 206 |
+
for key, spec in (('state', contract.state), ('action', contract.action)):
|
| 207 |
+
dims, offset = [], 0
|
| 208 |
+
for column, start, end in spec:
|
| 209 |
+
if column in UNIT_RANGE_COLUMNS:
|
| 210 |
+
dims.extend(range(offset, offset + end - start))
|
| 211 |
+
offset += end - start
|
| 212 |
+
out[key] = dims
|
| 213 |
+
return out
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
# -- frame cache --------------------------------------------------------------------------------------------------
|
| 217 |
+
def _decode_into(job):
|
| 218 |
+
path, out_path, total, start, length, hw = job
|
| 219 |
+
import av
|
| 220 |
+
frames = np.memmap(out_path, dtype=np.uint8, mode='r+', shape=(total, hw[0], hw[1], 3))
|
| 221 |
+
count = 0
|
| 222 |
+
with av.open(str(path)) as container:
|
| 223 |
+
stream = container.streams.video[0]
|
| 224 |
+
stream.thread_type = 'AUTO'
|
| 225 |
+
for frame in container.decode(stream):
|
| 226 |
+
if count < length:
|
| 227 |
+
frames[start + count] = resize_frame(frame.to_ndarray(format='rgb24'), hw)
|
| 228 |
+
count += 1
|
| 229 |
+
frames.flush()
|
| 230 |
+
del frames
|
| 231 |
+
if count != length:
|
| 232 |
+
raise ValueError(f'{path}: {count} video frames, {length} data rows')
|
| 233 |
+
return length
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
def frame_cache(dataset: LeRobotDataset, lowdim: dict, cameras, hw, cache_root, workers=8) -> dict:
|
| 237 |
+
"""{camera: path of the (N, h, w, 3) uint8 memory map} for the episodes of `lowdim`, decoded once and reused."""
|
| 238 |
+
from multiprocessing import get_context
|
| 239 |
+
total = int(lowdim['lengths'].sum())
|
| 240 |
+
paths = {}
|
| 241 |
+
for camera in cameras:
|
| 242 |
+
key = json.dumps(dict(version=CACHE_VERSION, root=str(dataset.root), episodes=lowdim['episodes'],
|
| 243 |
+
lengths=lowdim['lengths'].tolist(), camera=camera, hw=list(hw)), sort_keys=True)
|
| 244 |
+
digest = hashlib.sha256(key.encode()).hexdigest()[:16]
|
| 245 |
+
folder = Path(cache_root).expanduser() / f'{dataset.name}_{camera}_{hw[0]}x{hw[1]}_{digest}'
|
| 246 |
+
folder.mkdir(parents=True, exist_ok=True)
|
| 247 |
+
out, meta = folder / 'frames.u8', folder / 'meta.json'
|
| 248 |
+
if meta.exists() and json.loads(meta.read_text()).get('complete'):
|
| 249 |
+
paths[camera] = out
|
| 250 |
+
continue
|
| 251 |
+
np.memmap(out, dtype=np.uint8, mode='w+', shape=(total, hw[0], hw[1], 3)).flush()
|
| 252 |
+
jobs = [(dataset.video(e, camera), out, total, int(s), int(n), tuple(hw))
|
| 253 |
+
for e, s, n in zip(lowdim['episodes'], lowdim['starts'], lowdim['lengths'])]
|
| 254 |
+
with get_context('spawn').Pool(max(1, int(workers))) as pool: # the caller may hold torch threads
|
| 255 |
+
for done, _ in enumerate(pool.imap_unordered(_decode_into, jobs), 1):
|
| 256 |
+
if done % 20 == 0 or done == len(jobs):
|
| 257 |
+
print(json.dumps(dict(event='frame_cache', camera=camera, episodes=done, of=len(jobs))),
|
| 258 |
+
flush=True)
|
| 259 |
+
meta.write_text(json.dumps(dict(json.loads(key), frames=total, complete=True), indent=1))
|
| 260 |
+
paths[camera] = out
|
| 261 |
+
return paths
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
class ChunkDataset:
|
| 265 |
+
"""torch-style dataset of (images (n_cameras, h, w, 3) uint8, state (state_dim,), action (horizon, action_dim))
|
| 266 |
+
over the frames of the selected episodes (positions into lowdim['episodes']). Memory maps open lazily per
|
| 267 |
+
process (DataLoader workers).
|
| 268 |
+
|
| 269 |
+
`body_dims` > 0 turns on the training augmentation (docs/augmentation_v2.md, evaluation/augmentation): per item,
|
| 270 |
+
the cached frames of all cameras get one hb_aug_v2.augment call (one time step, no future targets) and the first
|
| 271 |
+
`body_dims` state values the per-sample joint bias + noise; the action rows are never touched. 0 (evaluation,
|
| 272 |
+
offline checks) returns the cached frames and the recorded state unchanged, deterministically.
|
| 273 |
+
|
| 274 |
+
`lead` > 0 prepends that many rows before t to the action rows (lead + horizon rows, t-lead..t+horizon-1) and
|
| 275 |
+
adds a fourth item, the rows' validity (lead + horizon,) float: 0 for a row before the episode's first or past its
|
| 276 |
+
last (whose values repeat the nearest row); the ODE policies start from the row before t, or from their BOS where
|
| 277 |
+
it is invalid, and leave invalid future rows out of the loss (policies.ODEPolicy).
|
| 278 |
+
|
| 279 |
+
aug_seed (HumanWAM hb_training/REPRODUCIBILITY.md section 3; the training seed, `HB_AUG_SEED`): an item asked for
|
| 280 |
+
as (k, draw) (train.EpochSampler, 2026-11-27) is augmented with numpy default_rng([aug_seed, draw]), draw being its
|
| 281 |
+
position in the run's sample stream: the same seed and step give the same augmentations whatever the worker count
|
| 282 |
+
and across an interrupted run's --resume. A plain index k (the preflight) uses the per-worker stream
|
| 283 |
+
default_rng([aug_seed, torch.initial_seed(), worker id]) of the runs trained before; None the shared worker_rng
|
| 284 |
+
(pid + urandom: not reproducible)."""
|
| 285 |
+
|
| 286 |
+
def __init__(self, lowdim: dict, frames: dict, cameras, hw, horizon: int, positions, body_dims: int = 0,
|
| 287 |
+
lead: int = 0, aug_seed=None):
|
| 288 |
+
self.lowdim, self.paths, self.cameras, self.hw, self.horizon = lowdim, frames, list(cameras), tuple(hw), horizon
|
| 289 |
+
self.positions, self.body_dims, self.lead = list(positions), int(body_dims), int(lead)
|
| 290 |
+
self.aug_seed = aug_seed
|
| 291 |
+
self._rng_key, self._rng_obj = None, None
|
| 292 |
+
if self.body_dims:
|
| 293 |
+
augmentation_module() # asserts the spec version before any worker starts
|
| 294 |
+
self.total = int(lowdim['lengths'].sum())
|
| 295 |
+
index, begin, end = [], np.zeros(self.total, np.int64), np.zeros(self.total, np.int64)
|
| 296 |
+
for p in positions:
|
| 297 |
+
s, n = int(lowdim['starts'][p]), int(lowdim['lengths'][p])
|
| 298 |
+
index.append(np.arange(s, s + n))
|
| 299 |
+
begin[s:s + n] = s
|
| 300 |
+
end[s:s + n] = s + n
|
| 301 |
+
self.index, self.begin, self.end = np.concatenate(index), begin, end
|
| 302 |
+
self._maps, self._pid = None, None
|
| 303 |
+
|
| 304 |
+
def __len__(self):
|
| 305 |
+
return len(self.index)
|
| 306 |
+
|
| 307 |
+
def _frames(self):
|
| 308 |
+
if self._maps is None or self._pid != os.getpid():
|
| 309 |
+
self._maps = {c: np.memmap(self.paths[c], dtype=np.uint8, mode='r', shape=(self.total, *self.hw, 3))
|
| 310 |
+
for c in self.cameras}
|
| 311 |
+
self._pid = os.getpid()
|
| 312 |
+
return self._maps
|
| 313 |
+
|
| 314 |
+
def rows(self, i: int) -> np.ndarray:
|
| 315 |
+
return np.clip(np.arange(i - self.lead, i + self.horizon), self.begin[i], self.end[i] - 1)
|
| 316 |
+
|
| 317 |
+
def valid(self, i: int) -> np.ndarray:
|
| 318 |
+
rows = np.arange(i - self.lead, i + self.horizon)
|
| 319 |
+
return ((rows >= self.begin[i]) & (rows < self.end[i])).astype(np.float32)
|
| 320 |
+
|
| 321 |
+
def plain(self):
|
| 322 |
+
"""The same items without augmentation (the preflight's reference read)."""
|
| 323 |
+
return ChunkDataset(self.lowdim, self.paths, self.cameras, self.hw, self.horizon, self.positions,
|
| 324 |
+
lead=self.lead)
|
| 325 |
+
|
| 326 |
+
def _rng(self):
|
| 327 |
+
if self.aug_seed is None or not self.body_dims:
|
| 328 |
+
return None
|
| 329 |
+
import torch
|
| 330 |
+
info = torch.utils.data.get_worker_info()
|
| 331 |
+
wid = info.id if info is not None else 0
|
| 332 |
+
key = (os.getpid(), wid)
|
| 333 |
+
if self._rng_key != key:
|
| 334 |
+
self._rng_obj = np.random.default_rng([int(self.aug_seed), int(torch.initial_seed()), int(wid)])
|
| 335 |
+
self._rng_key = key
|
| 336 |
+
return self._rng_obj
|
| 337 |
+
|
| 338 |
+
def _key(self, k):
|
| 339 |
+
"""(item index, augmentation rng) of a sampler key: (k, draw) or a plain k (class docstring)."""
|
| 340 |
+
if isinstance(k, (tuple, list)):
|
| 341 |
+
k, draw = k
|
| 342 |
+
if self.aug_seed is not None and self.body_dims:
|
| 343 |
+
return int(k), np.random.default_rng([int(self.aug_seed), int(draw)])
|
| 344 |
+
return int(k), self._rng()
|
| 345 |
+
|
| 346 |
+
def _observation(self, i: int, rng=None):
|
| 347 |
+
"""The cameras (n_cameras, h, w, 3) uint8 and the state of frame i, augmented when body_dims > 0."""
|
| 348 |
+
import torch
|
| 349 |
+
maps = self._frames()
|
| 350 |
+
images = torch.from_numpy(np.stack([maps[c][i] for c in self.cameras]))
|
| 351 |
+
state = self.lowdim['state'][i]
|
| 352 |
+
if self.body_dims:
|
| 353 |
+
augmentation = augmentation_module()
|
| 354 |
+
images, _ = augmentation.augment_frames_uint8(images, rng=rng)
|
| 355 |
+
state = augmentation.perturb_body(state, self.body_dims, rng=rng)
|
| 356 |
+
return images, torch.from_numpy(np.asarray(state, dtype=np.float32))
|
| 357 |
+
|
| 358 |
+
def __getitem__(self, k):
|
| 359 |
+
import torch
|
| 360 |
+
k, rng = self._key(k)
|
| 361 |
+
i = int(self.index[k])
|
| 362 |
+
images, state = self._observation(i, rng=rng)
|
| 363 |
+
item = images, state, torch.from_numpy(self.lowdim['action'][self.rows(i)])
|
| 364 |
+
return (*item, torch.from_numpy(self.valid(i))) if self.lead else item
|
| 365 |
+
|
| 366 |
+
|
| 367 |
+
class FlashChunkDataset(ChunkDataset):
|
| 368 |
+
"""FLASH training items (evaluation/baselines/flash.py) over every frame of the selected episodes as the anchor:
|
| 369 |
+
(images, state, poly, history, has_history[, dense, dense_valid]).
|
| 370 |
+
|
| 371 |
+
- images, state: the anchor frame's cameras and state44, augmented as ChunkDataset (spec v2) when body_dims > 0;
|
| 372 |
+
- poly (H_ext, action_dim): the action rows at `offsets` frames from the anchor (the polynomial's extended grid,
|
| 373 |
+
`stride` frames apart), clamped to the episode (FLASH's edge padding);
|
| 374 |
+
- history (n_history, action_dim), has_history: flash.history_rows over the `span` executed rows before the anchor
|
| 375 |
+
(rows before the episode start invalid), the same function the adapter applies to past_actions;
|
| 376 |
+
- dense (rows, action_dim), dense_valid: the recorded 30 Hz rows from the anchor (offline check only).
|
| 377 |
+
|
| 378 |
+
aug_seed: as ChunkDataset (the same seeded stream)."""
|
| 379 |
+
|
| 380 |
+
def __init__(self, lowdim, frames, cameras, hw, positions, *, offsets, stride, n_history, rows, body_dims=0,
|
| 381 |
+
aug_seed=None, with_dense=False):
|
| 382 |
+
super().__init__(lowdim, frames, cameras, hw, rows, positions, body_dims=body_dims)
|
| 383 |
+
self.offsets = np.asarray(offsets, dtype=np.int64)
|
| 384 |
+
self.stride, self.n_history, self.n_rows = int(stride), int(n_history), int(rows)
|
| 385 |
+
self.span = (self.n_history - 1) * self.stride + 1
|
| 386 |
+
self.aug_seed, self.with_dense = aug_seed, bool(with_dense)
|
| 387 |
+
start = np.zeros(self.total, np.int64)
|
| 388 |
+
for p in positions:
|
| 389 |
+
s, n = int(lowdim['starts'][p]), int(lowdim['lengths'][p])
|
| 390 |
+
start[s:s + n] = s
|
| 391 |
+
self.start = start
|
| 392 |
+
|
| 393 |
+
def plain(self):
|
| 394 |
+
return FlashChunkDataset(self.lowdim, self.paths, self.cameras, self.hw, self.positions, offsets=self.offsets,
|
| 395 |
+
stride=self.stride, n_history=self.n_history, rows=self.n_rows,
|
| 396 |
+
with_dense=self.with_dense)
|
| 397 |
+
|
| 398 |
+
def __getitem__(self, k):
|
| 399 |
+
import torch
|
| 400 |
+
from .flash import history_rows
|
| 401 |
+
k, rng = self._key(k)
|
| 402 |
+
i = int(self.index[k])
|
| 403 |
+
s0, e1 = int(self.start[i]), int(self.end[i])
|
| 404 |
+
images, state = self._observation(i, rng=rng)
|
| 405 |
+
action = self.lowdim['action']
|
| 406 |
+
poly = action[np.clip(i + self.offsets, s0, e1 - 1)]
|
| 407 |
+
past = i - self.span + np.arange(self.span)
|
| 408 |
+
history, has = history_rows(action[np.maximum(past, s0)], past >= s0, self.stride, self.n_history)
|
| 409 |
+
out = [images, state, torch.from_numpy(np.ascontiguousarray(poly)), torch.from_numpy(history),
|
| 410 |
+
torch.tensor(bool(has))]
|
| 411 |
+
if self.with_dense:
|
| 412 |
+
idx = i + np.arange(self.n_rows)
|
| 413 |
+
out += [torch.from_numpy(np.ascontiguousarray(action[np.minimum(idx, e1 - 1)])),
|
| 414 |
+
torch.from_numpy(idx < e1)]
|
| 415 |
+
return tuple(out)
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/flash.py
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FLASH (Bai et al., "FLASH: Efficient Visuomotor Policy via Sparse Sampling", NeurIPS 2026) behind the baselines
|
| 2 |
+
contract: history-to-future polynomial flow matching with a DiT backbone and one Euler step at inference.
|
| 3 |
+
|
| 4 |
+
Ported from NTUMARS/FLASH-Policy @ f47e490 (Apache-2.0): `roboverse_learn/il/policies/flash/flash_policy.py`
|
| 5 |
+
(`FlashDiTImagePolicy`: basis, least-squares and Tikhonov history fits, KKT C1 boundary constraint, loss, sampler),
|
| 6 |
+
`utils/models/flow_net.py` + `policies/dp/models/diffusion/positional_embedding.py` (the DiT and its torchtune RoPE,
|
| 7 |
+
which differs from the DextraVerse RoPE of nets.py), `utils/vision/multi_image_obs_encoder.py` (one ResNet18 per
|
| 8 |
+
camera, GroupNorm, ImageNet normalization of the range-normalized image) and `configs/policy_config/flash.yaml` +
|
| 9 |
+
`configs/train_config/default_train.yaml` (the defaults below). Architecture, initialization and loss are unchanged.
|
| 10 |
+
|
| 11 |
+
What the humanoid interface changes (owner decisions 2026-11-24, recorded in every checkpoint's config):
|
| 12 |
+
|
| 13 |
+
- **Action space and history.** FLASH fits its flow start to the measured history of the action quantity (Franka
|
| 14 |
+
joint positions). The G1 action76 is the SONIC motion token (64, a latent with no measured counterpart) plus the
|
| 15 |
+
measured INSPIRE openings (12). The history is therefore the *executed* action rows - the token sent at each frame
|
| 16 |
+
and the opening measured at it, the interface's `past_actions` - ending one frame before the query (row t-1: the
|
| 17 |
+
token of frame t is what the policy is asked for). Training reads the same dataset rows. `n_history` points at the
|
| 18 |
+
sampling stride; rows before the episode start repeat its first row (FLASH's edge padding); with no row at all (the
|
| 19 |
+
episode's first frame) the flow starts from the zero coefficients, in training as at deployment.
|
| 20 |
+
- **Sampling stride.** The model's points are `stride` dataset frames apart (30 Hz data: stride 2 = 67 ms, the paper's
|
| 21 |
+
4 x 15 ms = 60 ms). Every dataset frame is an anchor (FLASH's converter keeps only every stride-th frame: one phase
|
| 22 |
+
of the same sparse data).
|
| 23 |
+
- **Observation.** The current ego_view and chest frames and state44 condition the DiT (n_obs 1); FLASH's 8-frame
|
| 24 |
+
observation history is not rendered by the benchmark runners. state44 is the low-dim encoder input as agent_pos is.
|
| 25 |
+
- **Output.** The polynomial is evaluated at every 30 Hz frame from the anchor (`rows` rows, row 0 = the query frame),
|
| 26 |
+
the analytic form of FLASH's continuous-time resampling, at exact frame times. FLASH's velocity feed-forward has no
|
| 27 |
+
channel in the interface (SONIC takes tokens) and is not produced.
|
| 28 |
+
- Polynomial fits run in float32 outside autocast (FLASH runs them inside its bf16 autocast); the encoder and the
|
| 29 |
+
DiT run under the trainer's bf16 autocast as upstream.
|
| 30 |
+
- Augmentation spec v2 replaces the native image augmentation (FLASH's random_crop is configured but inert without
|
| 31 |
+
crop_shape).
|
| 32 |
+
"""
|
| 33 |
+
from __future__ import annotations
|
| 34 |
+
|
| 35 |
+
import copy
|
| 36 |
+
|
| 37 |
+
import numpy as np
|
| 38 |
+
import torch
|
| 39 |
+
import torch.nn as nn
|
| 40 |
+
import torch.nn.functional as F
|
| 41 |
+
import torchvision
|
| 42 |
+
|
| 43 |
+
from .nets import IMAGENET_MEAN, IMAGENET_STD, Mlp, SinusoidalPosEmb, replace_batchnorm_with_groupnorm
|
| 44 |
+
|
| 45 |
+
# configs/policy_config/flash.yaml (+ default_runner.yaml horizon 16 / n_obs 8 / n_action 8), owner 2026-11-24 stride 2
|
| 46 |
+
FLASH_DEFAULTS = dict(stride=2, n_history=8, n_action=8, rows=16, poly_order=6, fit_pad=1, boundary_constraint=True,
|
| 47 |
+
poly_prefix=1, poly_suffix=1, history_noise_std=0.5, history_reg_lambda=0.1,
|
| 48 |
+
consistency_weight=1.0, solver='euler')
|
| 49 |
+
# PolicyConfig fields of a FLASH run (flash.yaml + default_train.yaml): DiT 512 x 4 x 8, dropout 0, time embedding
|
| 50 |
+
# 256, one inference step, ResNet18 from scratch with GroupNorm, one per camera
|
| 51 |
+
FLASH_POLICY_FIELDS = dict(hidden_dim=512, num_layers=4, num_heads=8, mlp_ratio=4.0, dropout=0.0, time_embed_dim=256,
|
| 52 |
+
num_inference_steps=1, backbone='resnet18', backbone_weights=None, backbone_norm='group')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def flash_settings(cfg) -> dict:
|
| 56 |
+
"""The FLASH settings of a PolicyConfig (cfg.extra['flash'] over the defaults); unknown keys are an error."""
|
| 57 |
+
given = dict((cfg.extra or {}).get('flash', {}))
|
| 58 |
+
unknown = sorted(set(given) - set(FLASH_DEFAULTS))
|
| 59 |
+
if unknown:
|
| 60 |
+
raise KeyError(f'unknown FLASH settings {unknown}; known: {sorted(FLASH_DEFAULTS)}')
|
| 61 |
+
out = dict(FLASH_DEFAULTS, **given)
|
| 62 |
+
if out['solver'] not in ('euler', 'midpoint'):
|
| 63 |
+
raise ValueError(f"solver {out['solver']!r}")
|
| 64 |
+
if out['poly_prefix'] is None or int(out['poly_prefix']) < 0:
|
| 65 |
+
raise ValueError('this port implements poly_prefix >= 0 (flash.yaml: 1)')
|
| 66 |
+
return out
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
# --- networks: utils/models/flow_net.py and positional_embedding.py of FLASH-Policy ------------------------------
|
| 70 |
+
class RotaryPosEmbFlash(nn.Module):
|
| 71 |
+
"""torchtune RoPE as FLASH builds it: `dim` = the model width, its dim/2 frequencies split over the heads, pairs
|
| 72 |
+
interleaved (x[..., 0::2], x[..., 1::2])."""
|
| 73 |
+
|
| 74 |
+
def __init__(self, dim: int, max_seq_len: int = 256, base: int = 10_000):
|
| 75 |
+
super().__init__()
|
| 76 |
+
self.dim, self.base, self.max_seq_len = dim, base, max_seq_len
|
| 77 |
+
theta = 1.0 / (base ** (torch.arange(0, dim, 2)[: (dim // 2)].float() / dim))
|
| 78 |
+
self.register_buffer('theta', theta, persistent=False)
|
| 79 |
+
seq_idx = torch.arange(max_seq_len, dtype=theta.dtype)
|
| 80 |
+
idx_theta = torch.einsum('i, j -> ij', seq_idx, theta).float()
|
| 81 |
+
self.register_buffer('cache', torch.stack([torch.cos(idx_theta), torch.sin(idx_theta)], dim=-1),
|
| 82 |
+
persistent=False)
|
| 83 |
+
|
| 84 |
+
def forward(self, x): # x: (B, heads, S, head_dim)
|
| 85 |
+
x = x.permute(0, 2, 1, 3)
|
| 86 |
+
B, S, heads, head_dim = x.size()
|
| 87 |
+
rope = self.cache[:S].view(1, S, heads, head_dim // 2, 2)
|
| 88 |
+
xs = x.float().reshape(*x.shape[:-1], head_dim // 2, 2)
|
| 89 |
+
out = torch.stack([xs[..., 0] * rope[..., 0] - xs[..., 1] * rope[..., 1],
|
| 90 |
+
xs[..., 1] * rope[..., 0] + xs[..., 0] * rope[..., 1]], -1)
|
| 91 |
+
return out.flatten(3).permute(0, 2, 1, 3).type_as(x)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
class FlashAttention(nn.Module):
|
| 95 |
+
def __init__(self, dim, num_heads=8, qkv_bias=True, attn_drop=0.0, proj_drop=0.0, max_seq_len=256, qk_norm=True):
|
| 96 |
+
super().__init__()
|
| 97 |
+
assert dim % num_heads == 0, 'dim should be divisible by num_heads'
|
| 98 |
+
self.num_heads, self.head_dim = num_heads, dim // num_heads
|
| 99 |
+
self.attn_drop = attn_drop
|
| 100 |
+
self.proj_drop = nn.Dropout(proj_drop)
|
| 101 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
| 102 |
+
self.q_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 103 |
+
self.k_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 104 |
+
self.proj = nn.Linear(dim, dim)
|
| 105 |
+
self.rope = RotaryPosEmbFlash(dim, max_seq_len=max_seq_len)
|
| 106 |
+
|
| 107 |
+
def forward(self, x):
|
| 108 |
+
B, S, C = x.shape
|
| 109 |
+
q, k, v = self.qkv(x).reshape(B, S, 3, self.num_heads, self.head_dim).permute(2, 0, 3, 1, 4).unbind(0)
|
| 110 |
+
q, k = self.rope(self.q_norm(q)), self.rope(self.k_norm(k))
|
| 111 |
+
x = F.scaled_dot_product_attention(q, k, v, dropout_p=self.attn_drop if self.training else 0.0)
|
| 112 |
+
return self.proj_drop(self.proj(x.transpose(1, 2).reshape(B, S, C)))
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
class FlashAdaLNBlock(nn.Module):
|
| 116 |
+
def __init__(self, dim, num_heads, mlp_ratio=4.0, dropout=0.0, max_seq_len=256):
|
| 117 |
+
super().__init__()
|
| 118 |
+
self.norm1 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 119 |
+
self.attn = FlashAttention(dim, num_heads=num_heads, attn_drop=dropout, proj_drop=dropout,
|
| 120 |
+
max_seq_len=max_seq_len)
|
| 121 |
+
self.norm2 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 122 |
+
self.mlp = Mlp(in_features=dim, hidden_features=int(dim * mlp_ratio),
|
| 123 |
+
act_layer=lambda: nn.GELU(approximate='tanh'), drop=0)
|
| 124 |
+
self.ada_ln = nn.Sequential(nn.SiLU(), nn.Linear(dim, 6 * dim))
|
| 125 |
+
self.dim = dim
|
| 126 |
+
nn.init.constant_(self.ada_ln[-1].weight, 0)
|
| 127 |
+
nn.init.constant_(self.ada_ln[-1].bias, 0)
|
| 128 |
+
|
| 129 |
+
def forward(self, x, t, c):
|
| 130 |
+
B = x.shape[0]
|
| 131 |
+
gamma1, gamma2, scale1, scale2, shift1, shift2 = self.ada_ln(F.silu(t + c)).view(B, 6, 1, self.dim).unbind(1)
|
| 132 |
+
x = x + self.attn(self.norm1(x).mul(scale1.add(1)).add_(shift1)).mul_(gamma1)
|
| 133 |
+
return x + self.mlp(self.norm2(x).mul(scale2.add(1)).add_(shift2)).mul_(gamma2)
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
class FlashFlowTransformer(nn.Module):
|
| 137 |
+
"""FLASH's FlowTransformer: AdaLN DiT over the C coefficient rows (tokens of width action_dim)."""
|
| 138 |
+
|
| 139 |
+
def __init__(self, input_dim, condition_dim, hidden_dim, output_dim, num_layers, num_heads, mlp_ratio=4.0,
|
| 140 |
+
dropout=0.1, time_embed_dim=256, max_seq_len=256):
|
| 141 |
+
super().__init__()
|
| 142 |
+
self.input_proj = nn.Linear(input_dim, hidden_dim)
|
| 143 |
+
self.time_embed = nn.Sequential(SinusoidalPosEmb(time_embed_dim), nn.Linear(time_embed_dim, time_embed_dim * 4),
|
| 144 |
+
nn.Mish(), nn.Linear(time_embed_dim * 4, hidden_dim))
|
| 145 |
+
self.cond_embed = nn.Linear(condition_dim, hidden_dim)
|
| 146 |
+
self.transformer_blocks = nn.ModuleList(
|
| 147 |
+
[FlashAdaLNBlock(hidden_dim, num_heads, mlp_ratio=mlp_ratio, dropout=dropout, max_seq_len=max_seq_len)
|
| 148 |
+
for _ in range(num_layers)])
|
| 149 |
+
self.norm = nn.LayerNorm(hidden_dim)
|
| 150 |
+
self.out_proj = nn.Linear(hidden_dim, output_dim)
|
| 151 |
+
|
| 152 |
+
def basic_init(module):
|
| 153 |
+
if isinstance(module, nn.Linear):
|
| 154 |
+
nn.init.xavier_uniform_(module.weight)
|
| 155 |
+
if module.bias is not None:
|
| 156 |
+
nn.init.constant_(module.bias, 0)
|
| 157 |
+
|
| 158 |
+
self.apply(basic_init)
|
| 159 |
+
nn.init.normal_(self.time_embed[1].weight, std=0.02)
|
| 160 |
+
nn.init.normal_(self.time_embed[3].weight, std=0.02)
|
| 161 |
+
|
| 162 |
+
def forward(self, x, t, global_cond):
|
| 163 |
+
if not torch.is_tensor(t):
|
| 164 |
+
t = torch.tensor(t, device=x.device)
|
| 165 |
+
if t.ndim == 0:
|
| 166 |
+
t = t.expand(x.shape[0])
|
| 167 |
+
x = self.input_proj(x)
|
| 168 |
+
t = self.time_embed(t)
|
| 169 |
+
c = self.cond_embed(global_cond)
|
| 170 |
+
for block in self.transformer_blocks:
|
| 171 |
+
x = block(x, t, c)
|
| 172 |
+
return self.out_proj(self.norm(x))
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
class FlashObsEncoder(nn.Module):
|
| 176 |
+
"""FLASH's MultiImageObsEncoder (share_rgb_model False, use_group_norm, imagenet_norm, no resize / crop): one
|
| 177 |
+
torchvision ResNet (classifier removed) per camera, every copy deep-copied from one initialization, BatchNorm
|
| 178 |
+
replaced by GroupNorm(C // 16) after the copy; each [0, 1] image goes through FLASH's range normalizer (x 2 - 1)
|
| 179 |
+
and then torchvision's ImageNet Normalize, as upstream composes them. Output: the cameras' pooled features in the
|
| 180 |
+
contract's camera order, then the normalized state. (B, n_cameras * 512 + state_dim)."""
|
| 181 |
+
|
| 182 |
+
def __init__(self, n_cameras, state_dim, backbone='resnet18', weights=None):
|
| 183 |
+
super().__init__()
|
| 184 |
+
base = getattr(torchvision.models, backbone)(weights=weights)
|
| 185 |
+
base.fc = nn.Identity()
|
| 186 |
+
self.rgb = nn.ModuleList([replace_batchnorm_with_groupnorm(copy.deepcopy(base)) for _ in range(n_cameras)])
|
| 187 |
+
self.n_cameras, self.state_dim = int(n_cameras), int(state_dim)
|
| 188 |
+
self.register_buffer('mean', torch.tensor(IMAGENET_MEAN).view(1, 3, 1, 1), persistent=False)
|
| 189 |
+
self.register_buffer('std', torch.tensor(IMAGENET_STD).view(1, 3, 1, 1), persistent=False)
|
| 190 |
+
self.feature_dim = self.n_cameras * (512 if backbone in ('resnet18', 'resnet34') else 2048) + self.state_dim
|
| 191 |
+
|
| 192 |
+
def forward(self, images, state):
|
| 193 |
+
"""images (B, n_cameras, 3, H, W) in [0, 1]; state (B, state_dim) normalized."""
|
| 194 |
+
x = images * 2.0 - 1.0 # get_image_range_normalizer: [0, 1] -> [-1, 1]
|
| 195 |
+
feats = [net((x[:, i] - self.mean) / self.std) for i, net in enumerate(self.rgb)]
|
| 196 |
+
return torch.cat([*feats, state], dim=-1)
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
# --- the policy ---------------------------------------------------------------------------------------------------
|
| 200 |
+
def legendre_basis(s: torch.Tensor, degree: int):
|
| 201 |
+
"""Shifted Legendre basis on s in [0, 1] and its first / second derivatives (FLASH's _build_legendre_basis)."""
|
| 202 |
+
x = 2 * s - 1
|
| 203 |
+
H, C = len(s), degree + 1
|
| 204 |
+
P = torch.zeros(H, C, dtype=s.dtype)
|
| 205 |
+
dP = torch.zeros(H, C, dtype=s.dtype)
|
| 206 |
+
d2P = torch.zeros(H, C, dtype=s.dtype)
|
| 207 |
+
P[:, 0] = 1.0
|
| 208 |
+
if C > 1:
|
| 209 |
+
P[:, 1] = x
|
| 210 |
+
dP[:, 1] = 1.0
|
| 211 |
+
for n in range(1, C - 1):
|
| 212 |
+
P[:, n + 1] = ((2 * n + 1) * x * P[:, n] - n * P[:, n - 1]) / (n + 1)
|
| 213 |
+
dP[:, n + 1] = ((2 * n + 1) * (P[:, n] + x * dP[:, n]) - n * dP[:, n - 1]) / (n + 1)
|
| 214 |
+
d2P[:, n + 1] = ((2 * n + 1) * (2 * dP[:, n] + x * d2P[:, n]) - n * d2P[:, n - 1]) / (n + 1)
|
| 215 |
+
return P, 2 * dP, 4 * d2P
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
def history_rows(rows, valid, stride: int, n_history: int):
|
| 219 |
+
"""The FLASH history of one query from its executed rows.
|
| 220 |
+
|
| 221 |
+
rows (N, D) and valid (N,): consecutive frames ending at the frame before the query (row N - 1 = t - 1), a valid
|
| 222 |
+
contiguous suffix (the interface's past_actions / history_valid; the dataset's rows before an anchor). Returns
|
| 223 |
+
(history (n_history, D) float32 at frames t-1-(n_history-1-j)*stride, has_history bool): a point before the first
|
| 224 |
+
valid row repeats that row (FLASH's edge padding); with no valid row has_history is False (zero start)."""
|
| 225 |
+
rows = np.asarray(rows, dtype=np.float32)
|
| 226 |
+
valid = np.asarray(valid, dtype=bool).reshape(-1)
|
| 227 |
+
span = (n_history - 1) * stride + 1
|
| 228 |
+
if len(rows) < span or len(valid) != len(rows):
|
| 229 |
+
raise ValueError(f'need >= {span} history rows (stride {stride} x {n_history} points), got {rows.shape}')
|
| 230 |
+
if not valid.any():
|
| 231 |
+
return np.zeros((n_history, rows.shape[1]), np.float32), False
|
| 232 |
+
first = int(np.argmax(valid))
|
| 233 |
+
if not valid[first:].all():
|
| 234 |
+
raise ValueError('history_valid must be a contiguous suffix')
|
| 235 |
+
idx = len(rows) - 1 - (n_history - 1 - np.arange(n_history)) * stride
|
| 236 |
+
return rows[np.maximum(idx, first)].copy(), True
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
class FlashPolicy(nn.Module):
|
| 240 |
+
"""FLASH (FlashDiTImagePolicy) on the baselines contract.
|
| 241 |
+
|
| 242 |
+
Training: compute_loss(images, state, poly, history, has_history) with poly (B, H_ext, Da) the physical action
|
| 243 |
+
rows at the polynomial's extended grid (anchor index fit_pad + poly_prefix, `stride` frames apart, clamped at the
|
| 244 |
+
episode's ends), history (B, n_history, Da) from history_rows. Inference: predict(images, state, history,
|
| 245 |
+
has_history) -> the physical (B, rows, Da) chunk at 30 Hz from the query frame, and the normalized coefficients."""
|
| 246 |
+
name = 'flash'
|
| 247 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 248 |
+
|
| 249 |
+
def __init__(self, cfg, init_weights=None):
|
| 250 |
+
super().__init__()
|
| 251 |
+
from .policies import Normalizer
|
| 252 |
+
self.cfg = cfg
|
| 253 |
+
self.state_norm = Normalizer(cfg.state_dim)
|
| 254 |
+
self.action_norm = Normalizer(cfg.action_dim)
|
| 255 |
+
f = self.flash = flash_settings(cfg)
|
| 256 |
+
self.stride, self.n_history, self.n_action = int(f['stride']), int(f['n_history']), int(f['n_action'])
|
| 257 |
+
self.rows, self.poly_order, self.fit_pad = int(f['rows']), int(f['poly_order']), int(f['fit_pad'])
|
| 258 |
+
self.prefix, self.suffix = int(f['poly_prefix']), int(f['poly_suffix'])
|
| 259 |
+
self.boundary_constraint = bool(f['boundary_constraint'])
|
| 260 |
+
self.history_noise_std = float(f['history_noise_std'])
|
| 261 |
+
self.history_reg_lambda = float(f['history_reg_lambda'])
|
| 262 |
+
self.consistency_weight = float(f['consistency_weight'])
|
| 263 |
+
self.solver = f['solver']
|
| 264 |
+
if cfg.horizon != self.rows:
|
| 265 |
+
raise ValueError(f'PolicyConfig.horizon {cfg.horizon} must equal the FLASH output rows {self.rows}')
|
| 266 |
+
C = self.num_coeff = self.poly_order + 1
|
| 267 |
+
H_poly = self.H_poly = self.prefix + self.n_action + self.suffix
|
| 268 |
+
H_ext = self.H_ext = H_poly + 2 * self.fit_pad
|
| 269 |
+
self.anchor = self.fit_pad + self.prefix # anchor index in the extended grid
|
| 270 |
+
last_dense = (self.rows - 1) / self.stride
|
| 271 |
+
if self.prefix + last_dense > H_poly - 1 + 1e-9:
|
| 272 |
+
raise ValueError(f'{self.rows} rows at stride {self.stride} reach past the fitted polynomial')
|
| 273 |
+
|
| 274 |
+
s_ext = torch.linspace(0.0, 1.0, H_ext, dtype=torch.float64)
|
| 275 |
+
s_mid = s_ext[self.fit_pad:self.fit_pad + H_poly] if self.fit_pad > 0 else s_ext
|
| 276 |
+
eval_ext, d1_ext, _ = legendre_basis(s_ext, self.poly_order)
|
| 277 |
+
StS = eval_ext.T @ eval_ext
|
| 278 |
+
lstsq = torch.linalg.solve(StS, eval_ext.T)
|
| 279 |
+
eval_mid, _, _ = legendre_basis(s_mid, self.poly_order)
|
| 280 |
+
coeff_scale = torch.norm(lstsq, dim=1).clamp(min=1e-8)
|
| 281 |
+
self.register_buffer('_lstsq_matrix', lstsq.float())
|
| 282 |
+
self.register_buffer('_coeff_scale', coeff_scale.float().view(1, -1, 1))
|
| 283 |
+
# history fit (flash_policy.py, poly_prefix branch): the first n_history rows of the core grid, Tikhonov
|
| 284 |
+
S_hist = eval_mid.double() if H_poly == self.n_history else eval_mid[:self.n_history, :].double()
|
| 285 |
+
StS_hist = S_hist.T @ S_hist
|
| 286 |
+
if self.history_reg_lambda > 0:
|
| 287 |
+
StS_hist = StS_hist + self.history_reg_lambda * torch.eye(C, dtype=torch.float64)
|
| 288 |
+
self.register_buffer('_history_lstsq_matrix', torch.linalg.solve(StS_hist, S_hist.T).float())
|
| 289 |
+
if self.boundary_constraint: # KKT C1 at the execution start and the next window's start
|
| 290 |
+
idx = [self.fit_pad + self.prefix, self.fit_pad + self.prefix + self.n_action]
|
| 291 |
+
if idx[1] >= H_ext:
|
| 292 |
+
raise ValueError(f'bc_overlap {idx[1]} >= H_ext {H_ext}: increase fit_pad')
|
| 293 |
+
A_pos, A_vel = eval_ext[idx, :], d1_ext[idx, :]
|
| 294 |
+
A = torch.cat([A_pos, A_vel], dim=0)
|
| 295 |
+
StS_inv_AT = torch.linalg.solve(StS, torch.eye(C, dtype=torch.float64)) @ A.T
|
| 296 |
+
self.register_buffer('_bc_eval_pos', A_pos.float())
|
| 297 |
+
self.register_buffer('_bc_eval_vel', A_vel.float())
|
| 298 |
+
self.register_buffer('_bc_correction', (StS_inv_AT @ torch.linalg.inv(A @ StS_inv_AT)).float())
|
| 299 |
+
self.register_buffer('_bc_pos_indices', torch.tensor(idx, dtype=torch.long))
|
| 300 |
+
# the 30 Hz output rows: frame k after the anchor sits at grid index anchor + k / stride
|
| 301 |
+
s_dense = torch.tensor([(self.anchor + k / self.stride) / (H_ext - 1) for k in range(self.rows)],
|
| 302 |
+
dtype=torch.float64)
|
| 303 |
+
self.register_buffer('_dense_eval_matrix', legendre_basis(s_dense, self.poly_order)[0].float())
|
| 304 |
+
|
| 305 |
+
self.obs_encoder = FlashObsEncoder(cfg.n_cameras, cfg.state_dim, backbone=cfg.backbone, weights=init_weights)
|
| 306 |
+
self.model = FlashFlowTransformer(input_dim=cfg.action_dim, condition_dim=self.obs_encoder.feature_dim,
|
| 307 |
+
hidden_dim=cfg.hidden_dim, output_dim=cfg.action_dim,
|
| 308 |
+
num_layers=cfg.num_layers, num_heads=cfg.num_heads, mlp_ratio=cfg.mlp_ratio,
|
| 309 |
+
dropout=cfg.dropout, time_embed_dim=cfg.time_embed_dim)
|
| 310 |
+
|
| 311 |
+
def fit_normalizers(self, stats: dict):
|
| 312 |
+
self.state_norm.fit(stats['state']['min'], stats['state']['max'])
|
| 313 |
+
self.action_norm.fit(stats['action']['min'], stats['action']['max'])
|
| 314 |
+
|
| 315 |
+
@property
|
| 316 |
+
def sampling_steps(self) -> int:
|
| 317 |
+
return int(self.cfg.num_inference_steps or 1)
|
| 318 |
+
|
| 319 |
+
@property
|
| 320 |
+
def history_span(self) -> int:
|
| 321 |
+
"""Executed rows a query needs: (n_history - 1) * stride + 1."""
|
| 322 |
+
return (self.n_history - 1) * self.stride + 1
|
| 323 |
+
|
| 324 |
+
def extended_offsets(self) -> np.ndarray:
|
| 325 |
+
"""Frame offsets from the anchor of the extended polynomial grid (for the training targets)."""
|
| 326 |
+
return (np.arange(self.H_ext) - self.anchor) * self.stride
|
| 327 |
+
|
| 328 |
+
# polynomial operations, float32 and outside autocast ----------------------------------------------------------
|
| 329 |
+
def _to_coeff(self, traj_n):
|
| 330 |
+
return torch.einsum('ch,bhd->bcd', self._lstsq_matrix, traj_n) / self._coeff_scale
|
| 331 |
+
|
| 332 |
+
def _history_coeff(self, history, has_history):
|
| 333 |
+
with torch.autocast(history.device.type, enabled=False):
|
| 334 |
+
h = torch.einsum('ch,bhd->bcd', self._history_lstsq_matrix, self.action_norm.normalize(history.float()))
|
| 335 |
+
h = h / self._coeff_scale
|
| 336 |
+
return torch.where(has_history.view(-1, 1, 1).bool(), h, torch.zeros_like(h))
|
| 337 |
+
|
| 338 |
+
def _apply_boundary_constraint(self, norm_coeff, traj_n):
|
| 339 |
+
raw = norm_coeff * self._coeff_scale
|
| 340 |
+
idx, H = self._bc_pos_indices, traj_n.shape[1]
|
| 341 |
+
cur_pos = torch.einsum('kc,bcd->bkd', self._bc_eval_pos, raw)
|
| 342 |
+
tgt_pos = traj_n[:, idx, :]
|
| 343 |
+
vel = []
|
| 344 |
+
for i in idx.tolist():
|
| 345 |
+
if i + 1 < H:
|
| 346 |
+
v = (traj_n[:, i + 1] - traj_n[:, i - 1]) * (H - 1) / 2
|
| 347 |
+
elif i >= 2:
|
| 348 |
+
v = (3 * traj_n[:, i] - 4 * traj_n[:, i - 1] + traj_n[:, i - 2]) * (H - 1) / 2
|
| 349 |
+
else:
|
| 350 |
+
v = (traj_n[:, i] - traj_n[:, i - 1]) * (H - 1)
|
| 351 |
+
vel.append(v)
|
| 352 |
+
tgt_vel = torch.stack(vel, dim=1)
|
| 353 |
+
cur_vel = torch.einsum('kc,bcd->bkd', self._bc_eval_vel, raw)
|
| 354 |
+
residual = torch.cat([cur_pos - tgt_pos, cur_vel - tgt_vel], dim=1)
|
| 355 |
+
return (raw - torch.einsum('ck,bkd->bcd', self._bc_correction, residual)) / self._coeff_scale
|
| 356 |
+
|
| 357 |
+
def target_coeff(self, poly):
|
| 358 |
+
with torch.autocast(poly.device.type, enabled=False):
|
| 359 |
+
traj_n = self.action_norm.normalize(poly.float())
|
| 360 |
+
coeff = self._to_coeff(traj_n)
|
| 361 |
+
if self.boundary_constraint:
|
| 362 |
+
coeff = self._apply_boundary_constraint(coeff, traj_n)
|
| 363 |
+
return coeff
|
| 364 |
+
|
| 365 |
+
def dense_from_coeff(self, norm_coeff):
|
| 366 |
+
"""(B, rows, Da) physical actions at the 30 Hz frames from the anchor."""
|
| 367 |
+
with torch.autocast(norm_coeff.device.type, enabled=False):
|
| 368 |
+
raw = norm_coeff.float() * self._coeff_scale
|
| 369 |
+
return self.action_norm.unnormalize(torch.einsum('hc,bcd->bhd', self._dense_eval_matrix, raw))
|
| 370 |
+
|
| 371 |
+
def condition(self, images, state):
|
| 372 |
+
return self.obs_encoder(images, self.state_norm.normalize(state))
|
| 373 |
+
|
| 374 |
+
# training and inference ------------------------------------------------------------------------------------------
|
| 375 |
+
def compute_loss(self, images, state, poly, history, has_history):
|
| 376 |
+
target = self.target_coeff(poly)
|
| 377 |
+
hist = self._history_coeff(history, has_history)
|
| 378 |
+
if self.training and self.history_noise_std > 0:
|
| 379 |
+
hist = hist + torch.randn_like(hist) * self.history_noise_std
|
| 380 |
+
cond = self.condition(images, state)
|
| 381 |
+
t = torch.rand(target.shape[0], device=target.device)
|
| 382 |
+
te = t.view(-1, 1, 1)
|
| 383 |
+
x_t = (1 - te) * hist + te * target
|
| 384 |
+
loss_fm = F.mse_loss(self.model(x_t, t, cond).float(), target - hist)
|
| 385 |
+
loss, metrics = loss_fm, dict(fm=float(loss_fm.detach()))
|
| 386 |
+
if self.consistency_weight > 0:
|
| 387 |
+
v0 = self.model(hist, torch.zeros_like(t), cond).float()
|
| 388 |
+
loss_c = F.mse_loss(hist + v0, target)
|
| 389 |
+
loss = loss + self.consistency_weight * loss_c
|
| 390 |
+
metrics['consistency'] = float(loss_c.detach())
|
| 391 |
+
return loss, metrics
|
| 392 |
+
|
| 393 |
+
@torch.no_grad()
|
| 394 |
+
def predict_coeff(self, images, state, history, has_history):
|
| 395 |
+
cond = self.condition(images, state)
|
| 396 |
+
x = self._history_coeff(history, has_history)
|
| 397 |
+
times = torch.linspace(0, 1.0, self.sampling_steps + 1)
|
| 398 |
+
for i in range(self.sampling_steps):
|
| 399 |
+
t0 = times[i].view(1).expand(x.shape[0]).to(x.device)
|
| 400 |
+
t1 = times[i + 1].view(1).expand(x.shape[0]).to(x.device)
|
| 401 |
+
dt = (t1 - t0).view(-1, 1, 1)
|
| 402 |
+
if self.solver == 'euler':
|
| 403 |
+
x = x + dt * self.model(x, t0, cond).float()
|
| 404 |
+
else:
|
| 405 |
+
x_mid = x + self.model(x, t0, cond).float() * dt / 2
|
| 406 |
+
x = x + dt * self.model(x_mid, t0 + (t1 - t0) / 2, cond).float()
|
| 407 |
+
return x
|
| 408 |
+
|
| 409 |
+
@torch.no_grad()
|
| 410 |
+
def predict(self, images, state, history, has_history, generator=None): # noqa: ARG002 - deterministic
|
| 411 |
+
coeff = self.predict_coeff(images, state, history, has_history)
|
| 412 |
+
return self.dense_from_coeff(coeff), coeff
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/fm_dit_v2.py
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FM-DiT v2: the flow-matching DiT of NTUMARS/FLASH-Policy @ f47e490 behind the baselines contract (owner 2026-11-25).
|
| 2 |
+
|
| 3 |
+
Not the `fm_dit` baseline of policies.py (FM-DiT v1, ported from DextraVerse's IL core), which stays unchanged for the
|
| 4 |
+
checkpoints trained with it. The owner asked for this second implementation after the v1 checkpoints reached 1 success
|
| 5 |
+
in all their closed-loop evaluations; if v2 scores higher under the same training and evaluation, v1 is retired.
|
| 6 |
+
|
| 7 |
+
Ported from `roboverse_learn/il/policies/fm/fm_dit_image_policy.py` (`FlowMatchingDiTImagePolicy`) with
|
| 8 |
+
`configs/policy_config/fm_dit.yaml` and `configs/train_config/default_train.yaml`, FLASH-Policy's own FM-DiT baseline.
|
| 9 |
+
Its network is FLASH's (flow_net.FlowTransformer with the torchtune RoPE, MultiImageObsEncoder), so this module
|
| 10 |
+
reuses flash.py's port of them; only the flow and the sampler differ from FLASH:
|
| 11 |
+
|
| 12 |
+
- loss: x_t = (1 - t) noise + t a with t ~ U(0, 1) and noise ~ N(0, I) over the whole normalized chunk; MSE of the
|
| 13 |
+
DiT's output against a - noise (obs_as_global_cond: no inpainting mask, every element counts);
|
| 14 |
+
- sampling: num_inference_steps 10 midpoint steps from noise (20 DiT calls), t = 0 -> 1;
|
| 15 |
+
- fm_dit.yaml: DiT 512 wide, 4 blocks, 8 heads, mlp ratio 4, dropout 0.1, time embedding 256; one ResNet18 per camera
|
| 16 |
+
from scratch with GroupNorm, ImageNet normalization of the range-normalized image; the state joins the image
|
| 17 |
+
features as the low-dim input (agent_pos), as in FLASH's encoder;
|
| 18 |
+
- default_train.yaml: seed 42, AdamW lr 1e-4 (betas 0.95 / 0.999, weight decay 1e-6), 500 warm-up steps then
|
| 19 |
+
diffusers' cosine, Diffusion Policy's EMAModel (power 0.75, max 0.9999), the encoder at the full learning rate
|
| 20 |
+
(train.py FM_DIT_V2_TRAINING).
|
| 21 |
+
|
| 22 |
+
What the humanoid interface changes, as for FLASH (flash.py, owner 2026-11-24/25: aligned with FLASH's port):
|
| 23 |
+
one observation frame (the current ego_view and chest frames and state44; the runners render no 8-frame history),
|
| 24 |
+
16 rows of action76 at 30 Hz from the query frame (row 0 = the query frame, the LeRobot rows t..t+15, as every
|
| 25 |
+
baseline), the augmentation spec v2 in place of the native random_crop (inert upstream without crop_shape), the
|
| 26 |
+
benchmark's batch 512 on one GPU. The runners re-query after at most 12 rows (FLASH-Policy executes 8 of 16).
|
| 27 |
+
"""
|
| 28 |
+
from __future__ import annotations
|
| 29 |
+
|
| 30 |
+
import torch
|
| 31 |
+
import torch.nn as nn
|
| 32 |
+
import torch.nn.functional as F
|
| 33 |
+
|
| 34 |
+
from .flash import FlashFlowTransformer, FlashObsEncoder
|
| 35 |
+
|
| 36 |
+
# fm_dit.yaml: the PolicyConfig fields of an FM-DiT v2 run
|
| 37 |
+
FM_DIT_V2_POLICY_FIELDS = dict(hidden_dim=512, num_layers=4, num_heads=8, mlp_ratio=4.0, dropout=0.1,
|
| 38 |
+
time_embed_dim=256, num_inference_steps=10, backbone='resnet18',
|
| 39 |
+
backbone_weights=None, backbone_norm='group')
|
| 40 |
+
UPSTREAM = 'NTUMARS/FLASH-Policy@f47e490 roboverse_learn/il/policies/fm/fm_dit_image_policy.py (fm_dit.yaml)'
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
class FMDiTv2Policy(nn.Module):
|
| 44 |
+
"""FLASH-Policy's FlowMatchingDiTImagePolicy on the baselines contract (module docstring). The policies.BasePolicy
|
| 45 |
+
contract (an nn.Module, as flash.FlashPolicy, so that policies.py can register it without an import cycle)."""
|
| 46 |
+
name = 'fm_dit_v2'
|
| 47 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 48 |
+
lead_rows = 0
|
| 49 |
+
|
| 50 |
+
def __init__(self, cfg, init_weights=None):
|
| 51 |
+
super().__init__()
|
| 52 |
+
from .policies import Normalizer
|
| 53 |
+
self.cfg = cfg
|
| 54 |
+
self.state_norm = Normalizer(cfg.state_dim)
|
| 55 |
+
self.action_norm = Normalizer(cfg.action_dim)
|
| 56 |
+
self.obs_encoder = FlashObsEncoder(cfg.n_cameras, cfg.state_dim, backbone=cfg.backbone, weights=init_weights)
|
| 57 |
+
# fm_dit_image_policy.py: max_seq_len = horizon (the RoPE cache covers the action tokens)
|
| 58 |
+
self.model = FlashFlowTransformer(input_dim=cfg.action_dim, condition_dim=self.obs_encoder.feature_dim,
|
| 59 |
+
hidden_dim=cfg.hidden_dim, output_dim=cfg.action_dim,
|
| 60 |
+
num_layers=cfg.num_layers, num_heads=cfg.num_heads,
|
| 61 |
+
mlp_ratio=cfg.mlp_ratio, dropout=cfg.dropout,
|
| 62 |
+
time_embed_dim=cfg.time_embed_dim, max_seq_len=cfg.horizon)
|
| 63 |
+
|
| 64 |
+
def fit_normalizers(self, stats: dict):
|
| 65 |
+
"""LinearNormalizer 'limits' (upstream's default): state and action min / max to [-1, 1]."""
|
| 66 |
+
self.state_norm.fit(stats['state']['min'], stats['state']['max'])
|
| 67 |
+
self.action_norm.fit(stats['action']['min'], stats['action']['max'])
|
| 68 |
+
|
| 69 |
+
@property
|
| 70 |
+
def sampling_steps(self) -> int:
|
| 71 |
+
return int(self.cfg.num_inference_steps or 10)
|
| 72 |
+
|
| 73 |
+
def condition(self, images, state):
|
| 74 |
+
return self.obs_encoder(images, self.state_norm.normalize(state))
|
| 75 |
+
|
| 76 |
+
def compute_loss(self, images, state, action):
|
| 77 |
+
cond = self.condition(images, state)
|
| 78 |
+
target = self.action_norm.normalize(action.float())
|
| 79 |
+
noise = torch.randn_like(target)
|
| 80 |
+
t = torch.rand(target.shape[0], device=target.device)
|
| 81 |
+
te = t.view(-1, 1, 1)
|
| 82 |
+
x_t = (1 - te) * noise + te * target
|
| 83 |
+
loss = F.mse_loss(self.model(x_t, t, cond).float(), target - noise)
|
| 84 |
+
return loss, dict(fm=float(loss.detach()))
|
| 85 |
+
|
| 86 |
+
@torch.no_grad()
|
| 87 |
+
def predict(self, images, state, generator=None):
|
| 88 |
+
cond = self.condition(images, state)
|
| 89 |
+
B, steps = images.shape[0], self.sampling_steps
|
| 90 |
+
x = torch.randn((B, self.cfg.horizon, self.cfg.action_dim), device=images.device, dtype=torch.float32,
|
| 91 |
+
generator=generator)
|
| 92 |
+
times = torch.linspace(0, 1.0, steps + 1)
|
| 93 |
+
for i in range(steps): # conditional_sample: the midpoint rule
|
| 94 |
+
t0 = times[i].view(1).expand(B).to(images.device)
|
| 95 |
+
t1 = times[i + 1].view(1).expand(B).to(images.device)
|
| 96 |
+
dt = (t1 - t0).view(-1, 1, 1)
|
| 97 |
+
x_mid = x + self.model(x, t0, cond).float() * dt / 2
|
| 98 |
+
x = x + dt * self.model(x_mid, t0 + (t1 - t0) / 2, cond).float()
|
| 99 |
+
return self.action_norm.unnormalize(x), x
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/inloop.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""In-training open-loop action MSE of the baselines (owner 2026-11-22: every training of every model measures it while
|
| 2 |
+
it trains; HumanWAM `hb_training/REPRODUCIBILITY.md` section 6).
|
| 3 |
+
|
| 4 |
+
The protocol code is HumanWAM's `hb_training/eval-action-mse` (`hb_inloop_core.InLoop` and `hb_eval_common`), used
|
| 5 |
+
unmodified from the directory given to train.py as --inloop-code; its cache lives under $HB_EVAL_CACHE (default
|
| 6 |
+
$G/eval-action-mse/cache) and is built by its `build_cache.py <task> train10`. Per evaluation: the queries every 16
|
| 7 |
+
frames of the task's `heldout` episodes (`train10` when it has none), the first 16 predicted rows against the
|
| 8 |
+
recorded ones, nMSE over the training-frame std (constant dims excluded), batches of 8 queries seeded
|
| 9 |
+
1234 + 1000 rank + batch index, every HB_INLOOP_EVERY (250) steps; one json line per evaluation in
|
| 10 |
+
<run>/logs/inloop-mse.jsonl and `HB_INLOOP` lines in the log. Training RNG and module modes are restored after each.
|
| 11 |
+
|
| 12 |
+
The evaluated weights are the ones the run saves (the EMA). Inputs as at deployment: each camera resized like the
|
| 13 |
+
training cache (data.resize_frame), state44, and for FLASH the cached past actions (the up to 16 recorded rows before
|
| 14 |
+
the query: the eval protocol's `past_action`) through the same history rule as the adapter (runtime.BaselinePolicy).
|
| 15 |
+
Before the first step the cache is checked against the run's data: the cached state and action rows of every cached
|
| 16 |
+
episode that the run loaded must equal the run's rows bit for bit.
|
| 17 |
+
"""
|
| 18 |
+
from __future__ import annotations
|
| 19 |
+
|
| 20 |
+
import os
|
| 21 |
+
from pathlib import Path
|
| 22 |
+
import sys
|
| 23 |
+
|
| 24 |
+
import numpy as np
|
| 25 |
+
|
| 26 |
+
from .data import resize_frame
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def install(code_dir, task, run_dir, get_model, contract, cameras, hw, lowdim, policy_name, lowdim_loader=None):
|
| 30 |
+
"""The InLoop object of this run (its evaluate(step, model) is called by train.py), after the cache check."""
|
| 31 |
+
code_dir = Path(code_dir).expanduser().resolve()
|
| 32 |
+
if not (code_dir / 'hb_inloop_core.py').exists():
|
| 33 |
+
raise FileNotFoundError(f'{code_dir}: no hb_inloop_core.py (HumanWAM hb_training/eval-action-mse)')
|
| 34 |
+
if str(code_dir) not in sys.path:
|
| 35 |
+
sys.path.insert(0, str(code_dir))
|
| 36 |
+
import hb_inloop_core as core
|
| 37 |
+
E = core.E
|
| 38 |
+
if core.EVERY <= 0:
|
| 39 |
+
print(f'HB_INLOOP {policy_name} disabled: HB_INLOOP_EVERY={core.EVERY}', flush=True)
|
| 40 |
+
return None
|
| 41 |
+
if task not in E.TASKS:
|
| 42 |
+
raise KeyError(f'task {task!r} is not registered in {code_dir}/hb_eval_common.py TASKS')
|
| 43 |
+
split = core.pick_split(task)
|
| 44 |
+
meta = E.load_meta(task, split)
|
| 45 |
+
lay = E.LAYOUTS[meta['layout']]
|
| 46 |
+
if (lay['state_dim'], lay['action_dim']) != (contract.state_dim, contract.action_dim):
|
| 47 |
+
raise ValueError(f"eval layout {meta['layout']} {lay['state_dim']}/{lay['action_dim']} vs contract "
|
| 48 |
+
f'{contract.name} {contract.state_dim}/{contract.action_dim}')
|
| 49 |
+
missing = [c for c in cameras if c not in meta['cams']]
|
| 50 |
+
if missing:
|
| 51 |
+
raise KeyError(f"cameras {missing} not in the eval cache {meta['cams']}")
|
| 52 |
+
def check(rows, what):
|
| 53 |
+
done = []
|
| 54 |
+
for ep in meta['episodes']: # the cache holds this run's data
|
| 55 |
+
if ep not in rows['episodes']:
|
| 56 |
+
continue
|
| 57 |
+
p = rows['episodes'].index(ep)
|
| 58 |
+
s, n = int(rows['starts'][p]), int(rows['lengths'][p])
|
| 59 |
+
with np.load(E.split_dir(task, split) / f'ep_{ep:06d}.npz') as z:
|
| 60 |
+
same = (np.array_equal(z['state'], rows['state'][s:s + n])
|
| 61 |
+
and np.array_equal(z['action'], rows['action'][s:s + n]))
|
| 62 |
+
if not same:
|
| 63 |
+
raise ValueError(f'eval cache {task}/{split} episode {ep} differs from {what} '
|
| 64 |
+
f'(cache source {meta.get("source")})')
|
| 65 |
+
done.append(ep)
|
| 66 |
+
return done
|
| 67 |
+
|
| 68 |
+
checked = check(lowdim, 'the training data')
|
| 69 |
+
if not checked and lowdim_loader is not None:
|
| 70 |
+
# a held-out split: its episodes are not trained on, so they are checked against the same dataset read
|
| 71 |
+
# through the same contract (2026-11-24, B7 black lead-drop b7td: train 0-99, held out 100-106)
|
| 72 |
+
checked = check(lowdim_loader(list(meta['episodes'])), "this run's dataset (held-out episodes)")
|
| 73 |
+
if not checked:
|
| 74 |
+
raise ValueError(f'no cached episode of {task}/{split} is in this run\'s data: cannot check the cache')
|
| 75 |
+
|
| 76 |
+
import torch
|
| 77 |
+
|
| 78 |
+
def predict(batch, seed):
|
| 79 |
+
model = get_model()
|
| 80 |
+
device = next(model.parameters()).device
|
| 81 |
+
frames = np.stack([np.stack([resize_frame(q['images'][c], hw) for c in cameras]) for q in batch])
|
| 82 |
+
images = torch.from_numpy(frames).to(device).permute(0, 1, 4, 2, 3).float().div_(255.)
|
| 83 |
+
state = torch.from_numpy(np.stack([q['state'] for q in batch]).astype(np.float32)).to(device)
|
| 84 |
+
generator = torch.Generator(device=device)
|
| 85 |
+
generator.manual_seed(int(seed))
|
| 86 |
+
extra = ()
|
| 87 |
+
if policy_name == 'flash':
|
| 88 |
+
from .flash import history_rows
|
| 89 |
+
span, hist, has = model.history_span, [], []
|
| 90 |
+
for q in batch:
|
| 91 |
+
past = np.asarray(q['past_action'], np.float32).reshape(-1, contract.action_dim)
|
| 92 |
+
rows = np.zeros((max(span, len(past)), contract.action_dim), np.float32)
|
| 93 |
+
valid = np.zeros(len(rows), bool)
|
| 94 |
+
if len(past):
|
| 95 |
+
rows[-len(past):], valid[-len(past):] = past, True
|
| 96 |
+
h, ok = history_rows(rows[-span:], valid[-span:], model.stride, model.n_history)
|
| 97 |
+
hist.append(h)
|
| 98 |
+
has.append(ok)
|
| 99 |
+
extra = (torch.from_numpy(np.stack(hist)).to(device), torch.tensor(has, device=device))
|
| 100 |
+
kwargs = {}
|
| 101 |
+
if getattr(model, 'lead_rows', 0): # the ODE policies start from the executed row before (BOS without one)
|
| 102 |
+
prev = [np.asarray(q.get('past_action', ()), np.float32).reshape(-1, contract.action_dim) for q in batch]
|
| 103 |
+
kwargs = dict(previous=torch.from_numpy(np.stack([p[-1] if len(p) else np.zeros(contract.action_dim,
|
| 104 |
+
np.float32)
|
| 105 |
+
for p in prev])).to(device),
|
| 106 |
+
has_previous=torch.tensor([len(p) > 0 for p in prev], device=device))
|
| 107 |
+
pred, _ = model.predict(images, state, *extra, generator=generator, **kwargs)
|
| 108 |
+
return pred.float().cpu().numpy()
|
| 109 |
+
|
| 110 |
+
info = dict(weights='ema', policy=policy_name, cache_checked_episodes=checked,
|
| 111 |
+
inloop_code=str(code_dir), cache=str(E.split_dir(task, split)))
|
| 112 |
+
loop = core.InLoop(policy_name, task, split, Path(run_dir) / 'logs' / 'inloop-mse.jsonl', predict,
|
| 113 |
+
cams=list(cameras), info=info)
|
| 114 |
+
loop.every = core.EVERY
|
| 115 |
+
loop.say(f'{policy_name} installed: task {task} split {split}, every {core.EVERY} steps, cache checked on '
|
| 116 |
+
f'episodes {checked}, code {code_dir}, G={os.environ.get("G", "<default>")}')
|
| 117 |
+
return loop
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/nets.py
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Networks of the FM-DiT and DP (DDPM-DiT) baselines: the AdaLN DiT action backbone and the camera + state encoder.
|
| 2 |
+
|
| 3 |
+
Ported from DextraVerse's imitation-learning core (`dextraverse/algorithms/il/models/nets/dit.py`, `layers.py`,
|
| 4 |
+
`positional_embedding.py`, `vision/backbones.py`, `vision/encoder.py`), unchanged in architecture and initialization.
|
| 5 |
+
Left out: the ROVE improvement embedding, the spatial-softmax / R3M / tactile options and the inpainting path (the
|
| 6 |
+
baselines always condition through the global observation feature). Added: the ResNet's normalization choice
|
| 7 |
+
(`get_resnet`): DextraVerse's GroupNorm for a backbone trained from scratch, or BatchNorm frozen at the pretrained
|
| 8 |
+
statistics (the DETR / ACT practice) for an ImageNet-initialized backbone that is fine-tuned with the policy.
|
| 9 |
+
"""
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import math
|
| 13 |
+
|
| 14 |
+
import torch
|
| 15 |
+
import torch.nn as nn
|
| 16 |
+
import torch.nn.functional as F
|
| 17 |
+
import torchvision
|
| 18 |
+
|
| 19 |
+
IMAGENET_MEAN = (0.485, 0.456, 0.406)
|
| 20 |
+
IMAGENET_STD = (0.229, 0.224, 0.225)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class SinusoidalPosEmb(nn.Module):
|
| 24 |
+
def __init__(self, dim):
|
| 25 |
+
super().__init__()
|
| 26 |
+
self.dim = dim
|
| 27 |
+
|
| 28 |
+
def forward(self, x):
|
| 29 |
+
half_dim = self.dim // 2
|
| 30 |
+
emb = math.log(10000) / (half_dim - 1)
|
| 31 |
+
emb = torch.exp(torch.arange(half_dim, device=x.device) * -emb)
|
| 32 |
+
emb = x[:, None] * emb[None, :]
|
| 33 |
+
return torch.cat((emb.sin(), emb.cos()), dim=-1)
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
class RotaryPosEmb(nn.Module):
|
| 37 |
+
"""Rotary position embedding over each attention head's (S, head_dim) slice."""
|
| 38 |
+
|
| 39 |
+
def __init__(self, dim):
|
| 40 |
+
super().__init__()
|
| 41 |
+
self.dim = dim
|
| 42 |
+
self.register_buffer('inv_freq', 1.0 / (10000 ** (torch.arange(0, dim, 2).float() / dim)))
|
| 43 |
+
|
| 44 |
+
def forward(self, x): # x: (B, heads, S, head_dim)
|
| 45 |
+
t = torch.arange(x.shape[-2], device=x.device, dtype=self.inv_freq.dtype)
|
| 46 |
+
freqs = torch.outer(t, self.inv_freq.to(x.device))
|
| 47 |
+
emb = torch.cat([freqs, freqs], dim=-1)
|
| 48 |
+
cos, sin = emb.cos()[None, None], emb.sin()[None, None]
|
| 49 |
+
x1, x2 = x[..., : x.shape[-1] // 2], x[..., x.shape[-1] // 2:]
|
| 50 |
+
return x * cos + torch.cat([-x2, x1], dim=-1) * sin
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
class Mlp(nn.Module):
|
| 54 |
+
"""The ViT MLP (timm.layers.Mlp) as DextraVerse's nets/layers.py."""
|
| 55 |
+
|
| 56 |
+
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0):
|
| 57 |
+
super().__init__()
|
| 58 |
+
out_features = out_features or in_features
|
| 59 |
+
hidden_features = hidden_features or in_features
|
| 60 |
+
self.fc1 = nn.Linear(in_features, hidden_features)
|
| 61 |
+
self.act = act_layer()
|
| 62 |
+
self.drop1 = nn.Dropout(drop)
|
| 63 |
+
self.norm = nn.Identity()
|
| 64 |
+
self.fc2 = nn.Linear(hidden_features, out_features)
|
| 65 |
+
self.drop2 = nn.Dropout(drop)
|
| 66 |
+
|
| 67 |
+
def forward(self, x):
|
| 68 |
+
return self.drop2(self.fc2(self.norm(self.drop1(self.act(self.fc1(x))))))
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
class Attention(nn.Module):
|
| 72 |
+
def __init__(self, dim, num_heads=8, qkv_bias=True, attn_drop=0.0, proj_drop=0.0, qk_norm=True):
|
| 73 |
+
super().__init__()
|
| 74 |
+
assert dim % num_heads == 0, 'dim should be divisible by num_heads'
|
| 75 |
+
self.num_heads = num_heads
|
| 76 |
+
self.head_dim = dim // num_heads
|
| 77 |
+
self.attn_drop = attn_drop
|
| 78 |
+
self.proj_drop = nn.Dropout(proj_drop)
|
| 79 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
| 80 |
+
self.q_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 81 |
+
self.k_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 82 |
+
self.proj = nn.Linear(dim, dim)
|
| 83 |
+
self.rope = RotaryPosEmb(self.head_dim)
|
| 84 |
+
|
| 85 |
+
def forward(self, x):
|
| 86 |
+
B, S, C = x.shape
|
| 87 |
+
qkv = self.qkv(x).reshape(B, S, 3, self.num_heads, self.head_dim).permute(2, 0, 3, 1, 4)
|
| 88 |
+
q, k, v = qkv.unbind(0)
|
| 89 |
+
q, k = self.rope(self.q_norm(q)), self.rope(self.k_norm(k))
|
| 90 |
+
x = F.scaled_dot_product_attention(q, k, v, dropout_p=self.attn_drop if self.training else 0.0)
|
| 91 |
+
return self.proj_drop(self.proj(x.transpose(1, 2).reshape(B, S, C)))
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
class AdaLNBlock(nn.Module):
|
| 95 |
+
"""Adaptive-LayerNorm transformer block as in DiT (Peebles et al. 2022)."""
|
| 96 |
+
|
| 97 |
+
def __init__(self, dim, num_heads, mlp_ratio=4.0, dropout=0.0):
|
| 98 |
+
super().__init__()
|
| 99 |
+
self.norm1 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 100 |
+
self.attn = Attention(dim, num_heads=num_heads, attn_drop=dropout, proj_drop=dropout)
|
| 101 |
+
self.norm2 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 102 |
+
self.mlp = Mlp(in_features=dim, hidden_features=int(dim * mlp_ratio),
|
| 103 |
+
act_layer=lambda: nn.GELU(approximate='tanh'), drop=0)
|
| 104 |
+
self.ada_ln = nn.Sequential(nn.SiLU(), nn.Linear(dim, 6 * dim))
|
| 105 |
+
self.dim = dim
|
| 106 |
+
nn.init.constant_(self.ada_ln[-1].weight, 0)
|
| 107 |
+
nn.init.constant_(self.ada_ln[-1].bias, 0)
|
| 108 |
+
|
| 109 |
+
def forward(self, x, t, c):
|
| 110 |
+
B = x.shape[0]
|
| 111 |
+
gamma1, gamma2, scale1, scale2, shift1, shift2 = self.ada_ln(F.silu(t + c)).view(B, 6, 1, self.dim).unbind(1)
|
| 112 |
+
x = x + self.attn(self.norm1(x).mul(scale1.add(1)).add_(shift1)).mul_(gamma1)
|
| 113 |
+
return x + self.mlp(self.norm2(x).mul(scale2.add(1)).add_(shift2)).mul_(gamma2)
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
class FlowTransformer(nn.Module):
|
| 117 |
+
"""DiT action backbone: AdaLN blocks over the H action tokens, conditioned on time_embed(t) + cond_embed(obs).
|
| 118 |
+
|
| 119 |
+
As DextraVerse, the generic Xavier initialization runs after the blocks' zero init of their AdaLN projection, so
|
| 120 |
+
it is not the full AdaLN-Zero recipe (kept: it is the reference's training behaviour)."""
|
| 121 |
+
|
| 122 |
+
def __init__(self, input_dim, condition_dim, hidden_dim, output_dim, num_layers, num_heads, mlp_ratio=4.0,
|
| 123 |
+
dropout=0.1, time_embed_dim=256):
|
| 124 |
+
super().__init__()
|
| 125 |
+
self.input_proj = nn.Linear(input_dim, hidden_dim)
|
| 126 |
+
self.time_embed = nn.Sequential(SinusoidalPosEmb(time_embed_dim), nn.Linear(time_embed_dim, time_embed_dim * 4),
|
| 127 |
+
nn.Mish(), nn.Linear(time_embed_dim * 4, hidden_dim))
|
| 128 |
+
self.cond_embed = nn.Linear(condition_dim, hidden_dim)
|
| 129 |
+
self.transformer_blocks = nn.ModuleList(
|
| 130 |
+
[AdaLNBlock(hidden_dim, num_heads, mlp_ratio=mlp_ratio, dropout=dropout) for _ in range(num_layers)])
|
| 131 |
+
self.norm = nn.LayerNorm(hidden_dim)
|
| 132 |
+
self.out_proj = nn.Linear(hidden_dim, output_dim)
|
| 133 |
+
|
| 134 |
+
def basic_init(module):
|
| 135 |
+
if isinstance(module, nn.Linear):
|
| 136 |
+
nn.init.xavier_uniform_(module.weight)
|
| 137 |
+
if module.bias is not None:
|
| 138 |
+
nn.init.constant_(module.bias, 0)
|
| 139 |
+
|
| 140 |
+
self.apply(basic_init)
|
| 141 |
+
nn.init.normal_(self.time_embed[1].weight, std=0.02)
|
| 142 |
+
nn.init.normal_(self.time_embed[3].weight, std=0.02)
|
| 143 |
+
|
| 144 |
+
def forward(self, x, t, global_cond):
|
| 145 |
+
if not torch.is_tensor(t):
|
| 146 |
+
t = torch.tensor(t, device=x.device)
|
| 147 |
+
if t.ndim == 0:
|
| 148 |
+
t = t.expand(x.shape[0])
|
| 149 |
+
x = self.input_proj(x)
|
| 150 |
+
t = self.time_embed(t)
|
| 151 |
+
c = self.cond_embed(global_cond)
|
| 152 |
+
for block in self.transformer_blocks:
|
| 153 |
+
x = block(x, t, c)
|
| 154 |
+
return self.out_proj(self.norm(x))
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
def replace_batchnorm_with_groupnorm(module: nn.Module) -> nn.Module:
|
| 158 |
+
"""DextraVerse's use_group_norm: every BatchNorm2d becomes GroupNorm(num_features // 16 groups)."""
|
| 159 |
+
for name, child in module.named_children():
|
| 160 |
+
if isinstance(child, nn.BatchNorm2d):
|
| 161 |
+
setattr(module, name, nn.GroupNorm(num_groups=child.num_features // 16, num_channels=child.num_features))
|
| 162 |
+
else:
|
| 163 |
+
replace_batchnorm_with_groupnorm(child)
|
| 164 |
+
return module
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
NORMS = ('group', 'frozen_bn')
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
def get_resnet(name='resnet18', weights=None, norm='group') -> nn.Module:
|
| 171 |
+
"""A torchvision ResNet with its classifier removed: (N, 3, H, W) -> (N, 512) globally pooled.
|
| 172 |
+
|
| 173 |
+
weights: torchvision weights name (e.g. 'IMAGENET1K_V1') to initialize from, or None (random initialization;
|
| 174 |
+
a checkpoint load supplies every weight). norm: 'group' replaces every BatchNorm with GroupNorm (DextraVerse's
|
| 175 |
+
use_group_norm, for training from scratch: pretrained BatchNorm statistics and affine are dropped); 'frozen_bn'
|
| 176 |
+
keeps BatchNorm frozen at its (pretrained) running statistics and affine, the convolutions fine-tune."""
|
| 177 |
+
if norm == 'frozen_bn':
|
| 178 |
+
from .act_nets import FrozenBatchNorm2d
|
| 179 |
+
resnet = getattr(torchvision.models, name)(weights=weights, norm_layer=FrozenBatchNorm2d)
|
| 180 |
+
elif norm == 'group':
|
| 181 |
+
resnet = replace_batchnorm_with_groupnorm(getattr(torchvision.models, name)(weights=weights))
|
| 182 |
+
else:
|
| 183 |
+
raise ValueError(f'norm must be one of {NORMS}, got {norm!r}')
|
| 184 |
+
resnet.fc = nn.Identity()
|
| 185 |
+
return resnet
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
class ImageStateEncoder(nn.Module):
|
| 189 |
+
"""DextraVerse MultiImageObsEncoder as configured for FM-DiT / DDPM-DiT: one ResNet shared by every camera
|
| 190 |
+
(share_rgb_model; `get_resnet` weights and norm), ImageNet normalization of the [0, 1] images, the pooled features
|
| 191 |
+
of each camera in the contract's camera order, then the normalized state. shared=False gives every camera its own
|
| 192 |
+
ResNet (share_rgb_model False, the ODE policy's encoder; `rgb` is then a ModuleList in camera order).
|
| 193 |
+
Output (B, n_cameras * 512 + state_dim)."""
|
| 194 |
+
|
| 195 |
+
def __init__(self, n_cameras, state_dim, backbone='resnet18', weights=None, norm='group', shared=True):
|
| 196 |
+
super().__init__()
|
| 197 |
+
self.n_cameras, self.state_dim, self.shared = int(n_cameras), int(state_dim), bool(shared)
|
| 198 |
+
self.rgb = (get_resnet(backbone, weights=weights, norm=norm) if self.shared else
|
| 199 |
+
nn.ModuleList([get_resnet(backbone, weights=weights, norm=norm) for _ in range(self.n_cameras)]))
|
| 200 |
+
self.register_buffer('mean', torch.tensor(IMAGENET_MEAN).view(1, 3, 1, 1), persistent=False)
|
| 201 |
+
self.register_buffer('std', torch.tensor(IMAGENET_STD).view(1, 3, 1, 1), persistent=False)
|
| 202 |
+
self.feature_dim = self.n_cameras * (512 if backbone in ('resnet18', 'resnet34') else 2048) + self.state_dim
|
| 203 |
+
|
| 204 |
+
def forward(self, images, state):
|
| 205 |
+
"""images (B, n_cameras, 3, H, W) in [0, 1]; state (B, state_dim) normalized."""
|
| 206 |
+
B = images.shape[0]
|
| 207 |
+
if self.shared:
|
| 208 |
+
x = (images.flatten(0, 1) - self.mean) / self.std
|
| 209 |
+
features = self.rgb(x).reshape(B, -1) # camera features side by side, in camera order
|
| 210 |
+
else:
|
| 211 |
+
features = torch.cat([net((images[:, i] - self.mean) / self.std) for i, net in enumerate(self.rgb)], dim=-1)
|
| 212 |
+
return torch.cat([features, state], dim=-1)
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/ode_nets.py
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Vector fields of the ODE policy baselines (ODE-MLP, ODE-DiT).
|
| 2 |
+
|
| 3 |
+
Ported from ODE Policy (Jindou Jia et al., https://github.com/NTUMARS/ODE-POLICY, branch main @cea26d94, Apache-2.0):
|
| 4 |
+
`ode_policy/policies/ode/ode_image_policy.py` (`_FiLMLayer`, `VectorField`, `DiTVectorField`) and the DiT parts it
|
| 5 |
+
uses, `ode_policy/utils/models/flow_net.py` (`Attention`, `AdaLNBlock`), `ode_policy/utils/models/layers.py` (`Mlp`)
|
| 6 |
+
and `ode_policy/policies/dp/models/diffusion/positional_embedding.py` (`RotaryPosEmb`, torchtune's interleaved RoPE
|
| 7 |
+
over the full width, which differs from the DextraVerse RoPE of nets.py). Architectures and initializations are
|
| 8 |
+
unchanged. Left out: the gripper-only dropout pass (`drop_first`; the benchmark's actions have no binary gripper).
|
| 9 |
+
|
| 10 |
+
Both fields are autonomous (no time input): f(a, s | c) depends only on where the action state `a` is, the
|
| 11 |
+
proprioception `s` (when the field reads it) and the per-chunk condition `c`; the output layer starts at zero, so an
|
| 12 |
+
untrained policy holds its start action.
|
| 13 |
+
"""
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import torch
|
| 17 |
+
import torch.nn as nn
|
| 18 |
+
import torch.nn.functional as F
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class FiLMLayer(nn.Module):
|
| 22 |
+
def __init__(self, dim, cond_dim):
|
| 23 |
+
super().__init__()
|
| 24 |
+
self.lin = nn.Linear(dim, dim)
|
| 25 |
+
self.film = nn.Linear(cond_dim, 2 * dim)
|
| 26 |
+
|
| 27 |
+
def forward(self, h, c=None, gb=None):
|
| 28 |
+
g, b = gb if gb is not None else self.film(c).chunk(2, dim=-1)
|
| 29 |
+
return h + F.silu(self.lin(h) * (1 + g) + b)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class VectorField(nn.Module):
|
| 33 |
+
"""ODE-MLP: f(a, s | c), a FiLM-modulated residual MLP. Training-only dropout on the hidden units keeps one mask
|
| 34 |
+
per sample for every field call until reset_dropout(), so a whole integrated chunk sees one thinned field."""
|
| 35 |
+
|
| 36 |
+
def __init__(self, cond_dim, state_dim, hidden_dim, num_layers, out_dim, pose_dim, dropout=0.0):
|
| 37 |
+
super().__init__()
|
| 38 |
+
self.dropout, self._masks = float(dropout), None
|
| 39 |
+
self.inp = nn.Linear(pose_dim + state_dim, hidden_dim)
|
| 40 |
+
self.layers = nn.ModuleList([FiLMLayer(hidden_dim, cond_dim) for _ in range(num_layers)])
|
| 41 |
+
self.out = nn.Linear(hidden_dim, out_dim)
|
| 42 |
+
self.feat_dim = hidden_dim
|
| 43 |
+
nn.init.zeros_(self.out.weight)
|
| 44 |
+
nn.init.zeros_(self.out.bias)
|
| 45 |
+
|
| 46 |
+
def precompute(self, c):
|
| 47 |
+
"""FiLM scale/shift depend on c only; computed once per integration."""
|
| 48 |
+
return [layer.film(c).chunk(2, dim=-1) for layer in self.layers]
|
| 49 |
+
|
| 50 |
+
def reset_dropout(self):
|
| 51 |
+
self._masks = None
|
| 52 |
+
|
| 53 |
+
def forward(self, a, s, c, film=None):
|
| 54 |
+
drop = self.training and self.dropout > 0
|
| 55 |
+
h = self.inp(torch.cat([a, s], dim=-1))
|
| 56 |
+
if drop and (self._masks is None or self._masks[0].shape != h.shape):
|
| 57 |
+
keep = 1.0 - self.dropout
|
| 58 |
+
self._masks = [torch.bernoulli(torch.full_like(h, keep)) / keep for _ in self.layers]
|
| 59 |
+
for i, layer in enumerate(self.layers):
|
| 60 |
+
h = layer(h, c, None if film is None else film[i])
|
| 61 |
+
if drop:
|
| 62 |
+
h = h * self._masks[i]
|
| 63 |
+
return self.out(h)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
class RotaryPosEmb(nn.Module):
|
| 67 |
+
"""Rotary positional embedding (torchtune), built over the full width `dim` and applied to the heads' slices."""
|
| 68 |
+
|
| 69 |
+
def __init__(self, dim: int, max_seq_len: int = 256, base: int = 10_000):
|
| 70 |
+
super().__init__()
|
| 71 |
+
self.dim, self.base, self.max_seq_len = dim, base, max_seq_len
|
| 72 |
+
theta = 1.0 / (base ** (torch.arange(0, dim, 2)[: (dim // 2)].float() / dim))
|
| 73 |
+
self.register_buffer('theta', theta, persistent=False)
|
| 74 |
+
seq_idx = torch.arange(max_seq_len, dtype=theta.dtype)
|
| 75 |
+
idx_theta = torch.einsum('i, j -> ij', seq_idx, theta).float()
|
| 76 |
+
self.register_buffer('cache', torch.stack([torch.cos(idx_theta), torch.sin(idx_theta)], dim=-1),
|
| 77 |
+
persistent=False)
|
| 78 |
+
|
| 79 |
+
def forward(self, x):
|
| 80 |
+
"""x (B, num_heads, S, head_dim) -> the same shape."""
|
| 81 |
+
x = x.permute(0, 2, 1, 3) # (B, S, num_heads, head_dim)
|
| 82 |
+
B, S, num_heads, head_dim = x.size()
|
| 83 |
+
rope_cache = self.cache[:S]
|
| 84 |
+
xshaped = x.float().reshape(*x.shape[:-1], head_dim // 2, 2)
|
| 85 |
+
rope_cache = rope_cache.view(1, S, num_heads, head_dim // 2, 2)
|
| 86 |
+
x_out = torch.stack([xshaped[..., 0] * rope_cache[..., 0] - xshaped[..., 1] * rope_cache[..., 1],
|
| 87 |
+
xshaped[..., 1] * rope_cache[..., 0] + xshaped[..., 0] * rope_cache[..., 1]], -1)
|
| 88 |
+
return x_out.flatten(3).permute(0, 2, 1, 3).type_as(x)
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
class Attention(nn.Module):
|
| 92 |
+
def __init__(self, dim, num_heads=8, qkv_bias=True, attn_drop=0., proj_drop=0., max_seq_len=64, qk_norm=True):
|
| 93 |
+
super().__init__()
|
| 94 |
+
assert dim % num_heads == 0, 'dim should be divisible by num_heads'
|
| 95 |
+
self.num_heads = num_heads
|
| 96 |
+
self.head_dim = dim // num_heads
|
| 97 |
+
self.attn_drop = attn_drop
|
| 98 |
+
self.proj_drop = nn.Dropout(proj_drop)
|
| 99 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
| 100 |
+
self.q_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 101 |
+
self.k_norm = nn.LayerNorm(self.head_dim) if qk_norm else nn.Identity()
|
| 102 |
+
self.proj = nn.Linear(dim, dim)
|
| 103 |
+
self.rope = RotaryPosEmb(dim, max_seq_len=max_seq_len)
|
| 104 |
+
|
| 105 |
+
def forward(self, x, mask=None):
|
| 106 |
+
B, S, C = x.shape
|
| 107 |
+
qkv = self.qkv(x).reshape(B, S, 3, self.num_heads, self.head_dim).permute(2, 0, 3, 1, 4)
|
| 108 |
+
q, k, v = qkv.unbind(0)
|
| 109 |
+
q, k = self.rope(self.q_norm(q)), self.rope(self.k_norm(k))
|
| 110 |
+
if self.training:
|
| 111 |
+
x = F.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=self.attn_drop)
|
| 112 |
+
else:
|
| 113 |
+
x = F.scaled_dot_product_attention(q, k, v)
|
| 114 |
+
return self.proj_drop(self.proj(x.transpose(1, 2).reshape(B, S, C)))
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
class Mlp(nn.Module):
|
| 118 |
+
"""The ViT MLP (timm.layers.Mlp) as ODE Policy's utils/models/layers.py, linear layers only."""
|
| 119 |
+
|
| 120 |
+
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
|
| 121 |
+
super().__init__()
|
| 122 |
+
out_features = out_features or in_features
|
| 123 |
+
hidden_features = hidden_features or in_features
|
| 124 |
+
self.fc1 = nn.Linear(in_features, hidden_features)
|
| 125 |
+
self.act = act_layer()
|
| 126 |
+
self.drop1 = nn.Dropout(drop)
|
| 127 |
+
self.norm = nn.Identity()
|
| 128 |
+
self.fc2 = nn.Linear(hidden_features, out_features)
|
| 129 |
+
self.drop2 = nn.Dropout(drop)
|
| 130 |
+
|
| 131 |
+
def forward(self, x):
|
| 132 |
+
return self.drop2(self.fc2(self.norm(self.drop1(self.act(self.fc1(x))))))
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
class AdaLNBlock(nn.Module):
|
| 136 |
+
"""Adaptive-LayerNorm transformer block as in DiT (Peebles et al. 2022); ada_ln starts at zero (adaLN-zero)."""
|
| 137 |
+
|
| 138 |
+
def __init__(self, dim, num_heads, mlp_ratio=4., dropout=0.):
|
| 139 |
+
super().__init__()
|
| 140 |
+
self.norm1 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 141 |
+
self.attn = Attention(dim, num_heads=num_heads, attn_drop=dropout, proj_drop=dropout)
|
| 142 |
+
self.norm2 = nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
|
| 143 |
+
self.mlp = Mlp(in_features=dim, hidden_features=int(dim * mlp_ratio),
|
| 144 |
+
act_layer=lambda: nn.GELU(approximate='tanh'), drop=0)
|
| 145 |
+
self.ada_ln = nn.Sequential(nn.SiLU(), nn.Linear(dim, 6 * dim))
|
| 146 |
+
self.dim = dim
|
| 147 |
+
nn.init.constant_(self.ada_ln[-1].weight, 0)
|
| 148 |
+
nn.init.constant_(self.ada_ln[-1].bias, 0)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
class DiTVectorField(nn.Module):
|
| 152 |
+
"""ODE-DiT: the vector field built from DiT blocks. [a, s] is projected to n_tokens tokens; every block's
|
| 153 |
+
LayerNorm scales/shifts/gates are regressed from the condition c (no time input: the field is autonomous); the
|
| 154 |
+
tokens are pooled for the output. Same interface and zero-initialized output as VectorField."""
|
| 155 |
+
|
| 156 |
+
def __init__(self, cond_dim, state_dim, hidden_dim, num_layers, out_dim, pose_dim, num_heads=8, n_tokens=4,
|
| 157 |
+
mlp_ratio=4.0):
|
| 158 |
+
super().__init__()
|
| 159 |
+
self.n_tokens, self.hidden_dim, self.feat_dim = n_tokens, hidden_dim, hidden_dim
|
| 160 |
+
self.inp = nn.Linear(pose_dim + state_dim, n_tokens * hidden_dim)
|
| 161 |
+
self.pos = nn.Parameter(torch.zeros(1, n_tokens, hidden_dim))
|
| 162 |
+
self.cond = nn.Linear(cond_dim, hidden_dim)
|
| 163 |
+
self.blocks = nn.ModuleList([AdaLNBlock(hidden_dim, num_heads, mlp_ratio) for _ in range(num_layers)])
|
| 164 |
+
self.norm = nn.LayerNorm(hidden_dim)
|
| 165 |
+
self.out = nn.Linear(hidden_dim, out_dim)
|
| 166 |
+
nn.init.zeros_(self.out.weight)
|
| 167 |
+
nn.init.zeros_(self.out.bias)
|
| 168 |
+
|
| 169 |
+
def precompute(self, c):
|
| 170 |
+
"""The adaLN scales/shifts/gates depend on c only: computed once per integration."""
|
| 171 |
+
cc = F.silu(self.cond(c))
|
| 172 |
+
return [blk.ada_ln(cc).view(c.shape[0], 6, 1, self.hidden_dim).unbind(1) for blk in self.blocks]
|
| 173 |
+
|
| 174 |
+
def forward(self, a, s, c, film=None):
|
| 175 |
+
B = a.shape[0]
|
| 176 |
+
x = self.inp(torch.cat([a, s], dim=-1)).view(B, self.n_tokens, self.hidden_dim) + self.pos
|
| 177 |
+
mods = self.precompute(c) if film is None else film
|
| 178 |
+
for blk, (g1, g2, sc1, sc2, sh1, sh2) in zip(self.blocks, mods):
|
| 179 |
+
x = x + blk.attn(blk.norm1(x) * (1 + sc1) + sh1) * g1
|
| 180 |
+
x = x + blk.mlp(blk.norm2(x) * (1 + sc2) + sh2) * g2
|
| 181 |
+
return self.out(self.norm(x).mean(dim=1))
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/policies.py
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The baseline policies behind one contract; the first three ported from DextraVerse's imitation-learning core:
|
| 2 |
+
|
| 3 |
+
- `fm_dit`, `FMDiTPolicy` (reference: dextraverse/algorithms/il/models/fm_dit.py + fm_base.py): flow matching, MSE on
|
| 4 |
+
the velocity `a - noise`; sampled with 10 midpoint steps from noise (20 DiT calls);
|
| 5 |
+
- `dp`, `DPPolicy` (ddpm_dit.py + ddpm_base.py: Diffusion Policy with a DiT backbone): DDPM epsilon MSE over 100
|
| 6 |
+
steps; sampled with the 100 DDPM steps;
|
| 7 |
+
- `act`, `ACTPolicy` (act.py + nets/act/): L1 + `kl_weight` x KL of the CVAE; decoded from the zero latent in one pass;
|
| 8 |
+
- `flash`, `flash.FlashPolicy` (NTUMARS/FLASH-Policy @ f47e490): polynomial-coefficient flow from the fitted history
|
| 9 |
+
of the executed actions to the future, one Euler step; its contract adds the history (flash.py's docstring).
|
| 10 |
+
- `fm_dit_v2`, `fm_dit_v2.FMDiTv2Policy` (FLASH-Policy @ f47e490's own FM-DiT, owner 2026-11-25): flow matching from
|
| 11 |
+
noise as `fm_dit`, on FLASH's networks (DiT 512, one from-scratch GroupNorm ResNet18 per camera) and recipe; a
|
| 12 |
+
separate entry: `fm_dit` (v1) keeps its checkpoints and behaviour (fm_dit_v2.py's docstring).
|
| 13 |
+
|
| 14 |
+
Two follow ODE Policy's G1 port (Jia et al., github.com/NTUMARS/ODE-POLICY branch real-g1 @fd8bec47, maintained in
|
| 15 |
+
HumanWAM as packages/ode_g1: model.py `SonicLatentODE`, data.py), with its GR00T backbone replaced by ODE Policy's own
|
| 16 |
+
image encoder (ode_policy main @cea26d94, ode.yaml), each in its authors' configuration (not aligned with the others):
|
| 17 |
+
|
| 18 |
+
- `ode_mlp`, `ODEPolicy`: the body part of the action (G1: the SONIC motion token) is an ODE state, db/dt =
|
| 19 |
+
f(b, s | c) with a FiLM residual MLP field, integrated with Euler one row per step from the body row executed at t-1;
|
| 20 |
+
the hands are decoded from c; masked MSE of the integrated path and the hands;
|
| 21 |
+
- `ode_dit`, `ODEDiTPolicy`: the same with ODE Policy's DiT (adaLN) field (ode_dit.yaml).
|
| 22 |
+
|
| 23 |
+
Contract (every policy): `compute_loss(images, state, action) -> (loss, metrics)` and
|
| 24 |
+
`predict(images, state, generator) -> (action, normalized action)`; images (B, n_cameras, 3, H, W) float in [0, 1],
|
| 25 |
+
state (B, state_dim) and action (B, lead_rows + horizon, action_dim) in physical units. Each policy owns its
|
| 26 |
+
`Normalizer` (DextraVerse's LinearNormalizer 'limits' mode: state and action to [-1, 1] per dimension, constant
|
| 27 |
+
dimensions shifted to 0), saved in its state dict. One observation frame (n_obs_steps 1: the current images and
|
| 28 |
+
state); the chunk's row 0 is the action of the observation's own frame (the LeRobot rows t..t+horizon-1). A policy
|
| 29 |
+
with `lead_rows` 1 (the ODE policies) also reads the row before, t-1, and the rows' validity (ChunkDataset `lead`),
|
| 30 |
+
and its `predict` takes `previous`, the action row executed at t-1. The ODE policies normalize with their own bounds
|
| 31 |
+
(q01 / q99, the DFX6 hands fixed at [0, 1], clipped to [-5, 5]). The configuration that builds a policy is a plain
|
| 32 |
+
dict (`PolicyConfig` fields), stored in the checkpoint.
|
| 33 |
+
|
| 34 |
+
The ResNet18 of FM-DiT, DP and ACT starts from torchvision's ImageNet-1k weights (`backbone_weights` 'IMAGENET1K_V1',
|
| 35 |
+
the default since 2026-11-16) and is fine-tuned with the policy, its BatchNorm frozen at the pretrained statistics
|
| 36 |
+
(`backbone_norm` 'frozen_bn', as ACT always does); `backbone_weights` None trains from scratch with DextraVerse's
|
| 37 |
+
GroupNorm encoder (FM-DiT, DP) or ACT's frozen-BatchNorm one. The ODE policies default to ODE Policy's encoder: one
|
| 38 |
+
ResNet18 per camera, from scratch, GroupNorm. A checkpoint load builds the structure without fetching any weights.
|
| 39 |
+
"""
|
| 40 |
+
from __future__ import annotations
|
| 41 |
+
|
| 42 |
+
from dataclasses import asdict, dataclass, field, replace
|
| 43 |
+
|
| 44 |
+
import torch
|
| 45 |
+
import torch.nn as nn
|
| 46 |
+
import torch.nn.functional as F
|
| 47 |
+
|
| 48 |
+
from .act_nets import DETRVAE, Transformer, build_backbone, build_style_encoder, kl_divergence
|
| 49 |
+
from .nets import IMAGENET_MEAN, IMAGENET_STD, FlowTransformer, ImageStateEncoder
|
| 50 |
+
from .ode_nets import DiTVectorField, VectorField
|
| 51 |
+
|
| 52 |
+
ODE_POLICIES = ('ode_mlp', 'ode_dit')
|
| 53 |
+
# Defaults that differ by policy. horizon and backbone_weights resolve in PolicyConfig; backbone_lr_scale (and amp)
|
| 54 |
+
# are the training script's. The ODE policies: 16-row chunks (the G1 port's H16; its deployment re-plans about 4 rows
|
| 55 |
+
# before a chunk ends, as the benchmark clients' query every 12 rows), ODE Policy's encoder from scratch at the full
|
| 56 |
+
# learning rate (ode.yaml, default_train.yaml). Mixed precision as the G1 port: the encoder under bf16 autocast, the
|
| 57 |
+
# ODE head in FP32.
|
| 58 |
+
# The training recipe of ODE Policy's default_train.yaml (the same NTUMARS trainer as FLASH's): seed 42, lr 1e-4 at
|
| 59 |
+
# the benchmark's batch 512 without batch scaling (as every model of the protocol, HumanWAM REPRODUCIBILITY.md
|
| 60 |
+
# section 4), 500-step warm-up then diffusers' cosine, Diffusion Policy's EMAModel as upstream counts it.
|
| 61 |
+
POLICY_DEFAULTS = {name: dict(horizon=16, backbone_weights=None, backbone_lr_scale=1.0, seed=42,
|
| 62 |
+
schedule='diffusers_cosine', ema_schedule='diffusion_policy_emamodel')
|
| 63 |
+
for name in ODE_POLICIES}
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@dataclass
|
| 67 |
+
class PolicyConfig:
|
| 68 |
+
"""Everything that builds a policy (stored in the checkpoint's config.json). Model defaults are DextraVerse's
|
| 69 |
+
configs/algorithm/il/model/{fm_dit,ddpm_dit,act}.yaml and, for the ODE policies (`ode_*` fields), ODE Policy's G1
|
| 70 |
+
port (HumanWAM packages/ode_g1 configs/g1.yaml `head`) and ode_dit.yaml for the DiT field."""
|
| 71 |
+
policy: str
|
| 72 |
+
n_cameras: int
|
| 73 |
+
state_dim: int
|
| 74 |
+
action_dim: int
|
| 75 |
+
horizon: int | None = None # None: the policy's default (POLICY_DEFAULTS, else 16)
|
| 76 |
+
backbone: str = 'resnet18'
|
| 77 |
+
# torchvision weights to initialize from; None = from scratch; 'default': IMAGENET1K_V1, the ODE policies None
|
| 78 |
+
backbone_weights: str | None = 'default'
|
| 79 |
+
backbone_norm: str | None = None # 'frozen_bn' or 'group'; None: frozen_bn when pretrained or ACT, else group
|
| 80 |
+
# FM-DiT / DP (DiT backbone)
|
| 81 |
+
hidden_dim: int = 384
|
| 82 |
+
num_layers: int = 4
|
| 83 |
+
num_heads: int = 8
|
| 84 |
+
mlp_ratio: float = 4.0
|
| 85 |
+
dropout: float = 0.1
|
| 86 |
+
time_embed_dim: int = 128
|
| 87 |
+
num_inference_steps: int | None = None # None: FM-DiT 10 midpoint steps, DP every training timestep (100)
|
| 88 |
+
# DP noise schedule (diffusers DDPMScheduler)
|
| 89 |
+
num_train_timesteps: int = 100
|
| 90 |
+
beta_schedule: str = 'squaredcos_cap_v2'
|
| 91 |
+
prediction_type: str = 'epsilon'
|
| 92 |
+
clip_sample: bool = True
|
| 93 |
+
# ACT
|
| 94 |
+
act_hidden_dim: int = 512
|
| 95 |
+
dim_feedforward: int = 3200
|
| 96 |
+
enc_layers: int = 4
|
| 97 |
+
dec_layers: int = 7
|
| 98 |
+
nheads: int = 8
|
| 99 |
+
latent_dim: int = 32
|
| 100 |
+
kl_weight: float = 10.0
|
| 101 |
+
# ODE policies (G1 port, configs/g1.yaml head: width 512, 4 FiLM layers, cond 512, field_scale 1). ode_body_dim:
|
| 102 |
+
# the leading action columns integrated as the ODE state, the rest decoded from the condition (G1: the token 64 and
|
| 103 |
+
# the DFX6 12; train.py sets it to the contract's first action group, H2: body_target 31). ODE-DiT: ODE Policy's
|
| 104 |
+
# DiT field, 512 wide, 4 blocks, 8 heads, 4 tokens (ode_dit.yaml).
|
| 105 |
+
ode_body_dim: int | None = None
|
| 106 |
+
ode_width: int = 512
|
| 107 |
+
ode_layers: int = 4
|
| 108 |
+
ode_cond_dim: int = 512
|
| 109 |
+
ode_field_scale: float = 1.0
|
| 110 |
+
ode_dit_hidden: int = 512
|
| 111 |
+
ode_dit_layers: int = 4
|
| 112 |
+
ode_dit_heads: int = 8
|
| 113 |
+
ode_dit_tokens: int = 4
|
| 114 |
+
extra: dict = field(default_factory=dict)
|
| 115 |
+
|
| 116 |
+
def __post_init__(self):
|
| 117 |
+
defaults = POLICY_DEFAULTS.get(self.policy, {})
|
| 118 |
+
if self.horizon is None:
|
| 119 |
+
self.horizon = int(defaults.get('horizon', 16))
|
| 120 |
+
if self.backbone_weights == 'default':
|
| 121 |
+
self.backbone_weights = defaults.get('backbone_weights', 'IMAGENET1K_V1')
|
| 122 |
+
if self.backbone_norm is None:
|
| 123 |
+
self.backbone_norm = 'frozen_bn' if self.backbone_weights or self.policy == 'act' else 'group'
|
| 124 |
+
if self.policy == 'act' and self.backbone_norm != 'frozen_bn':
|
| 125 |
+
raise ValueError("ACT's backbone keeps frozen BatchNorm (backbone_norm 'frozen_bn')")
|
| 126 |
+
|
| 127 |
+
@classmethod
|
| 128 |
+
def from_dict(cls, data: dict) -> PolicyConfig:
|
| 129 |
+
known = {k: v for k, v in data.items() if k in cls.__dataclass_fields__}
|
| 130 |
+
return cls(**known)
|
| 131 |
+
|
| 132 |
+
def to_dict(self) -> dict:
|
| 133 |
+
return asdict(self)
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
class Normalizer(nn.Module):
|
| 137 |
+
"""Per-dimension affine map to [-1, 1] from the training data's min/max (DextraVerse LinearNormalizer, mode
|
| 138 |
+
'limits', fit_offset, range_eps 1e-4): x_n = x * scale + offset; a dimension whose range is below range_eps gets
|
| 139 |
+
scale 1 and maps its value to 0."""
|
| 140 |
+
|
| 141 |
+
def __init__(self, dim: int):
|
| 142 |
+
super().__init__()
|
| 143 |
+
self.register_buffer('scale', torch.ones(dim))
|
| 144 |
+
self.register_buffer('offset', torch.zeros(dim))
|
| 145 |
+
|
| 146 |
+
@torch.no_grad()
|
| 147 |
+
def fit(self, minimum, maximum, range_eps=1e-4):
|
| 148 |
+
lo = torch.as_tensor(minimum, dtype=torch.float32)
|
| 149 |
+
hi = torch.as_tensor(maximum, dtype=torch.float32)
|
| 150 |
+
span = hi - lo
|
| 151 |
+
ignore = span < range_eps
|
| 152 |
+
span[ignore] = 2.0
|
| 153 |
+
scale = 2.0 / span
|
| 154 |
+
offset = -1.0 - scale * lo
|
| 155 |
+
offset[ignore] = -lo[ignore]
|
| 156 |
+
self.scale.copy_(scale)
|
| 157 |
+
self.offset.copy_(offset)
|
| 158 |
+
|
| 159 |
+
def normalize(self, x):
|
| 160 |
+
return x * self.scale + self.offset
|
| 161 |
+
|
| 162 |
+
def unnormalize(self, x):
|
| 163 |
+
return (x - self.offset) / self.scale
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
class BasePolicy(nn.Module):
|
| 167 |
+
name = ''
|
| 168 |
+
backbone_prefix = '' # state-dict prefix of the image backbone (its own learning rate in training)
|
| 169 |
+
lead_rows = 0 # action rows before the observation's frame that a training item carries (ODE: 1, the start)
|
| 170 |
+
|
| 171 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 172 |
+
super().__init__()
|
| 173 |
+
self.cfg = cfg
|
| 174 |
+
self.state_norm = Normalizer(cfg.state_dim)
|
| 175 |
+
self.action_norm = Normalizer(cfg.action_dim)
|
| 176 |
+
|
| 177 |
+
def fit_normalizers(self, stats: dict):
|
| 178 |
+
self.state_norm.fit(stats['state']['min'], stats['state']['max'])
|
| 179 |
+
self.action_norm.fit(stats['action']['min'], stats['action']['max'])
|
| 180 |
+
|
| 181 |
+
@property
|
| 182 |
+
def sampling_steps(self) -> int:
|
| 183 |
+
return 1
|
| 184 |
+
|
| 185 |
+
def compute_loss(self, images, state, action):
|
| 186 |
+
raise NotImplementedError
|
| 187 |
+
|
| 188 |
+
def predict(self, images, state, generator=None):
|
| 189 |
+
raise NotImplementedError
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
class DiTPolicy(BasePolicy):
|
| 193 |
+
"""Shared by FM-DiT and DP: the shared-ResNet image + state encoder and the AdaLN DiT over the action chunk
|
| 194 |
+
(global observation conditioning, DextraVerse obs_as_global_cond)."""
|
| 195 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 196 |
+
|
| 197 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 198 |
+
super().__init__(cfg)
|
| 199 |
+
self.obs_encoder = ImageStateEncoder(cfg.n_cameras, cfg.state_dim, backbone=cfg.backbone,
|
| 200 |
+
weights=init_weights, norm=cfg.backbone_norm)
|
| 201 |
+
self.model = FlowTransformer(input_dim=cfg.action_dim, condition_dim=self.obs_encoder.feature_dim,
|
| 202 |
+
hidden_dim=cfg.hidden_dim, output_dim=cfg.action_dim, num_layers=cfg.num_layers,
|
| 203 |
+
num_heads=cfg.num_heads, mlp_ratio=cfg.mlp_ratio, dropout=cfg.dropout,
|
| 204 |
+
time_embed_dim=cfg.time_embed_dim)
|
| 205 |
+
|
| 206 |
+
def condition(self, images, state):
|
| 207 |
+
return self.obs_encoder(images, self.state_norm.normalize(state))
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
class FMDiTPolicy(DiTPolicy):
|
| 211 |
+
"""Flow-matching DiT (DextraVerse FlowMatchingDiTImagePolicy): x_t = (1 - t) noise + t a, t ~ U(0, 1), the DiT
|
| 212 |
+
regresses the velocity a - noise; sampling integrates t = 0 -> 1 with the midpoint rule."""
|
| 213 |
+
name = 'fm_dit'
|
| 214 |
+
|
| 215 |
+
@property
|
| 216 |
+
def sampling_steps(self) -> int:
|
| 217 |
+
return int(self.cfg.num_inference_steps or 10)
|
| 218 |
+
|
| 219 |
+
def compute_loss(self, images, state, action):
|
| 220 |
+
cond = self.condition(images, state)
|
| 221 |
+
target = self.action_norm.normalize(action)
|
| 222 |
+
noise = torch.randn_like(target)
|
| 223 |
+
t = torch.rand(target.shape[0], device=target.device)
|
| 224 |
+
te = t.view(-1, 1, 1)
|
| 225 |
+
x_t = (1 - te) * noise + te * target
|
| 226 |
+
loss = F.mse_loss(self.model(x_t, t, cond), target - noise)
|
| 227 |
+
return loss, dict(fm=float(loss.detach()))
|
| 228 |
+
|
| 229 |
+
@torch.no_grad()
|
| 230 |
+
def predict(self, images, state, generator=None):
|
| 231 |
+
cond = self.condition(images, state)
|
| 232 |
+
B, steps = images.shape[0], self.sampling_steps
|
| 233 |
+
x = torch.randn((B, self.cfg.horizon, self.cfg.action_dim), device=cond.device, dtype=cond.dtype,
|
| 234 |
+
generator=generator)
|
| 235 |
+
times = torch.linspace(0, 1.0, steps + 1, device=cond.device)
|
| 236 |
+
for i in range(steps):
|
| 237 |
+
t0 = times[i].view(1).expand(B)
|
| 238 |
+
t1 = times[i + 1].view(1).expand(B)
|
| 239 |
+
dt = (t1 - t0).view(-1, 1, 1)
|
| 240 |
+
x_mid = x + self.model(x, t0, cond) * dt / 2
|
| 241 |
+
x = x + dt * self.model(x_mid, t0 + (t1 - t0) / 2, cond)
|
| 242 |
+
return self.action_norm.unnormalize(x), x
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
class DPPolicy(DiTPolicy):
|
| 246 |
+
"""Diffusion Policy with the DiT backbone (DextraVerse DiffusionDiTImagePolicy, ddpm_dit.yaml): DDPM with 100
|
| 247 |
+
training steps, squaredcos_cap_v2 betas, fixed_small variance, clipped samples, epsilon prediction; sampled with
|
| 248 |
+
every training step (100 DiT calls)."""
|
| 249 |
+
name = 'dp'
|
| 250 |
+
|
| 251 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 252 |
+
super().__init__(cfg, init_weights)
|
| 253 |
+
from diffusers.schedulers.scheduling_ddpm import DDPMScheduler
|
| 254 |
+
self.noise_scheduler = DDPMScheduler(num_train_timesteps=cfg.num_train_timesteps, beta_start=0.0001,
|
| 255 |
+
beta_end=0.02, beta_schedule=cfg.beta_schedule,
|
| 256 |
+
variance_type='fixed_small', clip_sample=cfg.clip_sample,
|
| 257 |
+
prediction_type=cfg.prediction_type)
|
| 258 |
+
|
| 259 |
+
@property
|
| 260 |
+
def sampling_steps(self) -> int:
|
| 261 |
+
return int(self.cfg.num_inference_steps or self.cfg.num_train_timesteps)
|
| 262 |
+
|
| 263 |
+
def compute_loss(self, images, state, action):
|
| 264 |
+
cond = self.condition(images, state)
|
| 265 |
+
target = self.action_norm.normalize(action)
|
| 266 |
+
noise = torch.randn_like(target)
|
| 267 |
+
t = torch.randint(0, self.noise_scheduler.config.num_train_timesteps, (target.shape[0],),
|
| 268 |
+
device=target.device).long()
|
| 269 |
+
noisy = self.noise_scheduler.add_noise(target, noise, t)
|
| 270 |
+
pred = self.model(noisy, t, cond)
|
| 271 |
+
goal = noise if self.cfg.prediction_type == 'epsilon' else target
|
| 272 |
+
loss = F.mse_loss(pred, goal)
|
| 273 |
+
return loss, dict(ddpm=float(loss.detach()))
|
| 274 |
+
|
| 275 |
+
@torch.no_grad()
|
| 276 |
+
def predict(self, images, state, generator=None):
|
| 277 |
+
cond = self.condition(images, state)
|
| 278 |
+
scheduler = self.noise_scheduler
|
| 279 |
+
x = torch.randn((images.shape[0], self.cfg.horizon, self.cfg.action_dim), device=cond.device,
|
| 280 |
+
dtype=cond.dtype, generator=generator)
|
| 281 |
+
scheduler.set_timesteps(self.sampling_steps, device=cond.device)
|
| 282 |
+
for t in scheduler.timesteps:
|
| 283 |
+
x = scheduler.step(self.model(x, t.to(cond.device), cond), t, x, generator=generator).prev_sample
|
| 284 |
+
return self.action_norm.unnormalize(x), x
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
class ACTPolicy(BasePolicy):
|
| 288 |
+
"""ACT (DextraVerse ACTImagePolicy, act.yaml): ImageNet-normalized cameras through one ResNet with frozen
|
| 289 |
+
BatchNorm (spatial tokens, no pooling), the normalized state as qpos, a CVAE style encoder over the action chunk in
|
| 290 |
+
training, the DETR decoder with `horizon` queries; loss L1 + kl_weight x KL; inference decodes from the zero
|
| 291 |
+
latent (deterministic)."""
|
| 292 |
+
name = 'act'
|
| 293 |
+
backbone_prefix = 'model.backbone.'
|
| 294 |
+
|
| 295 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 296 |
+
super().__init__(cfg)
|
| 297 |
+
transformer = Transformer(d_model=cfg.act_hidden_dim, nhead=cfg.nheads, num_encoder_layers=cfg.enc_layers,
|
| 298 |
+
num_decoder_layers=cfg.dec_layers, dim_feedforward=cfg.dim_feedforward,
|
| 299 |
+
dropout=cfg.dropout, return_intermediate_dec=False)
|
| 300 |
+
self.model = DETRVAE(build_backbone(cfg.backbone, hidden_dim=cfg.act_hidden_dim, weights=init_weights),
|
| 301 |
+
transformer,
|
| 302 |
+
build_style_encoder(cfg.act_hidden_dim, cfg.nheads, cfg.dim_feedforward, cfg.enc_layers,
|
| 303 |
+
cfg.dropout),
|
| 304 |
+
qpos_dim=cfg.state_dim, action_dim=cfg.action_dim, num_queries=cfg.horizon,
|
| 305 |
+
latent_dim=cfg.latent_dim)
|
| 306 |
+
self.register_buffer('mean', torch.tensor(IMAGENET_MEAN).view(1, 1, 3, 1, 1), persistent=False)
|
| 307 |
+
self.register_buffer('std', torch.tensor(IMAGENET_STD).view(1, 1, 3, 1, 1), persistent=False)
|
| 308 |
+
|
| 309 |
+
def compute_loss(self, images, state, action):
|
| 310 |
+
target = self.action_norm.normalize(action)
|
| 311 |
+
a_hat, (mu, logvar) = self.model(self.state_norm.normalize(state), (images - self.mean) / self.std,
|
| 312 |
+
actions=target)
|
| 313 |
+
l1 = F.l1_loss(a_hat, target)
|
| 314 |
+
kl = kl_divergence(mu, logvar)
|
| 315 |
+
return l1 + self.cfg.kl_weight * kl, dict(l1=float(l1.detach()), kl=float(kl.detach()))
|
| 316 |
+
|
| 317 |
+
@torch.no_grad()
|
| 318 |
+
def predict(self, images, state, generator=None): # noqa: ARG002 - deterministic (zero latent)
|
| 319 |
+
a_hat, _ = self.model(self.state_norm.normalize(state), (images - self.mean) / self.std)
|
| 320 |
+
return self.action_norm.unnormalize(a_hat), a_hat
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
class ODEPolicy(BasePolicy):
|
| 324 |
+
"""ODE policy as ODE Policy's G1 port (`SonicLatentODE`): the body part b of the action row (the first
|
| 325 |
+
ode_body_dim columns; G1 the SONIC motion token 64) is integrated with Euler, one row per unit of time,
|
| 326 |
+
b_{k+1} = b_k + field_scale * f(b_k, s | c), from b_0 = the body row before the chunk; the remaining columns (G1:
|
| 327 |
+
the measured DFX6 12) are decoded from c for every row (linear, SiLU, linear; continuous, no sigmoid). c =
|
| 328 |
+
Linear(LayerNorm(image features)): one ResNet18 per view (ODE Policy's encoder, in place of the G1 port's GR00T
|
| 329 |
+
reader); the state enters the field only, never the condition or the hands.
|
| 330 |
+
|
| 331 |
+
Normalization (the G1 port's): per-dimension q01 / q99 of the training rows to [-1, 1], the UNIT_RANGE columns
|
| 332 |
+
(DFX6) fixed at [0, 1], constant dimensions shifted to 0, clipped to [-5, 5]; the executed body row at inference is
|
| 333 |
+
not clipped (a carried endpoint may leave the interval). Start: training teacher-forces b_0 = the recorded body row
|
| 334 |
+
t-1, the normalized-zero BOS at an episode's first frame; execution starts from the body part of the row executed
|
| 335 |
+
at t-1 (the interface's past_actions[-1]), BOS without one. Loss: masked MSE in normalized units (rows past the
|
| 336 |
+
episode's end left out), body and hands weighted by their widths. The ODE head runs in FP32 (the encoder under the
|
| 337 |
+
caller's autocast). Deterministic; no start perturbation (the G1 port's)."""
|
| 338 |
+
name = 'ode_mlp'
|
| 339 |
+
field_arch = 'mlp'
|
| 340 |
+
backbone_prefix = 'obs_encoder.rgb.'
|
| 341 |
+
lead_rows = 1
|
| 342 |
+
CLIP = 5.0
|
| 343 |
+
|
| 344 |
+
def __init__(self, cfg: PolicyConfig, init_weights=None):
|
| 345 |
+
super().__init__(cfg)
|
| 346 |
+
if cfg.ode_body_dim is None or not 0 < cfg.ode_body_dim <= cfg.action_dim:
|
| 347 |
+
raise ValueError(f'ode_body_dim must be in 1..{cfg.action_dim}, got {cfg.ode_body_dim}')
|
| 348 |
+
body, hands = cfg.ode_body_dim, cfg.action_dim - cfg.ode_body_dim
|
| 349 |
+
self.obs_encoder = ImageStateEncoder(cfg.n_cameras, 0, backbone=cfg.backbone, weights=init_weights,
|
| 350 |
+
norm=cfg.backbone_norm, shared=False) # images only
|
| 351 |
+
self.context_norm = nn.LayerNorm(self.obs_encoder.feature_dim)
|
| 352 |
+
self.context_proj = nn.Linear(self.obs_encoder.feature_dim, cfg.ode_cond_dim)
|
| 353 |
+
if self.field_arch == 'dit':
|
| 354 |
+
self.field = DiTVectorField(cfg.ode_cond_dim, cfg.state_dim, cfg.ode_dit_hidden, cfg.ode_dit_layers, body,
|
| 355 |
+
body, num_heads=cfg.ode_dit_heads, n_tokens=cfg.ode_dit_tokens)
|
| 356 |
+
else:
|
| 357 |
+
self.field = VectorField(cfg.ode_cond_dim, cfg.state_dim, cfg.ode_width, cfg.ode_layers, body, body)
|
| 358 |
+
self.hand_hidden = nn.Linear(cfg.ode_cond_dim, cfg.ode_cond_dim)
|
| 359 |
+
self.hand_output = nn.Linear(cfg.ode_cond_dim, cfg.horizon * hands) if hands else None
|
| 360 |
+
|
| 361 |
+
def fit_normalizers(self, stats: dict):
|
| 362 |
+
"""The G1 port's bounds: q01 / q99 (from stats, else min / max), the stats' unit_dims fixed at [0, 1]."""
|
| 363 |
+
for key, norm in (('state', self.state_norm), ('action', self.action_norm)):
|
| 364 |
+
entry = stats[key]
|
| 365 |
+
lo = torch.as_tensor(entry.get('q01', entry['min']), dtype=torch.float64).clone()
|
| 366 |
+
hi = torch.as_tensor(entry.get('q99', entry['max']), dtype=torch.float64).clone()
|
| 367 |
+
unit = torch.as_tensor(entry.get('unit_dims', []), dtype=torch.long)
|
| 368 |
+
lo[unit], hi[unit] = 0.0, 1.0
|
| 369 |
+
norm.fit(lo, hi)
|
| 370 |
+
|
| 371 |
+
@property
|
| 372 |
+
def sampling_steps(self) -> int:
|
| 373 |
+
"""Euler steps (field calls) per query."""
|
| 374 |
+
return int(self.cfg.horizon)
|
| 375 |
+
|
| 376 |
+
def features(self, images):
|
| 377 |
+
return self.obs_encoder(images, images.new_zeros(images.shape[0], 0))
|
| 378 |
+
|
| 379 |
+
def head(self, features, s, b0, n_steps):
|
| 380 |
+
"""FP32: (body path (B, n_steps, body), hands (B, n_steps, hands)) in normalized units."""
|
| 381 |
+
cfg = self.cfg
|
| 382 |
+
c = self.context_proj(self.context_norm(features.float()))
|
| 383 |
+
film = self.field.precompute(c) # c is fixed over the chunk
|
| 384 |
+
b, path = b0, []
|
| 385 |
+
for _ in range(n_steps): # Euler, dt = one row
|
| 386 |
+
b = b + cfg.ode_field_scale * self.field(b, s, c, film)
|
| 387 |
+
path.append(b)
|
| 388 |
+
path = torch.stack(path, dim=1)
|
| 389 |
+
hands = cfg.action_dim - cfg.ode_body_dim
|
| 390 |
+
if not hands:
|
| 391 |
+
return path, path[..., :0]
|
| 392 |
+
out = self.hand_output(F.silu(self.hand_hidden(c))).view(c.shape[0], cfg.horizon, hands)
|
| 393 |
+
return path, out[:, :n_steps]
|
| 394 |
+
|
| 395 |
+
def compute_loss(self, images, state, action, valid=None):
|
| 396 |
+
cfg = self.cfg
|
| 397 |
+
H, body = cfg.horizon, cfg.ode_body_dim
|
| 398 |
+
if action.shape[1] != H + 1:
|
| 399 |
+
raise ValueError(f'the ODE policy trains on the row before + {H} rows, got {action.shape[1]} rows')
|
| 400 |
+
valid = torch.ones(action.shape[:2], device=action.device) if valid is None else valid.to(action.device)
|
| 401 |
+
features = self.features(images)
|
| 402 |
+
with torch.autocast(device_type=images.device.type, enabled=False):
|
| 403 |
+
s = self.state_norm.normalize(state.float()).clamp(-self.CLIP, self.CLIP)
|
| 404 |
+
nact = self.action_norm.normalize(action.float()).clamp(-self.CLIP, self.CLIP)
|
| 405 |
+
b0 = nact[:, 0, :body] * valid[:, :1].float() # BOS (normalized zero) at an episode's first frame
|
| 406 |
+
path, hands = self.head(features, s, b0, H)
|
| 407 |
+
target, mask = nact[:, 1:], valid[:, 1:, None].float()
|
| 408 |
+
|
| 409 |
+
def masked(pred, goal):
|
| 410 |
+
m = mask.expand_as(goal)
|
| 411 |
+
return ((pred - goal).square() * m).sum() / m.sum().clamp_min(1)
|
| 412 |
+
|
| 413 |
+
body_loss = masked(path, target[..., :body])
|
| 414 |
+
hand_loss = masked(hands, target[..., body:]) if hands.shape[-1] else body_loss.new_zeros(())
|
| 415 |
+
loss = (body * body_loss + (cfg.action_dim - body) * hand_loss) / cfg.action_dim
|
| 416 |
+
return loss, dict(body=float(body_loss.detach()), hand=float(hand_loss.detach()))
|
| 417 |
+
|
| 418 |
+
@torch.no_grad()
|
| 419 |
+
def predict(self, images, state, generator=None, previous=None, has_previous=None): # noqa: ARG002
|
| 420 |
+
"""previous: (B, action_dim) physical, the row executed at t-1 (its body part is the start); None, or a False
|
| 421 |
+
in has_previous (B,), starts from the BOS."""
|
| 422 |
+
cfg = self.cfg
|
| 423 |
+
features = self.features(images)
|
| 424 |
+
with torch.autocast(device_type=images.device.type, enabled=False):
|
| 425 |
+
s = self.state_norm.normalize(state.float()).clamp(-self.CLIP, self.CLIP)
|
| 426 |
+
b0 = features.new_zeros(images.shape[0], cfg.ode_body_dim, dtype=torch.float32)
|
| 427 |
+
if previous is not None:
|
| 428 |
+
start = self.action_norm.normalize(previous.to(device=images.device, dtype=torch.float32))
|
| 429 |
+
keep = (torch.ones(images.shape[0], device=images.device) if has_previous is None else
|
| 430 |
+
has_previous.to(images.device).float())
|
| 431 |
+
b0 = start[:, :cfg.ode_body_dim] * keep[:, None] # unclipped carry
|
| 432 |
+
path, hands = self.head(features, s, b0, cfg.horizon)
|
| 433 |
+
raw = torch.cat([path, hands], dim=-1)
|
| 434 |
+
return self.action_norm.unnormalize(raw), raw
|
| 435 |
+
|
| 436 |
+
|
| 437 |
+
class ODEDiTPolicy(ODEPolicy):
|
| 438 |
+
"""ODE-DiT: the ODE policy with ODE Policy's DiT (adaLN) vector field (ode_dit.yaml) over [b, s]."""
|
| 439 |
+
name = 'ode_dit'
|
| 440 |
+
field_arch = 'dit'
|
| 441 |
+
|
| 442 |
+
|
| 443 |
+
from .flash import FlashPolicy # noqa: E402 - FLASH (flash.py) builds on this module's Normalizer and nets.py
|
| 444 |
+
from .fm_dit_v2 import FMDiTv2Policy # noqa: E402 - FM-DiT v2 (FLASH-Policy's FM-DiT) builds on flash.py's networks
|
| 445 |
+
|
| 446 |
+
POLICIES = {cls.name: cls for cls in (FMDiTPolicy, DPPolicy, ACTPolicy, FlashPolicy, ODEPolicy, ODEDiTPolicy,
|
| 447 |
+
FMDiTv2Policy)}
|
| 448 |
+
LABELS = {'fm_dit': 'FM-DiT', 'dp': 'DP (DDPM-DiT)', 'act': 'ACT', 'flash': 'FLASH', 'ode_mlp': 'ODE-MLP',
|
| 449 |
+
'ode_dit': 'ODE-DiT', 'fm_dit_v2': 'FM-DiT v2'}
|
| 450 |
+
|
| 451 |
+
|
| 452 |
+
def build_policy(cfg: PolicyConfig | dict, pretrained: bool = True) -> BasePolicy:
|
| 453 |
+
"""The policy of `cfg`; pretrained=True initializes the backbone from cfg.backbone_weights (training),
|
| 454 |
+
False builds the same structure with random weights (a checkpoint load, which must not download anything)."""
|
| 455 |
+
cfg = cfg if isinstance(cfg, PolicyConfig) else PolicyConfig.from_dict(cfg)
|
| 456 |
+
if cfg.policy not in POLICIES:
|
| 457 |
+
raise KeyError(f'unknown baseline {cfg.policy!r}; one of {sorted(POLICIES)}')
|
| 458 |
+
cfg = replace(cfg) # a copy (resolved backbone_norm)
|
| 459 |
+
return POLICIES[cfg.policy](cfg, init_weights=cfg.backbone_weights if pretrained else None)
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.lock.txt
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# pip freeze of the hb-baselines training environment (2026-11-27, Python 3.12.12, NAS
|
| 2 |
+
# preflight-20261104T1648Z/policies-20261109/envs/hb-baselines, used by the A800 trainings). The Aliyun DSW copy
|
| 3 |
+
# /root/.venvs/hb-baselines (Python 3.12.1, pillow 12.3.0) trained the 2026-11-24..26 DSW runs.
|
| 4 |
+
anyio==4.16.0
|
| 5 |
+
av==15.1.0
|
| 6 |
+
certifi==2026.11.20
|
| 7 |
+
charset-normalizer==3.5.3
|
| 8 |
+
click==8.5.1
|
| 9 |
+
diffusers==0.35.1
|
| 10 |
+
filelock==4.3.1
|
| 11 |
+
fsspec==2026.9.0
|
| 12 |
+
h11==0.16.0
|
| 13 |
+
hf-xet==1.8.0
|
| 14 |
+
httpcore2==2.16.2
|
| 15 |
+
httpx2==2.16.2
|
| 16 |
+
huggingface_hub==2.4.0
|
| 17 |
+
idna==3.20
|
| 18 |
+
importlib_metadata==10.2.0
|
| 19 |
+
iniconfig==2.3.1
|
| 20 |
+
Jinja2==3.1.6
|
| 21 |
+
lazy-importer==0.1.0
|
| 22 |
+
MarkupSafe==3.0.4
|
| 23 |
+
mpmath==1.3.0
|
| 24 |
+
networkx==3.7
|
| 25 |
+
numpy==2.2.6
|
| 26 |
+
nvidia-cublas-cu12==12.8.4.1
|
| 27 |
+
nvidia-cuda-cupti-cu12==12.8.90
|
| 28 |
+
nvidia-cuda-nvrtc-cu12==12.8.93
|
| 29 |
+
nvidia-cuda-runtime-cu12==12.8.90
|
| 30 |
+
nvidia-cudnn-cu12==9.10.2.21
|
| 31 |
+
nvidia-cufft-cu12==11.3.3.83
|
| 32 |
+
nvidia-cufile-cu12==1.13.1.3
|
| 33 |
+
nvidia-curand-cu12==10.3.9.90
|
| 34 |
+
nvidia-cusolver-cu12==11.7.3.90
|
| 35 |
+
nvidia-cusparse-cu12==12.5.8.93
|
| 36 |
+
nvidia-cusparselt-cu12==0.7.1
|
| 37 |
+
nvidia-nccl-cu12==2.27.5
|
| 38 |
+
nvidia-nvjitlink-cu12==12.8.93
|
| 39 |
+
nvidia-nvshmem-cu12==3.3.20
|
| 40 |
+
nvidia-nvtx-cu12==12.8.90
|
| 41 |
+
opencv-python-headless==4.11.0.86
|
| 42 |
+
packaging==26.4
|
| 43 |
+
pillow==13.0.0
|
| 44 |
+
pluggy==1.7.0
|
| 45 |
+
pyarrow==23.0.1
|
| 46 |
+
Pygments==2.21.0
|
| 47 |
+
pytest==8.4.2
|
| 48 |
+
PyYAML==6.0.4
|
| 49 |
+
regex==2026.11.19
|
| 50 |
+
requests==2.34.2
|
| 51 |
+
safetensors==0.8.0
|
| 52 |
+
setuptools==84.2.1
|
| 53 |
+
sympy==1.14.0
|
| 54 |
+
torch==2.9.0+cu128
|
| 55 |
+
torchvision==0.24.0+cu128
|
| 56 |
+
tqdm==4.70.1
|
| 57 |
+
triton==3.5.0
|
| 58 |
+
truststore==0.10.5
|
| 59 |
+
typing_extensions==4.16.0
|
| 60 |
+
urllib3==2.8.0
|
| 61 |
+
zipp==4.1.2
|
a14-unscrew-bulb/b512-trim3f/step-005000/training_records/code_d2096858/evaluation/baselines/requirements.txt
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Environment of the FM-DiT / DP / ACT baselines (training and the policy server), Python 3.12, CUDA 12.8 wheels:
|
| 2 |
+
# uv venv <env> --python 3.12
|
| 3 |
+
# uv pip install --python <env>/bin/python -r evaluation/baselines/requirements.txt \
|
| 4 |
+
# --extra-index-url https://download.pytorch.org/whl/cu128 --index-strategy unsafe-best-match
|
| 5 |
+
# The full pinned set of the training environment (the A800 / NAS env, Python 3.12.12): requirements.lock.txt
|
| 6 |
+
# (HumanWAM hb_training/envs/hb-baselines.txt). Each run records its versions in config.json training.environment.
|
| 7 |
+
torch==2.9.0+cu128
|
| 8 |
+
torchvision==0.24.0+cu128
|
| 9 |
+
diffusers==0.35.1
|
| 10 |
+
av==15.1.0
|
| 11 |
+
pyarrow==23.0.1
|
| 12 |
+
numpy==2.2.6
|
| 13 |
+
opencv-python-headless==4.11.0.86
|
| 14 |
+
pytest==8.4.2
|
| 15 |
+
pillow==13.0.0 # the JPEG effect of the augmentation spec v2 depends on it (owner 2026-11-27: pin every version that changes the numerics)
|