-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Help Wanted] Why take the log function and then apply exp? #1778
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
Labels
Comments
@albanD can you respond to this? |
Which log/exp are you talking about exactly?
|
\assigntome |
4 tasks
carljparker
added a commit
that referenced
this issue
Jun 2, 2023
* Update transformer_tutorial.py Add description for positional encoding calculation for Transformers * Update Positional Encoding description in transformer_tutorial.py * Update transformer_tutorial.py --------- Co-authored-by: Carl Parker <[email protected]>
4 tasks
svekars
pushed a commit
that referenced
this issue
Jun 2, 2023
svekars
pushed a commit
that referenced
this issue
Jun 2, 2023
@Superhzf explained in the blog https://medium.com/@hunter-j-phillips/positional-encoding-7a93db4109e6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In line of code, you calculate positional encoding for Transformers by taking the log first and then apply the exponential function.
Would you please elaborate on why you do this instead of directly doing the calculation?
I'm aware that log transformation can make multiplication become addition, but it seems that this is not the case here.
cc @suraj813
The text was updated successfully, but these errors were encountered: