r9y9 / tacotron_pytorch

PyTorch implementation of Tacotron speech synthesis model.
http://nbviewer.jupyter.org/github/r9y9/tacotron_pytorch/blob/master/notebooks/Test%20Tacotron.ipynb
Other
306 stars 79 forks source link

Why sort within batch #9

Closed tivaro closed 6 years ago

tivaro commented 6 years ago

Hi, thanks for implementing this in pytorch.

I was wondering why you are sorting the datapoints within your batch by sequence length during training

Would not doing this sorting break some assumptions / some other parts of the code?

I am using part of you model in another setup so it would be great to know if this is important.

Best,

r9y9 commented 6 years ago

This is because CuDNN's RNN API expects the inputs are sorted by length. Ref: https://discuss.pytorch.org/t/pack-padded-sequence-example/10391

However, I didn't use CuDNN's RNN anymore so it's safe to remove it.