Instructions to use azimi2kht/lejepa-vit-small-patch8-imagenette with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use azimi2kht/lejepa-vit-small-patch8-imagenette with timm:
import timm model = timm.create_model("hf-hub:azimi2kht/lejepa-vit-small-patch8-imagenette", pretrained=True) - Notebooks
- Google Colab
- Kaggle
LeJEPA ViT-S/8 on Imagenette
This independent reproduction trains the minimal example by Randall Balestriero and Yann LeCun from random initialization. LeJEPA trains an encoder to give similar projected representations for views of the same image. SIGReg measures how closely random projections match a standard Gaussian. A separate classifier learns to predict Imagenette labels from detached encoder embeddings. Paper · Pinned official implementation
Download the full model · Individual weights · Reproduce training
Results
| Metric | Official | Independent reproduction | Difference |
|---|---|---|---|
| Final validation top-1 | 90.7% reported, checkpoint unspecified | 90.420% (3,549/3,925) | -0.280 percentage points against the reported value |
| Best observed validation top-1 | Unspecified | 91.134% at epoch 792 | Unavailable |
| Training epochs | 800 | 800 | 0 |
| Training batch size, images | 256 | 256 | 0 |
| Trainable parameters, including probe | Unspecified | 26,958,746 | Unavailable |
| Full-run allocation time, including verification | 200 min in results table | 264.88 min | +64.88 min |
One NVIDIA GH200 trained the model from scratch on CSC Roihu with an ARM Grace CPU, Python 3.12.12, PyTorch 2.10.0+cu130, torchvision 0.25.0+cu130, CUDA 13.0 and timm 1.0.27. The full training allocations used 4.4147 GPU-hours. The two benchmark allocations bring the total to 4.4361 GPU-hours, equivalent to 887.22 GPU BU at the published rate. Time includes GPU allocation startup and cleanup. The original example also gives a rough two-hour estimate without hardware details.
The exported model scored 3,549/3,925 in a separate validation pass. On the first validation batch, the combined and individual SafeTensors files produced exactly the same encoder embeddings, projector embeddings and classifier logits as the final PyTorch checkpoint under CUDA bfloat16 autocast.
Data and model
The training split contains 9,469 images, and the validation split contains 3,925 images. The run uses the 160px version of Imagenette. Each training image supplies four independent augmented 128 × 128 crops. Validation uses a single RGB view, a resize to 128 on the shorter edge, a center crop and ImageNet normalization. Dataset · Configuration audit
The ViT-S/8 backbone has a hidden width of 384, 12 blocks and six attention heads. Its output head produces a 512-dimensional embedding. The projector maps 512 → 2048 → 2048 → 16 with batch normalization and ReLU in the hidden layers. The classifier applies layer normalization and a linear map to ten classes. The default weights in this repository come from the end of epoch 800.
Training uses batch size 256, 36 updates per epoch, CUDA bfloat16 autocast, gradient scaling, and AdamW. The encoder and projector start with a base learning rate of 0.002 and weight decay of 0.05. The probe uses 0.001 and 1e-7. A one-epoch linear warmup precedes cosine annealing. The loss adds 0.98 times the invariance loss, 0.02 times SIGReg and the probe cross-entropy. Training configuration
Load the weights
Install the dependencies with pip install -r training/requirements.txt from the repository root.
import sys
from huggingface_hub import snapshot_download
from PIL import Image
import torch
folder = snapshot_download("azimi2kht/lejepa-vit-small-patch8-imagenette")
sys.path.insert(0, folder)
from inference import load_component, preprocess
encoder = load_component(folder, "encoder")
projector = load_component(folder, "projector")
classifier = load_component(folder, "classifier")
with Image.open("example.jpg") as image:
x = preprocess(image, folder).unsqueeze(0)
with torch.inference_mode():
embedding = encoder(x) # [1, 512]
projected = projector(embedding) # [1, 16]
class_index = classifier(embedding).argmax(1).item()
Each component file loads independently. The full model file contains all three components. Its label order is in config.json. The command below loads the full model and prints its predicted class.
python inference.py . example.jpg
python -m training.evaluate . --check
Reproduction and limitations
Follow the reproduction instructions for the dataset revision, environment, Slurm script, checkpoint procedure and exact evaluation command. The implementation retains the official training and evaluation math. Infrastructure adds offline data access, local metrics, checkpointing, time limits and resource monitoring. The upstream example does not specify dependency versions or a GPU model. Floating-point operations and data processing can vary across environments. This single run measures performance on ten Imagenette classes. Transfer to other classes, domains and resolutions was not evaluated. Reproduction instructions · Metrics · Training curves
Attribution and license
The upstream implementation and this release use Creative Commons Attribution-NonCommercial 4.0 International. Credit Randall Balestriero and Yann LeCun for the LeJEPA method and official example. This reproduction adds training infrastructure, evaluation, weight exports and release documentation. Refer to the original data provider for dataset terms. License
@misc{balestriero2025lejepaprovablescalableselfsupervised,
title={LeJEPA: Provable and Scalable Self-Supervised Learning Without the Heuristics},
author={Randall Balestriero and Yann LeCun},
year={2025},
eprint={2511.08544},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2511.08544}
}
- Downloads last month
- -