Skip to content

postion encoding #2

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

Open
yufengm opened this issue Apr 24, 2018 · 1 comment
Open

postion encoding #2

yufengm opened this issue Apr 24, 2018 · 1 comment

Comments

@yufengm
Copy link

yufengm commented Apr 24, 2018

Are we supposing the same length for each sentence in the position encoding?

l = [[(1 - s/(slen-1)) - (e/(elen-1)) * (1 - 2*s/(slen-1)) for e in range(elen)] for s in range(slen)]

As in above, each sentence encoding is divided by the same number elen-1.

@AveryLiu
Copy link

I suppose you could pad the variated sentences length to a fixed number in the preprocessing step before feeding them into the model.

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