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
- 319