Closed icorley-bsky closed 3 years ago
I think the code is fine, it is a desired feature. You can refer to this issue to find out why this is set to zero. Simply speaking, positive sample is always on position 0 in the logits.
Close the issue for now, feel free to reopen it if you have further questions.
The implementation of the InfoNCE loss
NCESoftmaxLoss
seems to have a bug in it. You seems to be setting the labels to all zeros where there is no indicator for positive pairs but instead everything is a negative pair. Is this a desired feature or a bug?https://github.com/amazon-research/video-contrastive-learning/blob/9a8d0473fd938dd77dfa6db2762abbc567da040e/models/Contrast.py#L14-L23