ShikunLi / Sel-CL

CVPR 2022: Selective-Supervised Contrastive Learning with Noisy Labels
90 stars 16 forks source link

Self-contrast set to -1 #3

Open chenxi52 opened 2 years ago

chenxi52 commented 2 years ago

as mentioned in https://github.com/DiegoOrtego/LabelNoiseMOIT/issues/5 , there also exits an error in your code:

There may be a mistake that the elements of first dist.size()[0] at dim 1 are always set to -1, since the features are from a minibatch. The right way is:

dist = torch.mm(features, trainFeatures) # instead of features here
dist[torch.arange(dist.size()[0]), index] = -1  ##Self-contrast set to -1