lightly-ai/lightly

LeJEPA loss missing contributions from global views?

クローズ

#2,002 opened on 2026/07/25

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Python (337 件のフォーク)auto 404
bugconfirmedgood first issuehelp wanted

Repository metrics

Stars
 (3,775 個のスター)
PR merge metrics
 (PR metrics pending)

説明

I appreciate the addition of LeJEPA to LightlySSL, but I was confused by one aspect of the implementation as I worked through adding it to one of my projects.

In the original paper, I read the loss function as described in pseudocode on p. 11, or with standard math notation on p. 12, as a sum of contributions from all of the image views, local as well as global.

In the LightlySSL implementation of the LeJEPA loss, however, we seem to only include the contributions from the local views.

I suspect this is a bug since it seems odd to only constrain the embeddings associated with the local views during training. The original authors also describe e.g. training ResNets using only global views, and that doesn't make sense as the loss is implemented here.

Assuming my understanding is correct, I believe the fix is simple: https://github.com/lightly-ai/lightly/blob/master/lightly/loss/lejepa_loss.py#L327-L330 should pass all views, local and global, where it currently passes only local_proj, to the underlying SIGReg and invariance losses.

コントリビューターガイド