Closed qishibo closed 2 years ago
I think code should like this:
self.queue = torch.cat((keys.T, self.queue), 1)
self.queue = self.queue[:,0:self.K]
The self.queue is randomly initialized. We need to fill the queue first, and then update it from left to right, which is equivalent to FIFO
The queue code seems to limit the batch size to only the whole divisors of K, why have this limitation? Is it a problem with cut off pieces at the end of the queue (being removed), ie incomplete representations?
Hi, I am a little confused about the code of _dequeue_and_enqueue
https://github.com/facebookresearch/moco/blob/main/moco/builder.py#L53-L66
this implement will update queue gradually, just as below:
but as described in your paper, the tensor which will be replaced should be pushed into the queue[left side] and the oldest should be removed[right side], just as fisrt-in-first-out, but the code above just replace
red rectangle
from left to right, so I'm confused about your code.Paper: