Datasets:
video video 13.3 13.3 | label class label 0
classes |
|---|---|
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null | |
null |
Pendulum C-JEPA dataset — 160 frames
Silent H.264 MP4s of a nonlinear physical pendulum with frame-aligned CSV labels, built specifically for C-JEPA.
This is a regenerated, longer replacement for
jimchen2/pendulum-cjepa-dataset.
That version used 72 frames (6 s) per video, which is too short for the C-JEPA pipeline
for two independent reasons. See Why 160 frames.
| old (72f) | this (160f) | |
|---|---|---|
| frames / video | 72 | 160 |
| duration | 6.00 s | 13.33 s |
| fps | 12 | 12 |
| oscillations / video | 2.96 | 6.57 |
| videos | 200 (160/40) | 300 (240/60) |
| damping γ | U(0, 0.35) | U(0.15, 0.50) |
| rollout 128→160 | crashes | works, with ground truth |
Layout
.
├── videos/train/video_00000.mp4 ... 240 clips
├── videos/val/video_10002.mp4 ... 60 clips (val ids offset by 10000)
├── timeseries/video_XXXXX.csv 300 frame-aligned label files
├── cjepa_data_root/ ready for extract_four.py
│ ├── pendulum_train/videos/*.mp4
│ └── pendulum_val/videos/*.mp4
├── cjepa_slots.pkl oracle slots, float32[160, 4, 32]
├── index.csv per-video params and splits
├── metadata.json
├── pendulum_cjepa.py the exact generator used (damping patched)
├── regenerate.sh rebuild at any video count
├── cjepa_160frame.patch required patch for the training repo
└── verify_dataset.py
Frame n ↔ CSV row frame=n ↔ time_s = n/12.
Splits are whole-video, never adjacent-frame.
Intended use of the 160 frames
frames 0 .. 127 observation / training windows (OBS_FRAMES = 128)
frames 128 .. 159 held-out ground truth (TARGET_LEN = 160)
C-JEPA's rollout_video_slots extrapolates 128 → 160. CLEVRER has no ground truth past
frame 128, so that rollout has never been scored in this codebase. Here it is: the last
32 frames give you both real VideoSAUR slots and exact theta_rad / omega_rad_s /
energy_j_per_kg from the CSVs, so you can report extrapolation error at +2.67 s ≈ 1.3
oscillations instead of just a training loss.
Why 160 frames
1. The training code hard-codes 128 observed frames.
In src/train/train_causalwm_from_clevrer_slot.py:
OBS_FRAMES = 128
TARGET_LEN = 160
extended_slots[:, :OBS_FRAMES, :, :] = batch_slots # needs T >= 128
These are CLEVRER constants (128 frames @ 25 fps; SlotFormer rolls out to 160). With 72-frame
slots this is a shape mismatch → RuntimeError, and rollout.save_rollout defaults to true,
so the job dies right after training finishes.
2. 6 s is only ~3 swings. With L = 1 m and amplitude 15–40°, the period is
T ≈ 2.01–2.07 s (small-angle 2π√(L/g) plus the θ₀²/16 correction), i.e. ~24.4 frames per
oscillation at 12 fps. 160 frames gives 6.57 oscillations.
3. Damping was unidentifiable. The envelope is exp(-γt/2), time constant τ = 2/γ. The
old γ ~ U(0, 0.35) put half the videos at τ > 20 s — visually undamped over any clip you
train on. This release uses γ ~ U(0.15, 0.50):
| old | this release | |
|---|---|---|
| γ range | 0 – 0.35 | 0.157 – 0.500 (measured) |
| τ = 2/γ | 5.7 s – ∞ | 4.0 s – 12.7 s |
| amplitude left at end of video | 0.35 – 1.00 | 0.04 – 0.35 |
τ is now comparable to the clip length, so γ is actually recoverable from pixels.
fps is deliberately still 12
Do not raise it. clevrer_dinov2_hf.yml trains with chunk_size: 6, num_frameskip: 2 on
25 fps CLEVRER — an effective 12.5 fps. 12 fps native already matches the checkpoint's
inter-frame motion scale, and extract_four.py runs the processor at native rate with no
frameskip. Likewise --size 196 matches NUM_PATCHES: 196 = 14×14 patches from DINOv2-S/14.
Physics
theta'' = -(gravity/length)·sin(theta) - damping·theta'
RK4 at fps × substeps = 96 Hz, 8 substeps/frame, g = 9.81 m s⁻², L = 1.0 m.
Illumination is independent: light(t) = mean + amplitude·sin(2π·frequency·t + phase).
The orange disk marks parallel-ray light; the shadow is the exact ground projection of
the circular bob and ideal thin rod. bob_x_m/bob_y_m are physical metres relative to the
pivot; bob_x_world, bob_y_world, shade, mid are drawing-world units — not metres.
Randomized per video: θ₀ = ±15–40°, ω₀ = ±0.2 rad/s, γ = 0.15–0.50 s⁻¹, light mean 70–110°, light amplitude 0–15°, light frequency 0.04–0.12 Hz, random light phase.
Usage
python verify_dataset.py # checks counts, 160-frame decode, slot shapes
Step 1 — extract VideoSAUR slots
OPENBLAS_NUM_THREADS=1 python -u extract_four.py --device cuda
Point it at cjepa_data_root/. Produces [160, 4, 128] per video.
This is 300 × 160 = 48k frames through DINOv2-S/14, 3.3× the old dataset's cost —
use a GPU. extract_four.py resumes and writes atomically, so it is safe to interrupt.
Step 2 — patch the training repo
cd /path/to/cjepa && git apply cjepa_160frame.patch
Three changes to src/train/train_causalwm_from_clevrer_slot.py:
ClevrerSlotDataset gains max_frames; get_data passes max_frames=OBS_FRAMES so training
only sees frames 0–127; rollout_video_slots slices batch_slots[:, :OBS_FRAMES] before the
assignment that otherwise crashes.
Step 3 — train
export WANDB_MODE=offline
export PYTHONPATH=$(pwd)
export SLOTPATH="/path/to/pendulum_videosaur_4slots.pkl"
python src/train/train_causalwm_from_clevrer_slot.py \
cache_dir="${HOME}/.stable_worldmodel" \
output_model_name="pendulum_cjepa" \
dataset_name="pendulum" \
num_workers=4 batch_size=32 trainer.max_epochs=30 \
num_masked_slots=1 predictor_lr=5e-4 \
dinowm.history_size=6 dinowm.num_preds=10 \
frameskip=2 \
videosaur.NUM_SLOTS=4 videosaur.SLOT_DIM=128 \
predictor.heads=8 \
embedding_dir="${SLOTPATH}"
Use frameskip=2, not 1. At frameskip=1 a training clip spans 16 frames = 1.33 s = 0.65
of a period, so the model never sees a full swing in one sample. At frameskip=2 it spans 32
raw frames = 2.67 s ≈ 1.3 oscillations, mirroring SlotFormer's CLEVRER recipe
(n_sample_frames = 6 + 10, frame_offset = 2).
Windows per video with the patch applied (max_frames=128):
| frameskip | clip_len | windows/video | train samples (240 videos) |
|---|---|---|---|
| 1 | 16 | 113 | 27,120 |
| 2 | 32 | 97 | 23,280 |
Regenerating at a different size
300 videos is a compromise. If you want more trajectory diversity:
./regenerate.sh 1000 ~/pendulum-160f-1k
Generation runs at ~0.8 s/video on CPU. Note that VideoSAUR extraction cost scales linearly, so 1000 videos is 11× the old dataset's extraction budget.
cjepa_slots.pkl is NOT for training
It contains deterministic oracle simulator-state slots, float32[160, 4, 32], keyed
{split: {"<id>_pixels.mp4": array}}. It exists only to smoke-test C-JEPA's data loading and
prediction path without running VideoSAUR. For any real result use the extracted VideoSAUR
slots (slot_dim=128) instead. Note the two pickles use different slot widths, so
videosaur.SLOT_DIM must match whichever you pass.
Known caveats
- The pretrained VideoSAUR checkpoint was trained on CLEVRER, not this renderer. Inspect the
slot masks (
extract_four.pywritesdiagnostics.csvand attention.npzfor the first three videos per split) before trusting them; fine-tune VideoSAUR on these MP4s if the slots do not consistently track bob/rod, light, and shadow. - 300 trajectories is small next to CLEVRER's ~10k. Training windows overlap heavily, so effective diversity is 300, not 27k.
- Videos are duplicated between
videos/andcjepa_data_root/to match the original repo layout and to keepextract_four.pyworking unmodified.
License
MIT. Original supplied code's copyright notice is preserved; see LICENSE.
- Downloads last month
- 75