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

Computational Error on PositionalEncoder() #7

Open
jacobastern opened this issue May 8, 2019 · 1 comment
Open

Computational Error on PositionalEncoder() #7

jacobastern opened this issue May 8, 2019 · 1 comment

Comments

@jacobastern
Copy link

I read your blog post in TowardsDataScience on this model, and I think there may be a computational error in line 27 of Transformer/Embed.py. In the paper and in other implementations, like this one, we should have PE_(pos, 2i+1) = math.cos(pos / (10000 ** ((2 * i)/d_model))), not math.cos(pos / (10000 ** ((2 * (i + 1))/d_model))), as the code currently stands.

@orena1
Copy link

orena1 commented Jul 23, 2019

I think @jastern33 is correct, this is the result from this github:
image

And this is from - http://nlp.seas.harvard.edu/2018/04/03/attention.html
image

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