Skip to content

Commit 3c1e43f

Browse files
Merge branch 'master' into master
2 parents bb3cdcc + b2e0d1d commit 3c1e43f

File tree

26 files changed

+723
-240
lines changed

26 files changed

+723
-240
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- OptimizationQuadDIRECT
3737
- OptimizationSpeedMapping
3838
- OptimizationPolyalgorithms
39+
- OptimizationNLPModels
3940
version:
4041
- '1'
4142
steps:

.github/workflows/Downgrade.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1212
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1313
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
1414
OptimizationBase = "bca83a33-5cc9-4baa-983d-23429ab6bcbb"
15-
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1615
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1716
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
1817
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
@@ -30,7 +29,6 @@ LinearAlgebra = "1.10"
3029
Logging = "1.10"
3130
LoggingExtras = "0.4, 1"
3231
OptimizationBase = "1.3.3"
33-
Pkg = "1"
3432
Printf = "1.10"
3533
ProgressLogging = "0.1"
3634
Reexport = "1.2"

docs/Project.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84"
1212
Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
1313
Manopt = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
1414
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
15+
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
16+
NLPModelsTest = "7998695d-6960-4d3a-85c4-e1bceb8cd856"
1517
NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
1618
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
1719
OptimizationBBO = "3e6eede4-6085-4f62-9a71-46d9bc1eb92b"
@@ -24,6 +26,7 @@ OptimizationMOI = "fd9f6733-72f4-499f-8506-86b2bdd0dea1"
2426
OptimizationManopt = "e57b7fff-7ee7-4550-b4f0-90e9476e9fb6"
2527
OptimizationMetaheuristics = "3aafef2f-86ae-4776-b337-85a36adf0b55"
2628
OptimizationMultistartOptimization = "e4316d97-8bbb-4fd3-a7d8-3851d2a72823"
29+
OptimizationNLPModels = "064b21be-54cf-11ef-1646-cdfee32b588f"
2730
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"
2831
OptimizationNOMAD = "2cab0595-8222-4775-b714-9828e6a9e01b"
2932
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
@@ -35,6 +38,8 @@ OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
3538
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
3639
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
3740
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
41+
SymbolicAnalysis = "4297ee4d-0239-47d8-ba5d-195ecdf594fe"
42+
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
3843
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
3944
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
4045

@@ -51,6 +56,8 @@ Juniper = "0.9"
5156
Manifolds = "0.9"
5257
Manopt = "0.4"
5358
ModelingToolkit = "9"
59+
NLPModels = "0.21"
60+
NLPModelsTest = "0.10"
5461
NLopt = "0.6, 1"
5562
Optimization = "3"
5663
OptimizationBBO = "0.1, 0.2, 0.3"
@@ -63,6 +70,7 @@ OptimizationMOI = "0.1, 0.2, 0.3, 0.4"
6370
OptimizationManopt = "0.0.2, 0.0.3"
6471
OptimizationMetaheuristics = "0.1, 0.2"
6572
OptimizationMultistartOptimization = "0.1, 0.2"
73+
OptimizationNLPModels = "0.0.1"
6674
OptimizationNLopt = "0.1, 0.2"
6775
OptimizationNOMAD = "0.1, 0.2"
6876
OptimizationOptimJL = "0.1, 0.2, 0.3"
@@ -74,5 +82,7 @@ OrdinaryDiffEq = "6"
7482
ReverseDiff = ">= 1.9.0"
7583
SciMLBase = "2.30.0"
7684
SciMLSensitivity = "7"
85+
SymbolicAnalysis = "0.3"
86+
Symbolics = "6"
7787
Tracker = ">= 0.2"
7888
Zygote = ">= 0.5"

docs/pages.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pages = ["index.md",
3636
"PRIMA.jl" => "optimization_packages/prima.md",
3737
"Polyalgorithms.jl" => "optimization_packages/polyopt.md",
3838
"QuadDIRECT.jl" => "optimization_packages/quaddirect.md",
39-
"SpeedMapping.jl" => "optimization_packages/speedmapping.md"
39+
"SpeedMapping.jl" => "optimization_packages/speedmapping.md",
40+
"NLPModels.jl" => "optimization_packages/nlpmodels.md"
4041
]
4142
]

docs/src/getting_started.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
# Getting Started with Optimization in Julia
1+
# Getting Started with Optimization.jl
22

33
In this tutorial, we introduce the basics of Optimization.jl by showing
4-
how to easily mix local optimizers from Optim.jl and global optimizers
5-
from BlackBoxOptim.jl on the Rosenbrock equation. The simplest copy-pasteable
6-
code to get started is the following:
4+
how to easily mix local optimizers and global optimizers on the Rosenbrock equation.
5+
The simplest copy-pasteable code using a quasi-Newton method (LBFGS) to solve the Rosenbrock problem is the following:
76

87
```@example intro
98
# Import the package and define the problem to optimize
10-
using Optimization
9+
using Optimization, Zygote
1110
rosenbrock(u, p) = (p[1] - u[1])^2 + p[2] * (u[2] - u[1]^2)^2
1211
u0 = zeros(2)
1312
p = [1.0, 100.0]
1413
15-
prob = OptimizationProblem(rosenbrock, u0, p)
16-
17-
# Import a solver package and solve the optimization problem
18-
using OptimizationOptimJL
19-
sol = solve(prob, NelderMead())
14+
optf = OptimizationFunction(rosenbrock, AutoZygote())
15+
prob = OptimizationProblem(optf, u0, p)
2016
21-
# Import a different solver package and solve the optimization problem a different way
22-
using OptimizationBBO
23-
prob = OptimizationProblem(rosenbrock, u0, p, lb = [-1.0, -1.0], ub = [1.0, 1.0])
24-
sol = solve(prob, BBO_adaptive_de_rand_1_bin_radiuslimited())
17+
sol = solve(prob, Optimization.LBFGS())
2518
```
2619

27-
Notice that Optimization.jl is the core glue package that holds all the common
28-
pieces, but to solve the equations, we need to use a solver package. Here, OptimizationOptimJL
29-
is for [Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl) and OptimizationBBO is for
30-
[BlackBoxOptim.jl](https://github.com/robertfeldt/BlackBoxOptim.jl).
20+
## Import a different solver package and solve the problem
21+
22+
OptimizationOptimJL is a wrapper for [Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl) and OptimizationBBO is a wrapper for [BlackBoxOptim.jl](https://github.com/robertfeldt/BlackBoxOptim.jl).
3123

32-
The output of the first optimization task (with the `NelderMead()` algorithm)
33-
is given below:
24+
First let's use the NelderMead a derivative free solver from Optim.jl:
3425

3526
```@example intro
36-
optf = OptimizationFunction(rosenbrock, Optimization.AutoForwardDiff())
37-
prob = OptimizationProblem(optf, u0, p, lb = [-1.0, -1.0], ub = [1.0, 1.0])
38-
sol = solve(prob, NelderMead())
27+
using OptimizationOptimJL
28+
sol = solve(prob, Optim.NelderMead())
29+
```
30+
31+
BlackBoxOptim.jl offers derivative-free global optimization solvers that requrie the bounds to be set via `lb` and `ub` in the `OptimizationProblem`. Let's use the BBO_adaptive_de_rand_1_bin_radiuslimited() solver:
32+
33+
```@example intro
34+
using OptimizationBBO
35+
prob = OptimizationProblem(rosenbrock, u0, p, lb = [-1.0, -1.0], ub = [1.0, 1.0])
36+
sol = solve(prob, BBO_adaptive_de_rand_1_bin_radiuslimited())
3937
```
4038

4139
The solution from the original solver can always be obtained via `original`:

docs/src/index.md

Lines changed: 123 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ Pkg.add("Optimization")
2929

3030
The packages relevant to the core functionality of Optimization.jl will be imported
3131
accordingly and, in most cases, you do not have to worry about the manual
32-
installation of dependencies. However, you will need to add the specific optimizer
33-
packages.
32+
installation of dependencies. [Optimization.jl](@ref) natively offers a LBFGS solver
33+
but for more solver choices (discussed below in Optimization Packages), you will need
34+
to add the specific wrapper packages.
3435

3536
## Contributing
3637

@@ -48,32 +49,128 @@ packages.
4849
+ On the [Julia Discourse forums](https://discourse.julialang.org)
4950
+ See also [SciML Community page](https://sciml.ai/community/)
5051

51-
## Overview of the Optimizers
52-
53-
| Package | Local Gradient-Based | Local Hessian-Based | Local Derivative-Free | Box Constraints | Local Constrained | Global Unconstrained | Global Constrained |
54-
|:----------------------- |:--------------------:|:-------------------:|:---------------------:|:---------------:|:-----------------:|:--------------------:|:--------------------:|
55-
| BlackBoxOptim ||||||| ❌ ✅ |
56-
| CMAEvolutionaryStrategy ||||||||
57-
| Evolutionary ||||||| 🟡 |
58-
| Flux ||||||||
59-
| GCMAES ||||||||
60-
| MathOptInterface ||||||| 🟡 |
61-
| MultistartOptimization ||||||||
62-
| Metaheuristics ||||||| 🟡 |
63-
| NOMAD ||||||| 🟡 |
64-
| NLopt ||||| 🟡 || 🟡 |
65-
| Optim ||||||||
66-
| PRIMA ||||||||
67-
| QuadDIRECT ||||||||
68-
69-
✅ = supported
70-
71-
🟡 = supported in downstream library but not yet implemented in `Optimization`; PR to add this functionality are welcome
72-
73-
❌ = not supported
52+
## Overview of the solver packages in alphabetical order
7453

54+
<details>
55+
<summary><strong>BlackBoxOptim</strong></summary>
56+
- **Global Methods**
57+
- Zeroth order
58+
- Unconstrained
59+
- Box Constraints
60+
</details>
61+
<details>
62+
<summary><strong>CMAEvolutionaryStrategy</strong></summary>
63+
- **Global Methods**
64+
- Zeroth order
65+
- Unconstrained
66+
- Box Constraints
67+
</details>
68+
<details>
69+
<summary><strong>Evolutionary</strong></summary>
70+
- **Global Methods**
71+
- Zeroth order
72+
- Unconstrained
73+
- Box Constraints
74+
- Non-linear Constraints
75+
</details>
76+
<details>
77+
<summary><strong>GCMAES</strong></summary>
78+
- **Global Methods**
79+
- First order
80+
- Box Constraints
81+
- Unconstrained
82+
</details>
83+
<details>
84+
<summary><strong>Manopt</strong></summary>
85+
- **Local Methods**
86+
- First order
87+
- Second order
88+
- Zeroth order
89+
- Box Constraints
90+
- Constrained 🟡
91+
- **Global Methods**
92+
- Zeroth order
93+
- Unconstrained
94+
</details>
95+
<details>
96+
<summary><strong>MathOptInterface</strong></summary>
97+
- **Local Methods**
98+
- First order
99+
- Second order
100+
- Box Constraints
101+
- Constrained
102+
- **Global Methods**
103+
- First order
104+
- Second order
105+
- Constrained
106+
</details>
107+
<details>
108+
<summary><strong>MultistartOptimization</strong></summary>
109+
- **Global Methods**
110+
- Zeroth order
111+
- First order
112+
- Second order
113+
- Box Constraints
114+
</details>
115+
<details>
116+
<summary><strong>Metaheuristics</strong></summary>
117+
- **Global Methods**
118+
- Zeroth order
119+
- Unconstrained
120+
- Box Constraints
121+
</details>
122+
<details>
123+
<summary><strong>NOMAD</strong></summary>
124+
- **Global Methods**
125+
- Zeroth order
126+
- Unconstrained
127+
- Box Constraints
128+
- Constrained 🟡
129+
</details>
130+
<details>
131+
<summary><strong>NLopt</strong></summary>
132+
- **Local Methods**
133+
- First order
134+
- Zeroth order
135+
- Second order 🟡
136+
- Box Constraints
137+
- Local Constrained 🟡
138+
- **Global Methods**
139+
- Zeroth order
140+
- First order
141+
- Unconstrained
142+
- Constrained 🟡
143+
</details>
144+
<details>
145+
<summary><strong>Optim</strong></summary>
146+
- **Local Methods**
147+
- Zeroth order
148+
- First order
149+
- Second order
150+
- Box Constraints
151+
- Constrained
152+
- **Global Methods**
153+
- Zeroth order
154+
- Unconstrained
155+
- Box Constraints
156+
</details>
157+
<details>
158+
<summary><strong>PRIMA</strong></summary>
159+
- **Local Methods**
160+
- Derivative-Free: ✅
161+
- **Constraints**
162+
- Box Constraints: ✅
163+
- Local Constrained: ✅
164+
</details>
165+
<details>
166+
<summary><strong>QuadDIRECT</strong></summary>
167+
- **Constraints**
168+
- Box Constraints: ✅
169+
- **Global Methods**
170+
- Unconstrained: ✅
171+
</details>
172+
🟡 = supported in downstream library but not yet implemented in `Optimization.jl`; PR to add this functionality are welcome
75173
## Citation
76-
77174
```
78175
@software{vaibhav_kumar_dixit_2023_7738525,
79176
author = {Vaibhav Kumar Dixit and Christopher Rackauckas},

0 commit comments

Comments
 (0)