Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RFC Common internal optimizers API #14248

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

Open
rth opened this issue Jul 3, 2019 · 1 comment
Open

RFC Common internal optimizers API #14248

rth opened this issue Jul 3, 2019 · 1 comment
Labels

Comments

@rth
Copy link
Member

rth commented Jul 3, 2019

Linear models and neural nets use a number of optimizer functions/solvers e.g. (fmin_l_bfgs_b (scipy), newton_cg etc). For some solvers (e.g. lbfgs) the individual estimators then needs to check that the convergence happened, and print the appropriate warning. This is done more or less well and sometimes differently depending on the estimator (e.g. #9274 (comment) recently). Other solvers check the convergence internally.

scipy has done some work to unify optimizers with the scipy.optimize.minimize interface. I think it might make sense to use that API when possible (I haven't done a detailed analysis yet to detect possible issues), and check the resulting OptimizeResult object.

This should allow to,

  • remove some redundant code in estimators by reusing the same helper functions.
  • increase confidence that we are properly checking for the successful convergence
  • although it doesn't directly address it, having a common solvers API might help if we want to tackle the issue of determining equivalent stopping criterion (tol) between solvers.
  • would help to support third party solvers in the future.

TBH, I'm not sure how much of this can really be generalized outside of lbfgs, that can use a few helper functions to check convergence.

Also related to #9405 that includes a Iteratively Reweighted Least Squares (IRLS) solver.

Comments are welcome.

@amueller
Copy link
Member

amueller commented Jul 3, 2019

Not sure if that is actually applicable but feel free to figure it out ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants