Skip to content

Commit

Permalink
Fix VICRegLoss (remove extra de-mean)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippmwirth authored Dec 13, 2023
1 parent f3fd4a3 commit 7cf2970
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lightly/loss/vicreg_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def variance_loss(x: Tensor, eps: float = 0.0001) -> Tensor:
eps:
Epsilon for numerical stability.
"""
x = x - x.mean(dim=0)
std = torch.sqrt(x.var(dim=0) + eps)
loss = torch.mean(F.relu(1.0 - std))
return loss
Expand Down

0 comments on commit 7cf2970

Please sign in to comment.