-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add ability to pass options to SciPy minimizers #1060
Conversation
for more information, see https://pre-commit.ci
Thanks, I am happy to include this patch, after some refinement. |
Co-authored-by: Hans Dembinski <HDembinski@users.noreply.github.com>
Co-authored-by: Hans Dembinski <HDembinski@users.noreply.github.com>
@lvarriano Are you still working on that test? Looks like this is almost done and it would be nice to merge soon. The test should be something simple, but you would certainly know better. You said that by setting certain options you were able to improve performance. I suggest to add a toy example where this can be seen. Performance would be measured in numbers of function calls until convergence. |
Added unit test for scipy options to show their benefit
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Sorry for the delay! We've added a simple test to show the precision of the result improves when the SciPy tolerances are adjusted. This is a stand-in for a problem we're having performing extended unbinned analyses with low amounts of data, which is typical for our experiment. |
Thanks, that is a good demonstration. Without options you cannot manipulate the stopping criterion. Minuit has its own tolerance, but it cannot be easily mapped to the multiple tolerances that scipy offers. |
The various SciPy minimizers have different options that can be adjusted to change and improve performance. Presently, the iminuit API does not allow passing options to these minimizers, which limits their usefulness for some minimization problems (specifically mine). I added a parameter to minuit.scipy() to allow passing options to scipy.optimize.minimize(). It keeps the existing default options that were being passed and allows for these defaults to be overwritten by the user.