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 bug in ALTI's code #25

Open
gegallego opened this issue Feb 18, 2023 · 1 comment
Open

Minor bug in ALTI's code #25

gegallego opened this issue Feb 18, 2023 · 1 comment

Comments

@gegallego
Copy link

Hi,

We've recently found a minor bug in ALTI's code. It's in this line:

ln_std_coef = 1 / (out_q_pre_ln_th + eps_ln).std(-1).view(

The parameter unbiased from torch.std should be set to False, since the default is True. The expected behavior of this is without the Bessel's correction.

Relevant discussion related with this: pytorch/pytorch#50010

@avidale
Copy link
Contributor

avidale commented Feb 20, 2023

Hi @gegallego,
thank you for this remark!
Yes, indeed, the LayerNorm implementation that is used here computes the variance without the Bessel's correction (https://pytorch.org/docs/stable/generated/torch.nn.LayerNorm.html#torch.nn.LayerNorm), so should we.

I'll update the code.

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