Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with sequences with different lengths? #41

Open
sunhaozhepy opened this issue Oct 27, 2022 · 1 comment
Open

How to deal with sequences with different lengths? #41

sunhaozhepy opened this issue Oct 27, 2022 · 1 comment

Comments

@sunhaozhepy
Copy link

Thank you for your great work! I've read your paper and am having trouble understanding generating sequences with different lengths. It seems to me that as you fix n=64 in experiments, you can't change it anymore as the hidden size d'=n*d in Transformer is fixed. As a result, it should be impossible during inference time to generate sequences with length other than 64...?

@XiangLi1999
Copy link
Owner

Hi,

Thanks for the question!

We can generate sentences shorter than length 64 via padding. If the training script sets --padding_mode pad, then the format will be [BOS][SENTENCE][EOS][PAD][PAD][PAD]...

You could try decoding from this model by running batch_decode.py on https://drive.google.com/drive/folders/110CA22rwu_3EcllPYGhql0TnYeOBY77d
and you will observe the padding pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants