rfeinman / pytorch-minimize

Newton and Quasi-Newton optimization with PyTorch
https://pytorch-minimize.readthedocs.io
MIT License
292 stars 34 forks source link

Pytorch bfgs vs scipy bfgs #32

Closed yorard123 closed 3 months ago

yorard123 commented 4 months ago

Hi,

I have been using for a while the ScipyMinimizer interface, in specific I have been using the BFGS algorithm. Today, I migrated to the Minimizer interface, where I also used the BFGS algorithm. I found that in some scenarios both interfaces gave me different results. I have been checking the parameters, and it does not seem to be that (but I am not completely sure because finding the default ones in SciPy it does not seem to be trivial). It is expected that the behavior of both implementations to be different?

Thanks,

rfeinman commented 4 months ago

They are the same general algorithm but it is not an exact mirror. I wouldn't expect results to reproduce exactly. But there shouldn't be systematic differences between the results