Ensure positive index is not chosen in negatives
senthilps8 opened this issue · comments
Senthil Purushwalkam commented
Shouldn't you ensure idx != y
here?
This probably is not a big deal for ImageNet-scale datasets, but might cause issues in smaller datasets.
lemniscate.pytorch/lib/NCEAverage.py
Line 88 in 34c7ce3
zhirongw commented
@senthilps8 , I guess you are absolutely correct. The code here is not exactly right.
In smaller dataset, sampling is actually not needed. You can switch to the full softmax loss as in Cifar10.
Yonglong Tian commented
@senthilps8 , according to my observation, this does not affect the final performance.
Senthil Purushwalkam commented
@HobbitLong Thanks for confirming.