probml / pyprobml

Python code for "Probabilistic Machine learning" book by Kevin Murphy
MIT License
6.45k stars 1.52k forks source link

update logreg laplace to use bijax #1077

Open murphyk opened 2 years ago

murphyk commented 2 years ago

https://github.com/probml/pyprobml/blob/master/notebooks/book1/10/logreg_laplace_demo.ipynb

willtryagain commented 1 year ago

can I work on this? I am not so familiar with tfp ( i am guessing that is bijax), but I have used TensorFlow and have done courses on Probability and Statistics.

murphyk commented 1 year ago

Sure. You don't need to use tfp, and we don't even need bijax. I suggest you code the laplace approximation from scratch, similar to https://github.com/probml/pyprobml/blob/master/notebooks/book1/04/laplace_approx_beta_binom_jax.ipynb which is used to compute fig 7.3b in book2 (see below). You just need to compute the MAP estimate using a optimizer (eg BFGS) then compute the Hessian, to get the posterior precision.

Screenshot 2023-01-26 at 5 37 46 PM
willtryagain commented 1 year ago

Hey, I just wanted to inform I am still working on this. The code/math is not very easy to understand for me. However, as it is also not very long so I guess I can do it.