Implement a minimizer for INLA#513
Conversation
|
Currently there's a few outstanding TODOs. These are just issues getting quality-of-life features to work with pytensor - the actual algorithm itself works fine. Please find the TODOs listed as comments in the code, and use the code in |
| model: pm.Model | None = None, | ||
| method: minimize_method = "BFGS", | ||
| use_jac: bool = True, | ||
| use_hess: bool = False, # TODO Tbh we can probably just remove this arg and pass True to the minimizer all the time, but if this is the case, it will throw a warning when the hessian doesn't need to be computed for a particular optimisation routine. |
There was a problem hiding this comment.
I'm not really sure why these are options here. Presumably, the minimization method itself knows what it needs and it's redundant to specify use_jac or use_hess here at all.
|
@ricardoV94 @jessegrabowski The unittests currently seem to be failing because the current release of pytensor doesn't have optimize in it yet. Would it be possible to make a point release to so we can merge this? |
|
@Michal-Novomestsky whenever you are ready for review, remove the Draft status. It looks like there is a small bug in the unit test, but good otherwise! |
|
Well done getting this merged |
Addresses #342.
This PR should add:
get_conditional_gaussian_approximationTo get the mode and the laplace approximation at that point.
Contingent on pymc-devs/pytensor#1182, as it uses
pytensor.tensor.optimize.minimizeto find the mode (and hessian at that point).