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

Fix Layernorm Implementation #31

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

Conversation

Xue10
Copy link

@Xue10 Xue10 commented Sep 30, 2024

According to the formula
norm = (x - mean) / sqrt(var + eps) not (x - mean)/(std + eps)
sqrt(var + eps) == sqrt(std**2 + eps) != (std + eps)
Though the difference may be small, it is not a strictly correct implementation of LayerNorm.

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.

1 participant