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

Class-wise contrastive learning loss #13

Open
Kevin-Planolles opened this issue Jan 18, 2024 · 1 comment
Open

Class-wise contrastive learning loss #13

Kevin-Planolles opened this issue Jan 18, 2024 · 1 comment

Comments

@Kevin-Planolles
Copy link

The code is not clear about the CCL mentionned in the paper. It is not mentionned in the losses.py file. Is it possible to further explain where in the code this particular loss is used ?

@ChangyaoTian
Copy link
Owner

Sure. The CCL loss is implicitly implemented via the following functions:

  • The labels2idxs first generates the target matrix for the input samples, where samples from the same class will have positive target values;
  • Then the CCL loss is calculated in the PretrainSentLoss module here, where the base_criterion, (i.e. the LabelSmoothingCrossEntropy module) computes the loss of visual and linguistics branches respectively.

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

2 participants