lightly icon indicating copy to clipboard operation
lightly copied to clipboard

NNCLR:queue_size

Open TryHard-LL opened this issue 4 years ago • 2 comments

Hi, In paper " With a Little Help From My Fridens:Nearest-Neighbor Contrastive Learning of Visual Representations", the queue size of the support is kept large enough so as to approximate the full dataset distribution in the embedding space. So the queue size is seted by the dataste and the larger, the better? If the dataset is pretty much, the queue size is larger , and the feature in queue may be inconsistent .

Thanks.

TryHard-LL avatar Oct 28 '21 12:10 TryHard-LL

I think the most important factor is that the number of samples in the queue (support set) is larger than the number of classes. If you have for example a dataset with 10 classes but only a queue of 5 you might end up picking nearest neighbors who are from another class. (e.g. a "car" gets replaced with its nearest neighbor that is now a "dog" because there are no cars in the queue of 5).

In the paper, there is a table regarding the impact of the support set size. A larger set seems to lead to an increase in accuracy. But keep in mind that you also might eat up lots of memory space because you need to keep track of the whole support set. image

IgorSusmelj avatar Oct 30 '21 23:10 IgorSusmelj

I set the queue size and the dataset size to be consistent , but I have got a worse result.

TryHard-LL avatar Oct 31 '21 03:10 TryHard-LL