GalacticOptim.jl

Build Status

GalacticOptim.jl is a package with a scope that is beyond your normal global optimization package. GalacticOptim.jl seeks to bring together all of the optimization packages it can find, local and global, into one unified Julia interface. This means, you learn one package and you learn them all! GalacticOptim.jl adds a few high level features, such as integrating with automatic differentiation, to make its usage fairly simple for most cases, while allowing all of the options in a single unified interface.

Note: This package is still in development. The README is currently both an active documentation and development roadmap.

Examples

using GalacticOptim, Optim
 rosenbrock(x,p) =  (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2
 x0 = zeros(2)
 p  = [1.0,100.0]

 prob = OptimizationProblem(rosenbrock,x0,p=p)
 sol = solve(prob,NelderMead())


 using BlackBoxOptim
 prob = OptimizationProblem(rosenbrock, x0, p = p, lb = [-1.0,-1.0], ub = [1.0,1.0])
 sol = solve(prob,BBO())
f = OptimizationFunction(rosenbrock, x0, GalacticOptim.AutoForwardDiff(), p=p) 
 prob = OptimizationProblem(f, x0, p = p)
 sol = solve(prob,BFGS())
prob = OptimizationProblem(f, x0, p = p, lb = [-1.0,-1.0], ub = [1.0,1.0])
 sol = solve(prob, Fminbox(GradientDescent()))

Automatic Differentiation Choices

While one can fully define all of the derivative functions associated with nonlinear constrained optimization directly, in many cases it's easiest to just rely on automatic differentiation to derive those functions. In GalacticOptim.jl, you can provide as few functions as you want, or give a differentiation library choice.

  • AutoForwardDiff()
  • AutoReverseDiff(compile=false)
  • AutoTracker()
  • AutoZygote()
  • AutoFiniteDiff()
  • AutoModelingToolkit()

API Documentation

OptimizationFunction(f, x, AutoForwardDiff();
                     p = DiffEqBase.NullParameters(),
                     grad = nothing,
                     hes = nothing,
                     hv = nothing,
                     chunksize = 1)
OptimizationProblem(f, x;
                    p = DiffEqBase.NullParameters(),
                    lb = nothing,
                    ub = nothing)
solve(prob,alg;kwargs...)

Keyword arguments:

  • maxiters
  • abstol
  • reltol

Output Struct: