-
Notifications
You must be signed in to change notification settings - Fork 224
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
Generalize Optim.jl to be an interface for nonlinear optimization #309
Comments
For the purposes of nonlinear optimization, JuMP is just a nice an interface to AD. MathProgBase is already the "common interface" you're looking for, for constrained problems. |
I see. Then what about making Optim.jl available in the MathProgBase nonlinear interface? |
Anyone is welcome to do so. Relevant discussions: |
Need #303 to handle constraints. |
Is somebody is interested, I put together glue code to integrate |
Wonderful! Great to see someone thinking about this. I'm not sure I would use it all that often personally, but on the other hand I can see how it can be useful to some people, especially when the constrained optimization features improves. |
@gragusa if I understand correctly, your package allows you to use Optim through MPG right? It's not code that allows you to use Optim to reach NLOpt for example. |
That's correct. You specify a problem in MPB e you can solve it using
Optim.jl
…On Fri, Mar 24, 2017 at 9:25 AM Patrick Kofod Mogensen < ***@***.***> wrote:
@gragusa <https://github.com/gragusa> if I understand correctly, your
package allows you to *use* Optim through MPG right? It's not code that
allows you to use Optim to reach NLOpt for example.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#309 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAfRgpNw4apLtprO9iOGksRmc5CQrmu_ks5ro34DgaJpZM4K9Mxi>
.
|
ping @gragusa I may be wrong, but I think that maybe it makes most sense to keep OptimMPB.jl as a separate package, what about an OptimMPB.jl package in JuliaNLSolvers? We can simply move your existing package here. |
I am happy to transfer ownership of the package to JuliaNLSolvers.
I have been planning to get the package in better shape, but I waited to
see whether the work done on constrained optimization would be merged.
Probably though this is not going to happen anytime soon, so no need to
wait.
…On Sat, Jun 17, 2017 at 1:01 PM Patrick Kofod Mogensen < ***@***.***> wrote:
ping @gragusa <https://github.com/gragusa>
I may be wrong, but I think that maybe it makes most sense to keep
OptimMPB.jl as a separate package, what about an OptimMPB.jl package in
JuliaNLSolvers? We can simply move your existing package here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#309 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAfRgrZJfKWLhRn3T_jrlchNfHam834Bks5sE6_egaJpZM4K9Mxi>
.
|
I intend to make a push for getting the constrained ball rolling after JuliaCon. |
I'm trying to write and optimizer ( The first issue I ran into is a It seems we would need |
The hard coding of that is indeed going to be removed very soon! |
Great :) I hit this issue as well with my implementation of N-GMRES. |
I've hit as well. It'll be there in a week - promise! What are you implementing Jonathan? |
Nice. @pkofod I'm trying to make a composable gradient descent type that covers all possible use cases, e.g.: gd = GradientDescent(
MiniBatch(f,data,batch_size),
AdaGrad(SimpleMomentum(1e-5)),
HypergradientDescent(),
)
optimize(gd...) I'm just playing with it to see if it's feasible and desirable at the moment. Otherwise I'd also like to have a good CMA-ES implementation at some point, there's some versions around but they are not optimal afaik. |
Alright, cool. Would love to see what you cook up. |
@pkofod, https://github.com/JuliaNLSolvers/Optim.jl/blob/master/src/multivariate/optimize/optimize.jl#L33 Maybe introducing a method I also didn't found a generic fallback method for This is what I got for first order: https://gist.github.com/jonathanBieler/ed2ae8868e7b317c9e6d2db86f6ed2b9 And zeroth order: https://gist.github.com/jonathanBieler/47d9ae7e95e7ca0f7352de8f84827ae3 |
Thank you, this is very helpful. I'll have a look soon. |
Status? |
I think this might be easier with the re-write. It's not a priority of mine though. This thread also has two discussions in one I think :p |
Hi,
I have been waiting for the rewrite —- then priorities changed, but they
are about to change again (I need this for a project I am starting). So, it
should arrive in the next couple of week +- 1.96 * 0.5 week.
On Mon, 3 Jun 2019 at 14:17, Patrick Kofod Mogensen < ***@***.***> wrote:
I think this might be easier with the re-write. It's not a priority of
mine though. This thread also has two discussions in one I think :p
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#309?email_source=notifications&email_token=AAD5DAW3JZJQUPUX5M7GIGLPYUDUDA5CNFSM4CXUZRRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWZGYZA#issuecomment-498232420>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD5DARFN4EAUKPTSE35FR3PYUDUDANCNFSM4CXUZRRA>
.
--
Giuseppe Ragusa
|
Are you talking about a moi rewrite? |
That’s what I am aiming for....that is, making optim work as a solver
through a MOI interface ....
On Mon, 3 Jun 2019 at 17:02, Patrick Kofod Mogensen < ***@***.***> wrote:
Are you talking about a moi rewrite?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#309?email_source=notifications&email_token=AAD5DAQ4XIECSIJQVFPBAGDPYUXA7A5CNFSM4CXUZRRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWZV74Y#issuecomment-498294771>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD5DASYV3BJNPZJGHGTWT3PYUXA7ANCNFSM4CXUZRRA>
.
--
Giuseppe Ragusa
|
I believe @ChrisRackauckas has found his answer in GalacticOptim :) |
Yup 😄 |
I think Optim.jl is in a prime position to generalize itself as a common interface for nonlinear optimization. While JuMP has some support for nonlinear optimization, by design it won't be able to be as comprehensive what is envisioned here because JuMP's constraints have special requirements which one cannot generally follow. For example, while NLopt and IPOPT accept general constraint functions
g
, JuMP only allows functions defined within the macros, and places heavy restrictions like "no linear algebra".Thus I see Optim.jl as prime for giving a common interface to optimize a function
f
with a constraint functiong
, and expand this common interface to include non-Julia implementations, etc. Following the examples of other metapackages/ecosystems like JuMP, Plots, JuliaML, and DifferentialEquations, I propose the following structure:These parts I'd consider for an OptimBase.jl:
UnconstraintedOptProblem(f,x0)
type which holds the information for an unconstrainted optimization problem, and aConstraintedOptProblem(f,g,x0)
(and spots for Jacobians/Hessians/whatever else)optimize(prob,alg())
. This is similar to before, but allows dispatching on the problem type (which may get more refined later, likeLinearConstrainedOptProblem
or something)g
. This will allow developers to target just the constrained problem and get the other "for free" (sometimes this might make sense).I think it would be wise to then have a package for the native solvers (currently Optim.jl), and add bindings to this common interface to packages like NLOpt so
optimize(prob,GN_ISRES())
makes it easy to try methods from other packages.What do you guys think of this proposal, or of a similar design with the same goals? I for one would find this immensely useful as it would allow me to target just the single interface, but allow users the flexibility for picking backend methods from various packages.
(I also have on my mind a similar package for root finding, to blend together NLsolve, Roots.jl, and Sundials' KINSOL. Chat with me if you're interested.)
Edit: Added link to JuMP-dev Gitter Archive talking about the (lack of) possibility for this in JuMP
The text was updated successfully, but these errors were encountered: