-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FIX: spectral_embedding.py initial eigenvector approximations for LOBPCG and AMG solvers should be randn not rand #21565
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
Conversation
rand -> randn for LOBPCG and AMG eigensolvers
Could you please add a non-regression test with a toy dataset where the uniform sampling would lead to bad results while the gaussian is good? |
@ogrisel It's not trivial since it's random. It would require a fixed seed and would be platform-dependent, as most effects of numerical instability are. It's a common understanding that randn should be used here, not rand; see my notes in #21555 In the previous PR we were going just to merge it. Can we do it? |
@ogrisel could you please merge this trivial change? |
@ogrisel or anyone else - could we please just merge this trivial change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is in the original paper, then I think we can considered this PR a bug fix. Can you point to the section in the paper that specifies the initial distribution? (I am unable to find it)
added 2 changed models as requested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise this looks good to me. I left some comments about the "Change Model" section.
accepted proposed editing
@thomasjpfan - all fixed, thanks again for your help! Ready to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ready to merge, I suppose. |
The corresponding change in This PR is ready to merge IMHO |
Since this PR could result in a model change, I think this PR requires a second review. Maybe @ogrisel ? |
@ogrisel or anyone else - could you please review and merge this trivial change, while there is no conflict yet? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, sorry for the slow response time.
rand -> randn for LOBPCG and AMG eigensolvers
Reference Issues/PRs
Fixes #21555. See also #21534