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

Minor correction in 'Add & Norm' logic in Block Class in gpt.py #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AbhishekAshokDubey
Copy link

@AbhishekAshokDubey AbhishekAshokDubey commented Jul 13, 2023

Updating the forward function in Transformer block.

The change is simple, but still trying my best to explain below:

As per original paper: In 'Add & Norm' block of Transformer, Layer Norm is applied on top of => input/ residual and output of Self-attention. While in the current code, layer Norm is applied first & then added back to the input/ residual.

Updating the forward function in Transformer block.

The code is simple to example the pull request, but still trying my best to explain below:

As per paper: In 'Add & Norm' block of Transformer, Layer Norm is applied on top of input/ residual & output of Self-attention. While in the current code, first layer Norm is applied & then added back to the input/ residual.
@AbhishekAshokDubey AbhishekAshokDubey changed the title Update gpt.py Minor correction in 'Add & Norm' logic in Block Class in gpt.py Jul 13, 2023
@reallyigor
Copy link

See 1:35:33

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

Successfully merging this pull request may close these issues.

2 participants