xuguodong03 / SSKD

[ECCV2020] Knowledge Distillation Meets Self-Supervision
233 stars 47 forks source link

Contrastive loss #10

Open Liuyang829 opened 3 years ago

Liuyang829 commented 3 years ago

Thanks for your great work. In the second stage of training teacher network, you train SS module with contrastive loss, just meantioned as Eq(5) in your paper.But I only see a normal cross_entropy loss in this module. How does this Eq reflected in your code? Does the ss_T means the t in Eq5?

I also have a question that in your code about similarity,we all have: simi = F.cosine_similarity(s_aug_feat, s_nor_feat, dim=1) The aug_feat means the sample after transformation, the nor_feat is the same sample expanded by 3 times to make the size consistence to calculate similarity. But I think all of the simi calcuation are positive pairs. Where are the negative pairs? Thank you.