Closed JUiscoming closed 2 years ago
Hi @JUiscoming I am sorry about this bug. And thank you for spotting, you are totally correct. I fixed it and will commit then. I also checked if any results on the paper have to be fixed or not, and confirmed no change needed. This bug was found implemented when I brought development codes to this repository.
Fixed by a0f4d8445664af37d6aa112779f62d07adfb0740
https://github.com/nttcslab/byol-a/blob/60cebdc514951e6b42e18e40a2537a01a39ad47b/byol_a/dataset.py#L80-L82
If len(wav) > self.unit_length,
length_adj
will be a negative value. Sostart
will be 0. If wav (before pad) is shorter than unit length, length_adj == 0 after padding. Sostart
is always 0. So It will only perform a certain area of crop from 0 to self.unit_length (cropped_wav == wav[0: self.unit_length]), not random crop.So I think line 80 should be changed to
length_adj = len(wav) - self.unit_length
.