lehami-phyworld / README.md
hanbin5's picture
Add part 4: 1 files (README.md ...)
98337cd verified
|
Raw History Blame Contribute Delete
8.19 kB
metadata
tags:
  - world-model
  - jepa
  - hamiltonian
  - physics
  - out-of-distribution
datasets:
  - magicr/phyworld

LeHami predictors on PhyWorld parabola

Checkpoints, evaluation outputs, reports and rollout videos of an experiment that asks whether LeHami predictors (latent dynamics with a Hamiltonian structure, rominay/LeHami) keep an out-of-range velocity on PhyWorld parabola, where DINO-WM and LeWM pull it toward the training range.

Code and the full write-up: GitHub jongmin-s-multicore/thread0, branch hanbin5/lehami-phyworld, folder lehami_phyworld/.

Result in short

Training velocities are about 1.0 to 4.0 units/s; the fast group's true velocity is 5.25. The fast one step is the velocity read by a probe from a frame predicted from the real frames before it. A run's class is judged only when it passes the in-range gate.

Setting Encoder Arm A (MLP T) Arm B (quadratic T) Arm C (transformer)
LH-P trained from scratch with the predictor gate fail (both seeds) gate fail (both seeds) gate fail (both seeds)
K2 starts from LeWM run1's encoder, trained with the predictor follows (5.97, 5.21) follows (6.16, 6.12) gate fail (seed 0)
K5 LeWM run1's encoder, frozen between (5.08, 4.69) follows (5.82, 5.74) gate fail (seed 0)
K6 DINO-WM's DINOv2, frozen; input: CLS token gate fail (both seeds) between (4.49, 4.44) not run
K6 DINO-WM's DINOv2, frozen; input: mean of the patch tokens pulled (3.38, 3.46) between (4.69, 4.61) not run
Reference DINO-WM 4.00 (pulled); LeWM runs 1-3: 3.05, 3.20, 3.39 (pulled); LeWM predictor on frozen DINOv2 CLS, seeds 0-2: 1.93, 1.68, 1.67 (seed 1 pulled, seeds 0 and 2 gate fail)

Brackets: seed 0, seed 1. In K5 the paired bootstrap of the fast one step, B − A, is 0.740 [0.589, 0.893] (seed 0) and 1.053 [0.886, 1.228] (seed 1). In K6 the LeHami predictors sit on stored DINOv2 features (ViT-S/14, the encoder DINO-WM uses) through a trained projector; three of the four arms pass the gate in both seeds, and both B arms are between. The reports in reports/ hold every value and the definitions.

Files

The repository is uploaded in four parts. Part 1 (3.65 GB) holds everything needed to read and reproduce the reports of LH-P, K0, K2 and K5. Part 2 (3.81 GB, uploaded after Part 1) holds the evaluations of the earlier checkpoint (step 30,000) and the K0 readout arrays. Part 3 (118 MB) holds the evaluation videos, converted from PhyWorld. Part 4 (3.01 GB, uploaded last) holds K6, the seven-panel rollout videos and this card.

Part 1:

Folder Content
checkpoints/lehami/<run>/ config.json, log.jsonl, weights_step30000.pt, weights_step61170.pt (state dict of the JEPA module: encoder, projector, action encoder, predictor). Runs: arm{A,B,C}_s{0,1} (LH-P), k2_arm{A,B}_s{0,1}, k2_armC_s0, k5_arm{A,B}_s{0,1}, k5_armC_s0
checkpoints/lewm/run{1,2,3}/ LeWM PhyWorld, 10 epochs (weights_epoch_10.pt, config.json); run1 is the K2 / K5 encoder source
eval/<run>/eval_step61170/ evaluation of the judged checkpoint on the 1,056 evaluation videos: latents, probe readouts, cross-fit probes (*_cf)
eval/k0/, eval/k2_k0/, eval/k5_k0/ K0 readouts (CLS before the projector and q)
eval/lewm_reeval/ LeWM re-evaluated from the context frames 1-3 (the report's LeWM rows)
eval/dinowm/eval_step60000.npz DINO-WM PhyWorld evaluation (report rows and the real-frame mask)
reports/ the reports (md and json)
videos/ rollouts GT / DINO-WM / LeWM / LeHami A / LeHami B (the LeHami panels are K2 seed 0) for nine evaluation videos and a grid; half_speed/

Part 2:

Folder Content
eval/<run>/eval_step30000/ evaluation of the step-30,000 checkpoint (the reports use it only as the trend)
eval/k0/*.npz, eval/k2_k0/*.npz, eval/k5_k0/*.npz the K0 readout arrays (features read again from each checkpoint)

Part 3:

Folder Content
data/ parabola_eval.h5 and parabola_eval.npz: the 1,056 PhyWorld parabola evaluation videos in the HDF5 layout of the code (224 px frames, zero actions; radius, velocity and ball positions in the npz). data/README.md gives the source, the license (CC BY 4.0), what we changed and the hashes

Part 4:

Folder Content
checkpoints/lehami/k6_{cls,mean}_arm{A,B}_s{0,1}/ K6: config.json, log.jsonl, stats.npz (the mean and std that standardise the input feature), weights_step30000.pt, weights_step61170.pt (state dict: projector, action encoder, predictor; no encoder, the features are stored)
eval/k6_*/eval_step61170/, eval/k6_*/eval_step30000/ K6 evaluations of both checkpoints (61,170 is judged)
eval/k6_k0/ K6 K0 readouts (json): q and the standardised input of each checkpoint, and the input feature alone (k0_K6input_{cls,mean}.json)
checkpoints/frozen_dinov2/run_s{0,1,2}/, eval/frozen_dinov2/ the LeWM predictor trained on frozen DINOv2 CLS features (three seeds) and its evaluations: the reference rows of the K6 report; run_s0/stats.npz is the CLS standardisation K6 checks against
reports/k6_report/ the K6 report (md and json)
videos_7panel/ rollouts GT / DINO-WM / DINOv2+LeHami A / DINOv2+LeHami B (K6, patch-mean input, seed 0) / LeWM / LeWM+LeHami A / LeWM+LeHami B (K2, seed 0) for the same nine videos and a grid; half_speed/

SHA256SUMS lists every file of Part 1 as it was first uploaded (its README.md line is the first card), SHA256SUMS.optional those of Part 2, SHA256SUMS.part3 those of Part 3, and SHA256SUMS.part4 those of Part 4 (this card and the folders above). Each later card replaced the one before. Paths inside json files read $DINO_WORK/... (the working folder of the code). The training videos are not here: convert them from magicr/phyworld (CC BY 4.0) with the code on GitHub. K6 reads DINOv2 features extracted from the converted videos (frozen_dinov2.py extract on GitHub); the features are not uploaded.

Loading a checkpoint

import json, torch, lh_common as C   # from the GitHub folder; needs le-wm and LeHami on the path (see its README)
cfg = json.load(open("checkpoints/lehami/k5_armB_s0/config.json"))
model = C.build_model(cfg["arm"])
model.load_state_dict(torch.load("checkpoints/lehami/k5_armB_s0/weights_step61170.pt", map_location="cpu"), strict=True)

import k6_common as K   # K6: the encoder is the identity; the input is the standardised stored feature
cfg = json.load(open("checkpoints/lehami/k6_mean_armB_s0/config.json"))
model = K.build_model(cfg["arm"])
model.load_state_dict(torch.load("checkpoints/lehami/k6_mean_armB_s0/weights_step61170.pt", map_location="cpu"), strict=True)

Licenses of the sources

  • The LeHami predictors and loss follow rominay/LeHami (commit f90a3b1, Apache License 2.0, Copyright 2026 Romina Yalovetzky, Randall Balestriero, and Yann LeCun). The modified copy of its loss in the GitHub code keeps that notice.
  • LeWM: le-wm (MIT License, Copyright 2026 Lucas Maes).
  • DINOv2 (K6 features): the ViT-S/14 weights DINO-WM loads from facebookresearch/dinov2 (Apache License 2.0). They are not copied here.
  • PhyWorld data (Kang et al., ICML 2025): magicr/phyworld, CC BY 4.0. data/ holds a changed copy of its id_ood_data/parabola_eval.hdf5: the videos decoded and resized to 224 px by convert_phyworld.py, under the same license (changes and hashes in data/README.md). The training videos are not included.
  • No license has been chosen for the checkpoints and evaluation files of this repository.

Limits

One dataset, two seeds per arm (one for arm C in K2 and K5; K6 has arms A and B only), a probe reading of the velocity. The class names and thresholds are defined in the reports.