Skip to content
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

Offer iterator interface #599

Open
GiggleLiu opened this issue May 5, 2018 · 3 comments · May be fixed by #745
Open

Offer iterator interface #599

GiggleLiu opened this issue May 5, 2018 · 3 comments · May be fixed by #745

Comments

@GiggleLiu
Copy link

Using iterator interface, we can make the optimizer like a white box,

for info in optimize_iterator(func, x0, solver)
    println("Step = ", info["istep"])
    println("x = ", info["x"])
    println("f = ", info["f"])
   solver.PARAMETER = PARAMETER
    ...
end

This kind of interface is very welcome is debugging, tunning optimizer et. al.
Please consider ~

A python version is of white box optimizer is https://github.com/BRML/climin

@pkofod
Copy link
Member

pkofod commented May 6, 2018

Well, this is actually already sort of possible, but we just havn't explained how to do it anywhere. Look at the main loop for most of the algorithms here https://github.com/JuliaNLSolvers/Optim.jl/blob/master/src/multivariate/optimize/optimize.jl#L22 . We can make an explicit version like the on you show. Each next call would just iterate on the loop shown in the code I linked to.

@GiggleLiu
Copy link
Author

@pkofod
Cool, as it is a simple interface trick, will you do it immediately or need a pr?

@pkofod
Copy link
Member

pkofod commented May 7, 2018

will you do it immediately or need a pr?

I don't have time right now, but if you want to have a go at a PR, I'd be happy to review and help. Otherwise, I'll get to it as soon as I can.

@tkf tkf linked a pull request Sep 9, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants