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

The loss for contrastive learning over domains #5

Open
AtsuMiyai opened this issue Jul 10, 2023 · 0 comments
Open

The loss for contrastive learning over domains #5

AtsuMiyai opened this issue Jul 10, 2023 · 0 comments

Comments

@AtsuMiyai
Copy link

Thanks for your very interesting research.

I have some questions about the code of L402 in trainers/dapl.py

loss_x = F.cross_entropy(output_x[:, :self.n_cls], label)

The original paper states that contrastive learning helps transfer learning.
But, to my understanding, in the above code, this operation does not perform contrastive learning over multi-domain and it seems to simply perform contrastive learning over single-domain.

To perform contrastive learning over multi-domain, I think I need to change the code in the following, right?
loss_x = F.cross_entropy(output_x[:, :-self.n_cls], label)

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