Skip to content

Commit

Permalink
Fix TiCoLoss (#1484)
Browse files Browse the repository at this point in the history
* Detach auxiliary matrix B in loss computation
  • Loading branch information
guarin authored Jan 30, 2024
1 parent c1e3412 commit 6bd7553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightly/loss/tico_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def forward(
z_b = torch.nn.functional.normalize(z_b, dim=1)

# compute auxiliary matrix B
B = torch.mm(z_a.T, z_a) / z_a.shape[0]
B = torch.mm(z_a.T, z_a).detach() / z_a.shape[0]

# init covariance matrix
if self.C is None:
Expand Down

0 comments on commit 6bd7553

Please sign in to comment.