Skip to content

Commit

Permalink
Update lightly/loss/detcon_loss.py
Browse files Browse the repository at this point in the history
Co-authored-by: guarin <[email protected]>
  • Loading branch information
liopeer and guarin authored Jan 6, 2025
1 parent 78e6c85 commit 9e37f70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightly/loss/detcon_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ def _same_mask(mask0: Tensor, mask1: Tensor) -> Tensor:
dimensions is for the regions/masks of the first view and the last :math:`M`
dimensions is for the regions/masks of the second view. For every sample
:math:`k` in the batch (separately), the tensor is effectively a 2D index
matrix where the entry :math:`(k, i, :, j)` is 1 if the masks :math:`m_i`
and :math:`m_j'` are the same and 0 otherwise.
matrix where the entry :math:`(k, i, :, j)` is 1 if the masks :math:`mask0(k, i)`
and :math:`mask1(k, j)'` are the same and 0 otherwise.
"""
return (mask0[:, :, None] == mask1[:, None, :]).float()[:, :, None, :]

Expand Down

0 comments on commit 9e37f70

Please sign in to comment.