feat: add LeJEPA transform#1924
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1924 +/- ##
==========================================
- Coverage 86.26% 86.13% -0.13%
==========================================
Files 170 171 +1
Lines 7104 7133 +29
==========================================
+ Hits 6128 6144 +16
- Misses 976 989 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new LeJEPATransform to the lightly.transforms package to generate LeJEPA-style multi-view augmentations (2 global views + configurable local views), along with docs and a basic unit test.
Changes:
- Introduces
lightly.transforms.lejepa_transform.LeJEPATransform(and internalLeJEPAViewTransform) implementing a DINO/iBOT-like multi-crop augmentation pipeline. - Exports
LeJEPATransformfromlightly.transformsand documents the new module in Sphinx docs. - Adds a unit test verifying PIL input produces the expected number of views and output shapes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lightly/transforms/lejepa_transform.py |
New LeJEPA multi-view transform implementation (global + local views) built from torchvision-compatible augmentations. |
lightly/transforms/__init__.py |
Exposes LeJEPATransform at the package level for public import. |
docs/source/lightly.transforms.rst |
Adds Sphinx automodule entry so the new transform appears in documentation. |
tests/transforms/test_lejepa_transform.py |
Adds a shape/length test for multi-view output on PIL input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
139a177 to
89e4807
Compare
|
Hi @gabrielfruet - happy to move this along, let me know if you need a helping hand. |
|
Hey @RecreationalMath thank you! I decided to not go over with the LeJEPA transform implementation since it's basically a DINO with some different parameters. IDK if that's is of your interest, but are you into world models ? (e.g LeWM, SubJEPA and so on) |
|
Looking at it, the overlap with DINO is my read too.
Yes. I've been reading the papers and looking at the trajectory. Any plans to implement them in lightly? |
|
We can discuss more into it also. We think it's valuable to have something of world models at LightlySSL. Any suggestions, ideas, paper are surely welcome :) Currently we are prioritizing LightlyTrain, so I'm not having much time to research world models stuff for LightlySSL. Since the philosophy of LightlySSL is providing building blocks, implementation of losses of world models, or predictor architectures are surely welcome. FYI, we were able to benchmark LeJEPA and the metrics are very similar to the papers! Thank you so much for the high quality contributions. |
|
Good to hear the LeJEPA benchmark held up against the paper. The smallest natural building blocks for LeWM I see are a JEPA-style predictor module and a next-embedding prediction loss. SIGReg is already in place as the regularizer, so the new surface is small. Sub-JEPA's MultiSubspaceSIGReg can follow afterwards. Shall I open a tracking issue with the proposed scope first for a sanity check? |
|
I would appreciate if you could open an issue for that. We can better refine the scope. We are very open to suggestions in this world model field, so feel free to be creative and give suggestions. |
|
Opened #1934 with some initial thoughts, findings and reasoning. Would appreciate your input there, @gabrielfruet |
Summary
Adds a new
LeJEPATransformfor LeJEPA-style multi-view augmentation. The exact augmentation configuration is not explicit in the paper, they only say they use 2 global views and 2 local views.What’s included
lightly.transforms.lejepa_transformimplementationlightly.transformsdocs/source/lightly.transforms.rstNotes
Testing
tests/transforms/test_lejepa_transform.py