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

Can this be used for Laplace approximation? #224

Open
blackblitz opened this issue May 9, 2024 · 1 comment
Open

Can this be used for Laplace approximation? #224

blackblitz opened this issue May 9, 2024 · 1 comment

Comments

@blackblitz
Copy link

In Laplace approximation, the Hessian of the loss function is computed for quadratic approximation. Can this package be used to do a block-diagonal approximation of the Hessian at the minimum? If yes, could you please show (using jax and flax) how to approximate it and define a quadratic approximation of the loss function (which should be something like 1/2 (theta - theta_star)^T H(L)(theta_star) (theta - theta_star), where theta_star is the minimum and H(L) is the Hessian of the loss function)?

@botev
Copy link
Contributor

botev commented Aug 30, 2024

Hi, yes, this can be used for a Laplace approximation. In particular you can take a look at the CurvatureEstimator and how it can be used. We don't have code for that, but it can be fairly straightforward to do it. There are however several details that one might need to pay attention to, such as:

  1. The code in the library estimates the "average" GGN/Fisher, which means that if you have a prior, you need to rescale it by 1/N
  2. The approximation to the GGN might not be a perfect approximation to the full GGN, so you might want to consider techniques which can mitigate that.

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