facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.43k stars 6.4k forks source link

Wav2vec2 negtive sampling, little bug #3189

Open yuanenming opened 3 years ago

yuanenming commented 3 years ago

https://github.com/pytorch/fairseq/blob/148327d8c1e3a5f9d17a11bbb1973a7cf3f955d3/fairseq/models/wav2vec/wav2vec2.py#L397

In the wav2vec2 implementation, the above line of code tends to sample negatives from somewhere else instead of the current position.

but it will fail when set negatives_from_everywhere to be True.

I know that will be overlooked when compute logits. but it is not consistent with the scenarios when negatives_from_everywhere is False, which may be an error cause.

alexeib commented 3 years ago

you're right, thats a bug though prob wont change much. any proposal on how to fix it?