HobbitLong / SupContrast

PyTorch implementation of "Supervised Contrastive Learning" (and SimCLR incidentally)
BSD 2-Clause "Simplified" License
2.98k stars 525 forks source link

Why use two anchors? #124

Open qiaoyu1002 opened 1 year ago

qiaoyu1002 commented 1 year ago

Dear author,

I dont understand why we should use two anchors? what is the benefit of using two anchors?

    if self.contrast_mode == 'one':
        anchor_feature = features[:, 0]
        anchor_count = 1
    elif self.contrast_mode == 'all':
        anchor_feature = contrast_feature
        anchor_count = contrast_count    // here, in "all" mode, the anchor_count  is 2

May I ask the reason why. Thank you

YuQiao0303 commented 1 year ago

Same question. And your name backwards is my name hahahaha