Skip to content

Commit

Permalink
Remove extra de-mean
Browse files Browse the repository at this point in the history
  • Loading branch information
philippmwirth committed Dec 13, 2023
1 parent 66ad1b4 commit 3040372
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 3040372

Please sign in to comment.