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

Vector sum numerical accuracy #5

Open
msaroufim opened this issue Feb 23, 2025 · 0 comments
Open

Vector sum numerical accuracy #5

msaroufim opened this issue Feb 23, 2025 · 0 comments

Comments

@msaroufim
Copy link
Member

If we draw inputs from a normal distribution with 0 and variance 1 then the expected output is 0 with a variance of sqrt(N) where N is the number of input elements

There's a few common tricks to avoid this which we incorporated and I figured would be interesting enough to keep track of

  1. Shift the distribution with a random offset
  2. Instead of sampling floats we could sample integers and the values will vary much more greatly
  3. Can use a mixture of distributions
  4. Low tolerance as we get closer to law of large numbers

But TL;DR the knobs within our control are test distributions and mixtures of them, offset, scale, random seeds, shapes

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

1 participant