ADNLPModelss

This package provides AD-based model implementations that conform to the NLPModels API. The following packages are supported:

  • ForwardDiff.jl: default choice.
  • Zygote.jl: you must load Zygote.jl separately and pass ADNLPModels.ZygoteAD() as the adbackend keyword argument to the ADNLPModel or ADNLSModel constructor.
  • ReverseDiff.jl: you must load ReverseDiff.jl separately and pass ADNLPModels.ReverseDiffAD() as the adbackend keyword argument to the ADNLPModel or ADNLSModel constructor.

Install

Install ADNLPModels.jl with the following command.

pkg> add ADNLPModels

Usage

This package defines two models, ADNLPModel for general nonlinear optimization, and ADNLSModel other for nonlinear least-squares problems.

ADNLPModels.ADNLPModelType
ADNLPModel(f, x0)
ADNLPModel(f, x0, lvar, uvar)
ADNLPModel(f, x0, c, lcon, ucon)
ADNLPModel(f, x0, lvar, uvar, c, lcon, ucon)

ADNLPModel is an AbstractNLPModel using automatic differentiation to compute the derivatives. The problem is defined as

 min  f(x)
s.to  lcon ≤ c(x) ≤ ucon
      lvar ≤   x  ≤ uvar.

The following keyword arguments are available to all constructors:

  • name: The name of the model (default: "Generic")

The following keyword arguments are available to the constructors for constrained problems:

  • lin: An array of indexes of the linear constraints (default: Int[])
  • y0: An inital estimate to the Lagrangian multipliers (default: zeros)
source
ADNLPModels.ADNLSModelType
ADNLSModel(F, x0, nequ)
ADNLSModel(F, x0, nequ, lvar, uvar)
ADNLSModel(F, x0, nequ, c, lcon, ucon)
ADNLSModel(F, x0, nequ, lvar, uvar, c, lcon, ucon)

ADNLSModel is an Nonlinear Least Squares model using ForwardDiff to compute the derivatives. The problem is defined as

 min  ½‖F(x)‖²
s.to  lcon ≤ c(x) ≤ ucon
      lvar ≤   x  ≤ uvar

The following keyword arguments are available to all constructors:

  • linequ: An array of indexes of the linear equations (default: Int[])
  • name: The name of the model (default: "Generic")

The following keyword arguments are available to the constructors for constrained problems:

  • lin: An array of indexes of the linear constraints (default: Int[])
  • y0: An inital estimate to the Lagrangian multipliers (default: zeros)
source

Check the Tutorial for more details on the usage.

License

This content is released under the MPL2.0 License.

Contents