Closed DAVEISHAN closed 4 years ago
@alessiamarcolini pl help me with this issue.
Hi DAVEISHAN,
All negative are taken into consideration. You can check that is the case, by looking at the similarity matrix dimensions. Note that the embeddings are duplicated before computing the matrix, in this way we make sure that we get all negatives. Moreover, you can count the number of negatives your-self. Each positive should have 2×(N−1) negatives. Just put a breakpoint at _negatives = similarity_matrix ... and check the number of columns of the matrix.
Hope it helps.
Hi @sthalles , Thank you for sharing your code!
Pl correct me if I am wrong: I see that in line loss/nt_xent.py line 57 (below) you are not computing contrastive loss for all negative pairs as you are reshaping total negatives in 2D array i.e. only a part of negative pairs are being used for a single positive pair, right? :
Hope to hear from you soon.
-Ishan