Hello everyone,
we’re happy to announce NLPModels.jl v0.1.0, a package providing ways to create Nonlinear Programming Models with a standardized API. This allows the creation of algorithms that can rely on that API to access the objective and constraints functions and their derivatives.
The package provides a few models, and some extensions have already been made:
- ADNLPModel: A model using automatic differentiation;
- SimpleNLPModel: A simple wrapper for used defined functions;
- MathProgNLPModel: A model that converts MathProgBase models to NLPModels. Especially useful for JuMP models, such as the ones already created in OptimizationProblems.jl;
- CUTEstModel from CUTEst.jl: A model created from the Constrained and Unconstrained Testing Environment library;
- AmplModel from AmplNLReader.jl: A model created from an AMPL model.
A simple example (after installing ForwardDiff
)
nlp = ADNLPModel(x -> (x[1] - 1)^2 + 100*(x[2] - x[1]^2)^2, [-1.2; 1.0])
x = nlp.meta.x0 # [-1.2; 1.0]
obj(nlp, x) # Returns f(x)
g(x) = grad(nlp, x) # Returns the gradient at x
H(x) = hess(nlp, x) # Returns the lower triangle of the Hessian at x
Check the tutorial for more details, including an implementation of a Steepest Descent method using NLPModels.
Check our other packages too: JuliaSmoothOptimizers
Best,
Abel S. Siqueira