AsianPlayer's picture
|
download
raw
9.17 kB
# TriDrive — code snapshot
Training / evaluation code of the paper (anonymous submission under double-blind review). 505 files
(`.py`, `.sh`, `.txt` job queues, `.yaml`, `.md`, the AIDE split `.csv` and one `.json` joint map); no results, data caches or weights.
**Code name.** Identifiers in this tree keep the development code name: `CockpitWM`, `cwm3`, `cwm3d` (and the joint model
class `CWM3Joint`) denote **TriDrive**; `cwm2` / `s12_wm` are earlier internal stages whose evaluators and packs the code reuses unchanged.
## Layout
| Directory | Files | Contents |
|---|---:|---|
| `aide/` | 94 | AIDE keypoint-forecasting programme — `data/` (official split lists, `protocol.py` constants, `build_cache.py`, Gate-0 `verify_protocol.py`), `models/` (`cwm3d*` part-tokenised causal Transformer with anchor-mixture horizon head; SiMLPe / ST-GCN / MotionBERT ports; the Driver-WM reproduction `driverwm_repro.py` / `driverwm_kp.py`), `train/` (`train_kp.py` + stage runners), `eval/` (`metrics.py`, `harness.py`, `report_*.py`), `features/` (Qwen3-VL / ego-motion / BATON pose-corpus extraction), `tests/`, `docs/` |
| `baselines_dms/` | 35 | Driver-monitoring baselines (L2CS gaze, MediaPipe face, OpenFace 3, OpenVINO action / gaze, VideoMAE2): feature `extractors/`, the common learned warning read-out `fit_readout.py` (same protocol as `train/train_warning_head.py`), `eval_dms.py` wrappers around the unchanged evaluators, phase-1 manifests and reports |
| `common/` | 3 | `pagecache.py` (evict a file's pages from the OS page cache after it was read into arrays) and `runmeta.py` (run.json provenance writer: command, code hash, inputs sha256, seed, timestamps) |
| `data/` | 45 | Dataset join and target builders — `cwm3_dataset.py` (row-aligned join of the branch inputs, both regimes), CAN packs, behaviour / gaze / pressure / response / road-dynamics targets, V-JEPA 2 stream packs (`build_pack_v2.py`), hold-out pipeline, pose-extraction wrappers, `feature_provenance.yaml` |
| `eval/` | 123 | Evaluators and report renderers — `eval_cwm3.py` (scores pred layouts with the unchanged cwm2 evaluator), `paired_compare.py` (device-cluster bootstrap paired comparison, source of the `paired_compare.csv` ledger), `warning_head_eval.py`, alert timing, hold-out scoring, robustness / identity-invariance checks, human-evaluation analysis (`newtest_*.py`), `report_*.py` |
| `models/` | 16 | The joint model `cwm3.py` (three pretrained base branches V/U/E + directed zero-init interactions + decoders), the branches (`branches.py`: TCN vehicle branch, GRU driver branch, causal-Transformer environment branch), heads / decoders (incl. RSSM), future-state and overlap heads, keypoint forecaster, Driver-WM-style driver branch `u_driverwm.py` |
| `paper/` | 4 | `tables/gen_tables.py` (regenerates `tab_*.tex` verbatim from the markdown result tables; policy in `NUMBERS_POLICY.md`), `figs/make_figs.py` + `figs/FIGURE_LIST.md` |
| `probes/` | 13 | Latent / representation probes over the trunk latents |
| `tests/` | 47 | pytest suite — causality / no-future-leak checks (`test_bank_causality.py`, `test_chunked_no_target_leak.py`, `test_no_future_leak.py`), the no-DMS-input rule (`test_no_dms_inputs.py`), layout contracts, model and metric unit tests |
| `tools/` | 19 | `vlm_handson/` — VLM hands-on candidate ranking, scoring and evaluation on the owner-labelled validation frames |
| `train/` | 93 | Stage trainers — `train_cwm3.py` (one base branch, one variant, one seed; registry `stages.yaml`), `train_cwm3_joint.py` (interactions / decoders; `stages_joint.yaml`), warning-head, future-state, road-dynamics and keypoint-residual trainers, the sequential queue runner `run_queue.py` with the `queue_*.txt` job lists and the shell wrappers used for the paper runs |
| `weak/` | 12 | Weak supervision — GPT weak-label batches behind a calibration gate and a cost ledger (`gpt_*.py`), DMS-teacher soft targets and trunk pretraining (`dms_teacher_*.py`, the only code allowed to read DMS-derived data), hard-clip mining |
Top-level file(s): `budget.yaml` — the budget file records the paid-API budget and the rules that applied to the
weak-label annotation (kept for provenance).
## How paths are configured
* Python modules locate the project root **relative to their own file**, so the tree can live anywhere as long as its layout is kept:
`CWM3 = Path(__file__).resolve().parents[1]`, `EXPLORE = CWM3.parent`, `S12R = EXPLORE / "s12_wm" / "results"` (`train/train_cwm3.py`),
`CWM2 = EXPLORE / "cwm2"` (`train/train_warning_head.py`); the AIDE package uses `ROOT = Path(__file__).resolve().parents[2]`
(`aide/data/build_cache.py`, `aide/eval/harness.py`) and reads the dataset location from the environment:
`AIDE_ROOT = Path(os.environ.get("AIDE_ROOT", "/home/USER/AIDE"))` (`aide/data/protocol.py`). The sibling trees `cwm2/` and
`s12_wm/` of the development checkout are therefore expected next to this directory when a script imports them.
* Absolute paths of the development machine were replaced by the placeholder **`/home/USER/...`** — in the shell wrappers
(e.g. `PY=python`, `cd /home/USER/cwm3`) and in the modules that
name a data root. Set these to your own root before running. `code/common/` holds the shared helpers (`pagecache.py`,
`runmeta.py`); the snapshot does not define a central root constant, so the placeholders above are the values to edit.
* The snapshot contains no host names or IP addresses of the development infrastructure; the remote data server appears as
`REMOTE = "USER@REMOTE_HOST"` (`data/remote_baton.py`). The GPU-lock files used by the trainers (`/tmp/s13_gpu.lock`,
`/tmp/cwm3_joint_launch.lock`, `/tmp/cwm3_robust_gate.lock`) are plain local paths and are unchanged.
## Reproduction entry points (usage lines quoted from the module docstrings)
AIDE keypoint forecasting (Table 1, Appendix C):
```
python aide/data/build_cache.py [--workers 8] # AIDE keypoint cache (results/cache/aide_kp.npz) from the official splits
python aide/data/verify_protocol.py # Gate 0: reproduce the published zero-velocity numbers on the official test split
python aide/train/train_kp.py --model simlpe_kp --seed 42 --lr 3e-4 --epochs 300 --patience 60
python aide/train/train_kp.py --model cwm3d --seed 42 # plan recipe defaults
python aide/eval/harness.py --pred results/runs/<name>/pred_test.npz --run <name> --model <m> [--seed 0] [--split test] [--n-boot 10000]
```
`train_kp.py` flags read from its argument parser include `--model`, `--seed`, `--epochs`, `--bs`, `--lr`, `--wd`, `--warmup`, `--ema`,
`--patience`, `--clip`, `--loss {euc,l1,mse}`, `--w-euc/--w-nll/--w-bone/--w-jerk`, `--no-physics`, augmentation (`--aug-window`,
`--noise-px`, `--joint-drop`, `--translate`, `--scale`, `--flip-p`), architecture (`--d`, `--layers`, `--heads`, `--ffn`, `--head-hidden`,
`--no-anchor`, `--no-uncertainty`, `--dct`, `--rollout {chunked,recursive}`), `--visual` / `--vis-key` / `--traffic-gate` / `--egomotion`,
`--semantic` / `--lambda-sem` / `--label-smoothing` / `--class-balanced`, `--select {mpjpe,f1}`, `--dual-select`, `--patience-f1`.
BATON joint model (Table 3, Appendix B) — `train/` and `eval/`:
```
python train/train_cwm3.py --stage U0 --variant kin_can --seed 0 [--max-anchors N] [--synthetic N] [--minutes 18] [--epochs E] [--out DIR]
python train/train_cwm3_joint.py --stage I1 --variant all --seed 0 [--base-v can4s|can8s] [--max-anchors N] [--synthetic N] [--minutes 18] [--out DIR]
python train/run_queue.py --jobs U0:kin_can:0 U0:kin_can_vc:0 V0:can4s:0 ... [--extra "--minutes 18"]
python eval/eval_cwm3.py --item cwm3_exp2 --regime manual --runs V0_can4s_s0 V0_can8s_s0 [--with-can-only] [--cells veh_onset,d_onset,y_mae,y_crps] [--n-boot 1000] [--split test]
python eval/warning_head_eval.py --runs I1_all_s0 [I1_all_s1 I1_all_s2] [--item cwm3_v1] [--n-boot 2000] [--skip-gold]
```
Stage definitions (recipe keys `batch`, `rows_per_epoch`, `max_epochs`, `patience`, `lr`, `weight_decay`, `sched`, `val_rows`, `amp`,
`grad_clip`, `select_LF`; `lambda` branch-loss weights) are in `train/stages.yaml` and `train/stages_joint.yaml`; `defaults.seeds: [0, 1, 2]`.
Paper tables and figures: `paper/tables/gen_tables.py` copies every number verbatim from the markdown result tables
(`benchmark/tables/` in this bucket) into `tab_*.tex`; `python3 paper/figs/make_figs.py [heatmap]` regenerates the figures.
## Data this code expects
The joint-model scripts read the development layout documented in `data/cwm3_dataset.py`: `s12_wm/results/targets_{r}_{s}.npz`
(anchor grid, CAN history `X`, targets `Y`), `cwm3/results/pack/xpre_{r}_{s}.npz` (the 8 s CAN pre-history) and the driver-side
kinematic histories (`cwm2/results/targets_kin/kinhist_*`). The pseudonymised packs released under `data/` of this bucket correspond
to the first two; the driver-side cabin-derived features are not released (see the bucket README) and are rebuilt by `code/data/`
from the BATON corpus. The AIDE scripts need the AIDE dataset from its authors (`AIDE_ROOT`); `benchmark/aide_protocol/` holds the
split lists and the protocol verification record.

Xet Storage Details

Size:
9.17 kB
·
Xet hash:
149c62852554a46156500b29c493f731261cf4eb6744b47889e1f90f5f7fe9d4

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.