Skip to content

Commit

Permalink
remove margin clamping
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlatt committed Oct 30, 2024
1 parent 09cd3c2 commit 6eb3e81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightning_ir/loss/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def compute_loss(self, scores: torch.Tensor, targets: torch.Tensor) -> torch.Ten
target_margin = targets[query_idcs, pos_idcs] - targets[query_idcs, neg_idcs]
else:
raise ValueError("invalid margin type")
loss = torch.nn.functional.mse_loss(margin, target_margin.clamp(min=0))
loss = torch.nn.functional.mse_loss(margin, target_margin)
return loss


Expand Down

0 comments on commit 6eb3e81

Please sign in to comment.