HappyFox001/CleanJepa
Machine LearningModel researchA minimal PyTorch implementation of JEPA and latent world models for ML researchers.
What it does
CleanJepa is a compact, read-only implementation of the JEPA family and latent world models in plain PyTorch. It targets ML researchers who want to read the full training loop without fighting a framework: every recipe is a single file with torch as the only dependency.
The library covers LeWM, LpWM, VICReg world model, DINO-WM, token world models, V-JEPA 2-AC, I-JEPA and V-JEPA. World models plan by predicting the next latent state from an action, then searching for actions whose predicted future matches a goal image. Planning solvers include CEMSolver, MPPISolver and GradientPlanner.
Quick start
Clone the repository, install it editable, and train a small LeWM-style world model on synthetic moving squares (no dataset download needed):
git clone https://github.com/HappyFox001/CleanJepa.git && cd CleanJepa
pip install -e .
python recipes/train_wm.py --synthetic --epochs 2
To skip training, install the world-model extras, download the toy checkpoint and run the planning evaluation (--device auto picks CUDA, then Apple-silicon MPS, then CPU):
pip install -e ".[wm]"
hf download CleanJepa/toy-square-wm lpwm/seed0.pt --local-dir models
python recipes/eval_toy.py --ckpt models/lpwm/seed0.pt --num-eval 10 --device auto
For real data, CleanJepa expects the LeWM HDF5 format (for example the PushT expert dataset), then probes the learned latents:
pip install -e ".[wm]"
python recipes/train_wm.py --data pusht_expert_train.h5 --amp bf16 --save-dir runs/pusht
python recipes/probe_wm.py --ckpt runs/pusht/epoch_10.pt --data pusht_expert_train.h5 --targets proprio
The same benchmark command trains each preset on the toy world, probes latents, plans with CEM and prints a table across seeds:
python recipes/toy_benchmark.py --out runs/toy_bench --methods lewm,lpwm,vicreg --seeds 0,1,2
Use as a library
Install from PyPI (pip install cleanjepa) to import ViTEncoder, JEPAWorldModel, SIGReg and CEMSolver directly. The README example builds an encoder, predicts one-step latent transitions, adds SIGReg regularization to the loss and plans five action blocks toward a goal image. Tensor shapes are annotated on each call, so keep the batch, time, channel, height and width order when adapting the snippet.
Constraints
- Requires Python 3.10+ and PyTorch 2.1+; the library has no dependency beyond
torch, and some recipes need the.[wm]or.[viz]extras. - The toy world model can be downloaded from Hugging Face; large-scale real-data experiments need external HDF5 datasets and enough GPU memory.
- Each recipe documents its differences from the official implementation in its docstring, so results are not guaranteed to match the original papers.
- Licensed under MIT.
HotRepo's take
CleanJepa is a young repository created in late November 2026. In the Python new-project ranking on 2026-12-03 it recorded 118 stars and 10 forks, gaining 13 stars during a roughly 3.5-hour window starting at 06:16 UTC; the README's own toy benchmark table spans three seeds and is backed by a Hugging Face results dataset. The project has no best all-language GitHub daily rank on record, so the single snapshot supports only the day's growth facts, not a trend. Its value is the small, hackable codebase and the unified presets rather than any claim of benchmark superiority.
Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.
You might also like
- Interactive-Active-AI/NextTransformerA compute-matched benchmark framework for training and comparing next-generation Transformer architectures under one protocol.
- apple-aiml-research/ml-haloResearch code for generating synthetic data, training, and deploying perceptive humanoid motion policies for the Unitree G1.
- jwang771/3d-world-simulatorResearch code for a hybrid particle-voxel model that learns and predicts 3D deformable object dynamics.
- SheepSeb/tinyworldformerA research project running a tiny neural world model and RL agent together on a Raspberry Pi Pico 2 W.
- snap-stanford/memorillaTrains a memory module that compresses large document collections into a few memory tokens for a frozen LLM.