tensorflow / probability

Probabilistic reasoning and statistical analysis in TensorFlow
https://www.tensorflow.org/probability/
Apache License 2.0
4.25k stars 1.1k forks source link

Allow optional initial inverse Hessian scaling in bfgs.minimize #1757

Closed gmjw closed 11 months ago

gmjw commented 1 year ago

This aims to address issue #1754.

As stated in that issue, previous code did not allow for clean iterative use of the BFGS algorithm. I believe this setup does, by making the scaling on the first iteration optional.

gmjw commented 1 year ago

This is my first PR to Python files in this repo. Any advice on style/setup would be much appreciated.

I've tried to show in the added test that the option is having its intended effect - allowing us to choose whether to apply initial inverse Hessian scaling or not. And the test also shows that the scaling is working as intended: adjusting the early behaviour of the fit without changing the eventual maximum identified.