Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about Contrastive Loss Function #30

Open
mxqmxqmxq opened this issue Jan 14, 2025 · 0 comments
Open

Questions about Contrastive Loss Function #30

mxqmxqmxq opened this issue Jan 14, 2025 · 0 comments

Comments

@mxqmxqmxq
Copy link

Great work, simple and efficient! However, I have some doubts about the implementation of the NTXentLoss function. Why is the shape of logits 1024, 1023, while the shape of the labels is 1024? After that, why is a torch.nn.CrossEntropyLoss used? Why is this done this way? Isn't the general implementation simply -log(loss_positive / loss_negative)?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant