-
Notifications
You must be signed in to change notification settings - Fork 72
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
Functional Laplace Updated #192
Conversation
laplace/utils/utils.py
Outdated
np.random.seed(seed) | ||
self.indices = torch.tensor(np.random.choice(list(range(N)), M, replace=False)) |
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.
I see. The main issue for me is that it changes the global rng state. Can you use Numpy's generator?
Thanks for the changes! The code looks good now and passes all checks. Only small bits of changes needed this time. |
@aleximmer please review if you have chance. |
I've created two functions
This can be moved as an utils function but it might be usefull in BaseLaplace too. |
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. Once @aleximmer gives his reviews we can 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.
Thanks for the great effort. Please see the comments regarding the two variable names and let's discuss them. Other than that, it's ready to merge.
Took @metodmove's contribution from PR 55 and adapted it to the current state of the repository.
Functional Laplace can be used with
hessian='gp'
, there is an example at calibration_gp_example.py and calibration_gp_example.md.Two unit-tests are available: test_functional_laplace.py and test_functional_laplace_unit.py.