MathOptFormat.jl icon indicating copy to clipboard operation
MathOptFormat.jl copied to clipboard

Can an MOF file be read in to create a MOI.NLPBlock

Open odow opened this issue 7 years ago • 6 comments

In essence: JuMP -> MOF -> MOI -> AmplNLWriter

This would aid the creation of MOI NLP tests.

odow avatar Jan 11 '19 22:01 odow

Here is a hacky way using Calculus.jl's symbolic differentiation: https://gist.github.com/odow/58a3469c9119b58069ab708431426905

odow avatar Jan 16 '19 20:01 odow

It's now significantly less hacky. The parsed functions are fast and non-allocating :)

odow avatar Jan 17 '19 20:01 odow

Instead of writing an AD framework, I'd recommend letting JuMP do the work. Load the expressions via set_NL_objective and add_NL_constraint: http://www.juliaopt.org/JuMP.jl/dev/nlp/#Raw-expression-input-1.

mlubin avatar Jan 17 '19 20:01 mlubin

That means having JuMP as a dependency of MathOptFormat? 😢

odow avatar Jan 17 '19 20:01 odow

That means having JuMP as a dependency of MathOptFormat?

Or ReverseDiff or Zygote or Casadi or CppAD or pytorch or your favorite AD framework. Using Calculus with symbolic derivatives will not scale to reasonably large models.

mlubin avatar Jan 18 '19 00:01 mlubin

I can say this because I tried using Calculus for JuMP before I knew about reverse-mode AD.

mlubin avatar Jan 18 '19 01:01 mlubin