Update README.md
Browse files254 unmodified lines255256257254 unmodified linesThe counting questions still cannot reach CLEVRER's answer diversity, because `length_m` and `gravity_m_s2` are constant across train. Fixing that needs a re-render: one line in `pendulum_gen.sample_config` (`cfg.length_m = rng.uniform(0.5, 2.0)` in the `ID` branch) would spread the swing period and therefore every count. Note that `scene_geometry` draws the arm at the constant `DRAW_LENGTH = 8.0` and never reads `length_m`, so the pixels would be unchanged while the labels' `bob_x_m` / `energy_j_per_kg` would acquire an `L` dependence — decide whether to scale `DRAW_LENGTH` too before doing it.Functional programs (`program` / `my_program`) are still absent. Adding them requires a DSL and executor over pendulum state and is out of scope here.254 unmodified lines255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327254 unmodified linesThe counting questions still cannot reach CLEVRER's answer diversity, because `length_m` and `gravity_m_s2` are constant across train. Fixing that needs a re-render: one line in `pendulum_gen.sample_config` (`cfg.length_m = rng.uniform(0.5, 2.0)` in the `ID` branch) would spread the swing period and therefore every count. Note that `scene_geometry` draws the arm at the constant `DRAW_LENGTH = 8.0` and never reads `length_m`, so the pixels would be unchanged while the labels' `bob_x_m` / `energy_j_per_kg` would acquire an `L` dependence — decide whether to scale `DRAW_LENGTH` too before doing it.Functional programs (`program` / `my_program`) are still absent. Adding them requires a DSL and executor over pendulum state and is out of scope here.## Intervention# Pendulum C-JEPA 3K — Intervention SubsetData-generating interventions added to **240 videos**Everything else in the dataset is untouched.## What was doneFor a deterministic subset of 240 train videos (every 10th: `video_00000,video_00010, … video_02390`), each video was **re-simulated and re-rendered withthe repo's own `pendulum_gen.py`** with an intervention applied at**frame 96 (t = 8.0 s)** of the 13.3 s clip. Frames 0–95 are identical to theoriginals (verified: max pixel diff ≤ 29, i.e. pure H.264 encoder noise), so theintervention boundary is clean.Two intervention types, 120 videos each:| type | what changes | what stays the same ||---|---|---|| **`light_shift`** | At frame 96 the light source trajectory is smoothly switched (smoothstep ramp over 6 frames) to a new mean/amplitude/frequency/phase (`Δmean ∈ ±20°`, `amp ∈ [5,30]°`, `f ∈ [0.15,0.40] Hz`). The sun and its shadow sweep differently for the last ~5 s of the video. | Pendulum physics is byte-identical — theta/omega/energy are unchanged (verified: `theta_deg` diff = 0.0). This is the "light moves differently towards the end" intervention. || **`torque_push`** | A genuine physical intervention: an external torque impulse `A·exp(−(t−t_push)²/2σ²)` (σ = 0.15 s, `A ∈ [2.0, 4.5] rad/s²`, hard-gated on for `t ≥ 8.0 s`) is applied to the pendulum. The bob's motion genuinely deviates after the push (verified: Δθ up to ~6°, Δω up to ~0.34 rad/s). | The light trajectory is unchanged. |Per-video intervention parameters (cut frame, new light params / push amplitude)are stored in `intervention_log.json` and the `intervention_*` columns of`index_intervention.csv`. All generated videos passed the original scenevalidator (`|θ| ≤ 85°`, sun/bob/shadow inside the world bounds).## Layout```intervened/├── videos/train/video_XXXXX.mp4 240 intervened videos (same ids as originals)├── timeseries/video_XXXXX.csv 240 frame-aligned labels, same schema as original├── index_intervention.csv 240 rows: original index + intervention_type/cut_frame/params├── intervention_log.json per-video intervention details + post-cut stats├── preview_before_after.mp4 side-by-side original vs intervened (4 examples)└── contact_sheet.png static pre/post-cut comparison grid```The CSVs keep the original schema (`frame,time_s,theta_rad,…,light_angle_deg,light_x_world,shadow_left_world,shadow_right_world,shade,mid,…`); for`light_shift` the light/shadow columns change post-cut while physics columnsstay identical, for `torque_push` the physics columns change post-push.## Reproduce```bashpython3 intervene.py # regenerates everything (skips existing outputs)python3 make_preview.py # rebuilds the preview mp4 / contact sheet```Selection and intervention parameters are deterministic (`SEED=20261118`,`EVERY=10`, `CUT_FRAME=96` in `intervene.py`).## Why this is useful for C-JEPA / Lfuture eval- `light_shift` is a clean **nuisance-factor intervention**: the observablevideo changes (light + shadow motion) while the pendulum state evolution isexactly the same. A model that predicts future slots must capture thelight→shadow causal link, not just copy the pendulum's dynamics.- `torque_push` is a **physical intervention**: the future pendulum motiongenuinely deviates from the non-intervened continuation, so Lfuture on thepost-push frames measures whether the model predicts the response to anexternal force.- Because frames 0–95 match the originals exactly, you can train/evaluate on thepre-intervention prefix and measure prediction quality on the post-interventionsuffix directly.
README.md+70