|
1 |
| -# GalacticOptim |
| 1 | +# GalacticOptim.jl |
2 | 2 |
|
3 | 3 | [](https://travis-ci.com/Vaibhavdixit02/GalacticOptim.jl)
|
| 4 | + |
| 5 | +GalacticOptim.jl is a package with a scope that is beyond your normal global optimization |
| 6 | +package. GalacticOptim.jl seeks to bring together all of the optimization packages |
| 7 | +it can find, local and global, into one unified Julia interface. This means, you |
| 8 | +learn one package and you learn them all! GalacticOptim.jl adds a few high level |
| 9 | +features, such as integrating with automatic differentiation, to make its usage |
| 10 | +fairly simple for most cases, while allowing all of the options in a single |
| 11 | +unified interface. |
| 12 | + |
| 13 | +#### Note: This package is currently in development and is not released. The README is currently a development roadmap. |
| 14 | + |
| 15 | +## Examples |
| 16 | + |
| 17 | +```julia |
| 18 | +using GalacticOptim |
| 19 | +rosenbrock(x,p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2 |
| 20 | +x0 = zeros(2) |
| 21 | +p = [1.0,100.0] |
| 22 | + |
| 23 | +prob = OptimizationProblem(f,x0,p) |
| 24 | +sol = solve(prob,BFGS()) |
| 25 | + |
| 26 | +prob = OptimizationProblem(f,lower_bounds=[-1.0,-1.0],upper_bounds=[1.0,1.0]) |
| 27 | +sol = solve(prob,BFGS()) |
| 28 | + |
| 29 | +using BlackBoxOptim |
| 30 | +sol = solve(prob,BBO()) |
| 31 | + |
| 32 | +using Flux |
| 33 | +sol = solve(prob,ADAM(0.01),maxiters = 100) |
| 34 | +``` |
| 35 | + |
| 36 | +### Automatic Differentiation Choices |
| 37 | + |
| 38 | +While one can fully define all of the derivative functions associated with |
| 39 | +nonlinear constrained optimization directly, in many cases it's easiest to just |
| 40 | +rely on automatic differentiation to derive those functions. In GalacticOptim.jl, |
| 41 | +you can provide as few functions as you want, or give a differentiation library |
| 42 | +choice. |
| 43 | + |
| 44 | +- `AutoForwardDiff()` |
| 45 | +- `AutoReverseDiff(compile=false)` |
| 46 | +- `AutoTracker()` |
| 47 | +- `AutoZygote()` |
| 48 | +- `AutoFiniteDiff()` |
| 49 | +- `AutoModelingToolkit()` |
| 50 | + |
| 51 | +### Symbolic DSL Interface |
| 52 | + |
| 53 | +Provided by ModelingToolkit.jl |
| 54 | + |
| 55 | +### API Documentation |
| 56 | + |
| 57 | +```julia |
| 58 | +OptimizationFunction(f; |
| 59 | + grad = AutoForwardDiff(), |
| 60 | + hes = AutoForwardDiff(), |
| 61 | + eqconstraints = AutoForwardDiff(), |
| 62 | + neqconstraints = AutoForwardDiff(), |
| 63 | + eqconstraints_jac = AutoForwardDiff(), |
| 64 | + neqconstraints_jac = AutoForwardDiff(), |
| 65 | + colorvec,hessparsity,eqsparsity,neqsparsity) |
| 66 | +``` |
| 67 | + |
| 68 | +```julia |
| 69 | +OptimizationProblem(f,x0=nothing,p=nothing; |
| 70 | + lower_bounds=nothing, |
| 71 | + upper_bounds=nothing) |
| 72 | +``` |
| 73 | + |
| 74 | +```julia |
| 75 | +solve(prob,alg;kwargs...) |
| 76 | +``` |
| 77 | + |
| 78 | +Keyword arguments: |
| 79 | + |
| 80 | + - `maxiters` |
| 81 | + - `abstol` |
| 82 | + - `reltol` |
| 83 | + |
| 84 | +Output Struct: |
0 commit comments