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

About learnable centers in Paco-loss #20

Open
butcher1226 opened this issue Feb 18, 2023 · 2 comments
Open

About learnable centers in Paco-loss #20

butcher1226 opened this issue Feb 18, 2023 · 2 comments

Comments

@butcher1226
Copy link

In your paper, you mentioned that when calculating Paco-loss for sample xi, the learnable centers cj,j=1...m, are also included as positive/negative samples, besides, the centers seen as positive samples share a different weight compared to other positive samples which are data samples not centers.
However, I checked the codes of GPaco and Paco, finding no use of centers in PacoLoss.
When reproducing your work, I find taking centers into consideration even badly hurts the model performance.
Could you tell the reason? I am quite bothered by this issue.

@jiequancui
Copy link
Collaborator

Hi,

Thanks for your interest in our work.
The learnable centers are just the learnable weights of the linear layer.
https://github.com/dvlab-research/Parametric-Contrastive-Learning/blob/main/GPaCo/LT/losses.py#28, the sup_logits are the dot products of sample features and the learnable centers.

Welcome to discuss questions about work.

@butcher1226
Copy link
Author

Thanks for your reply!
I find there is a small error in 'MOCO/builder.py', when initialized momentum queue, the code is 'nn.functional.normalize(self.queue, dim=0)', however the dim should = 1. In 'Moco' code, dim=0 for queue.shape=[feat_dim, K], in your code, queue.shape=[K, feat_dim], so dim should =1, but I think it doesn't matter actually:)

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