-
Notifications
You must be signed in to change notification settings - Fork 221
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
misreported non-convergence of convex function #374
Comments
You are hitting the Optim.optimize(β -> -ℓ_logistic_regression(X, N0, N1, β),
init_logistic_regression(X, N0, N1),
BFGS(), Optim.Options(autodiff = false,allow_f_increases=true)) # change the last line for various results
Results of Optimization Algorithm
* Algorithm: BFGS
* Starting Point: [-1.7194691162922449,-0.277037866088451, ...]
* Minimizer: [-1.8220201057317167,-0.2518974050806891, ...]
* Minimum: 5.882142e+04
* Iterations: 19
* Convergence: true
* |x - x'| < 1.0e-32: false
* |f(x) - f(x')| / |f(x)| < 1.0e-32: true
* |g(x)| < 1.0e-08: false
* f(x) > f(x'): true
* Reached Maximum Number of Iterations: false
* Objective Function Calls: 76
* Gradient Calls: 76 I don't do much regression, but it looks to me that your system is quite poorly scaled (minimum value larger than 10^4) |
Maybe we should reword that output a bit. |
Definitely. |
From the tolerances given by the user, the BFGS algorithm has not converged. It is close to the correct solution, but because of poor scaling(maybe?) and finite differences it has not reached the supplied tolerances. |
That part Yes, but I think most users will fail to see the increased part in the output that was posted and realize what happened. |
My bad — the optimization packages (not in Julia) I have been using up to now had termination criteria like
which are less sensitive to scaling of the objective, and I did not realize that here they are relative, not absolute. I wonder if the above criteria would make sense for |
I was wondering what the best way would be for incorporating the convergence criteria above into Optim, so that I could submit a PR. They generalize with parameters α, β as
where α=β=0 is the current convergence criterion and α=β=1 is the proposed one. |
The current convergence checks can be found here: https://github.com/JuliaNLSolvers/Optim.jl/blob/master/src/utilities/assess_convergence.jl I agree that it would be useful to implement other types of convergence criteria (esp. relative ones). Maybe even make it modular so that the user can supply their own tests as well? (Or can this be done with callbacks already?)
I believe the current check on the gradient the absolute |
What packages in particular? |
Yes |
Closing this, as it was a misunderstanding of the output. We can continue the discussion about stopping criteria in a dedicated issue. |
This is an MWE I reduced from a bigger problem (finding ML estimates of a logistic regression using summary statistics).
optimize
always finds the same minimizer (as expected, since the function is convex; I also compared toGLM.jl
). But forBFGS()
without autodiff, it reports non-convergence, with autodiff it reports convergence. ForConjugateGradient
, it reports non-convergence, with and without autodiff.eg
The text was updated successfully, but these errors were encountered: