You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sits between VICRegLoss and SIGReg/LeJEPALoss: keeps the variance term from VICReg, replaces covariance with a sliced-Wasserstein sketching term against an isotropic Gaussian. O(NDK), and unlike SIGReg the gradient doesn't vanish under collapse (their Fig. 2).
Note: the official repo is CC BY-NC 4.0, non-commercial. Fine as a reference for the math (Algorithm 1 is unambiguous), but we shouldn't port code directly given our license.
Two PRs:
PR 1: Loss
lightly/loss/visreg_loss.py, structured like LeJEPALoss
Don't forget to reference the paper and authors.
register in lightly/loss/__init__.py
update docs/source/lightly.loss.rst (autodoc entry, same pattern as VICRegLoss/LeJEPALoss)
Add VISReg loss + examples
Paper: https://arxiv.org/abs/2606.02572 (Wu, Balestriero, Levine, Jun 2026)
Official repo: https://github.com/HaiyuWu/visreg
Sits between
VICRegLossandSIGReg/LeJEPALoss: keeps the variance term from VICReg, replaces covariance with a sliced-Wasserstein sketching term against an isotropic Gaussian. O(NDK), and unlike SIGReg the gradient doesn't vanish under collapse (their Fig. 2).Note: the official repo is CC BY-NC 4.0, non-commercial. Fine as a reference for the math (Algorithm 1 is unambiguous), but we shouldn't port code directly given our license.
Two PRs:
PR 1: Loss
lightly/loss/visreg_loss.py, structured likeLeJEPALosslightly/loss/__init__.pydocs/source/lightly.loss.rst(autodoc entry, same pattern asVICRegLoss/LeJEPALoss)Open points:
all_reducepattern from [BUG] SIGReg withgather_distributed=Trueproduces gradient which is off by1/world_sizeunder DDP #1920.LeJEPAProjectionHead, no new head needed (no changes tolightly/models/modules/heads.pyexpected).Tests:
PR 2: Examples (depends on PR 1)
examples/pytorch/visreg.pyexamples/pytorch_lightning/visreg.pyexamples/pytorch_lightning_distributed/visreg.pydocs/source/examples/visreg.rst, same format asvicreg.rst, plus adding it to the examples toctree/indexFollow the VICReg examples structure: backbone +
LeJEPAProjectionHead+VISRegLoss, multi-crop augmentation per paper's A.1 setup.