Skip to content

Commit 4770f22

Browse files
committed
Rename solvers as optimizers
1 parent 6998c81 commit 4770f22

File tree

7 files changed

+97
-97
lines changed

7 files changed

+97
-97
lines changed

docs/src/benchmark.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Benchmarking solvers
1+
# Benchmarking optimizers
22

33
Benchmarking is very important when researching new algorithms or selecting the most approriate ones.
44

5-
The package [`SolverBenchmark`](https://github.com/JuliaSmoothOptimizers/SolverBenchmark.jl) exports the function [`bmark_solvers`](https://github.com/JuliaSmoothOptimizers/SolverBenchmark.jl/blob/main/src/bmark_solvers.jl) that runs a set of solvers on a set of problems. `JSOSuite.jl` specialize this function, see `bmark_solvers`.
5+
The package [`SolverBenchmark`](https://github.com/JuliaSmoothOptimizers/SolverBenchmark.jl) exports the function [`bmark_solvers`](https://github.com/JuliaSmoothOptimizers/SolverBenchmark.jl/blob/main/src/bmark_solvers.jl) that runs a set of optimizers on a set of problems. `JSOSuite.jl` specialize this function, see `bmark_solvers`.
66

77
The [JuliaSmoothOptimizers organization](https://juliasmoothoptimizers.github.io) contains several packages of test problems ready to use for benchmarking. The main ones are
88
- [`OptimizationProblems.jl`](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl): This package provides a collection of optimization problems in JuMP and ADNLPModels syntax;
@@ -36,21 +36,21 @@ ad_problems = [
3636
length(ad_problems) # return the number of problems
3737
```
3838

39-
We now want to select appropriate solvers using the `JSOSuite.solvers`.
39+
We now want to select appropriate optimizers using the `JSOSuite.optimizers`.
4040

4141
```@example op
42-
selected_solvers = JSOSuite.solvers
43-
# solvers can solve general `nlp` as some are specific to variants (NLS, ...)
44-
selected_solvers = selected_solvers[selected_solvers.can_solve_nlp, :]
45-
selected_solvers[selected_solvers.is_available, :] # solvers available
42+
selected_optimizers = JSOSuite.optimizers
43+
# optimizers can solve general `nlp` as some are specific to variants (NLS, ...)
44+
selected_optimizers = selected_optimizers[selected_optimizers.can_solve_nlp, :]
45+
selected_optimizers[selected_optimizers.is_available, :] # optimizers available
4646
```
4747

48-
For the purpose of this example, we will consider 3 solvers.
48+
For the purpose of this example, we will consider 3 optimizers.
4949
```@example op
5050
select = ["IPOPT", "TRUNK", "LBFGS"]
5151
```
5252

53-
Once the problems and solvers are chosen, the function `bmark_solvers` runs the benchmark.
53+
Once the problems and optimizers are chosen, the function `bmark_solvers` runs the benchmark.
5454

5555
```@example op
5656
using SolverBenchmark
@@ -75,7 +75,7 @@ gr()
7575
profile_solvers(stats, costs, costnames)
7676
```
7777

78-
Note that there are fundamental differences between these solvers as highlighted in the following.
78+
Note that there are fundamental differences between these optimizers as highlighted in the following.
7979

8080
```@example op
8181
for solver in ["IPOPT", "TRUNK", "LBFGS"]

docs/src/speed-up.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ The following contains a list of tips to speed up the solver selection and usage
44

55
## Derivatives
66

7-
The solvers available in `JSOSuite.jl` are all using first and sometines second-order derivatives. There are mainly three categories:
7+
The optimizers available in `JSOSuite.jl` are all using first and sometines second-order derivatives. There are mainly three categories:
88
- 1st order methods use only gradient information;
99
- 1st order quasi-Newton methods require only gradient information, and uses it to build an approximation of the Hessian;
1010
- 2nd order methods: Those are using gradients and Hessian information.
11-
- 2nd order methods matrix-free: Those are solvers using Hessian information, but without ever forming the matrix, so only matrix-vector products are computed.
11+
- 2nd order methods matrix-free: Those are optimizers using Hessian information, but without ever forming the matrix, so only matrix-vector products are computed.
1212

1313
The latter is usually a good tradeoff for very large problems.
1414

@@ -22,7 +22,7 @@ stats
2222

2323
## Find a better initial guess
2424

25-
The majority of derivative-based solvers are local methods whose performance are dependent of the initial guess.
25+
The majority of derivative-based optimizers are local methods whose performance are dependent of the initial guess.
2626
This usually relies on specific knowledge of the problem.
2727

2828
The function [`feasible_point`](@ref) computes a point satisfying the constraints of the problem that can be used as an initial guess.
@@ -31,15 +31,15 @@ An alternative is to solve a simpler version of the problem and reuse the soluti
3131
## Use the structure of the problem
3232

3333
If the problem has linear constraints, then it is efficient to specify it at the modeling stage to avoid having them treated like nonlinear ones.
34-
Some of the solvers will also exploit this information.
34+
Some of the optimizers will also exploit this information.
3535

36-
Similarly, quadratic objective or least squares problems have tailored modeling tools and solvers.
36+
Similarly, quadratic objective or least squares problems have tailored modeling tools and optimizers.
3737

3838
## Change the parameters of the solver
3939

40-
Once a solver has been chosen it is also possible to play with the key parameters. Find below a list of the available solvers and parameters.
40+
Once a solver has been chosen it is also possible to play with the key parameters. Find below a list of the available optimizers and parameters.
4141

42-
Note that all solvers presented here have been carefully optimized. All have different strengths. Trying another solver on the same problem sometimes provide a different solution.
42+
Note that all optimizers presented here have been carefully optimized. All have different strengths. Trying another solver on the same problem sometimes provide a different solution.
4343

4444
### Unconstrained/Bound-constrained
4545

docs/src/tutorial.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ There are two important challenges in solving an optimization problem: (i) model
66

77
## Modeling
88

9-
All these solvers rely on the `NLPModel API` from [NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl) for general nonlinear optimization problems of the form
9+
All these optimizers rely on the `NLPModel API` from [NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl) for general nonlinear optimization problems of the form
1010

1111
```math
1212
\begin{aligned}
@@ -127,37 +127,37 @@ stats = solve(f, x0, A, c, l, l, verbose = 0)
127127

128128
## Solving
129129

130-
Internally, the `solve` function selects solvers according to the problem's property and JSO-compliant solvers available.
130+
Internally, the `solve` function selects optimizers according to the problem's property and JSO-compliant optimizers available.
131131

132-
### Available solvers
132+
### Available optimizers
133133

134-
All the information used by the handled solvers is available in the following `DataFrame`:
134+
All the information used by the handled optimizers is available in the following `DataFrame`:
135135

136136
```@example ex1
137137
using JSOSuite
138-
JSOSuite.solvers
138+
JSOSuite.optimizers
139139
```
140140

141-
Required information can be extracted by simple `DataFrame` manipulations. For instance, the list of solvers handled by this package
141+
Required information can be extracted by simple `DataFrame` manipulations. For instance, the list of optimizers handled by this package
142142
```@example ex1
143-
JSOSuite.solvers.name
143+
JSOSuite.optimizers.name
144144
```
145145

146-
### Select solvers
146+
### Select optimizers
147147

148-
The function [`JSOSuite.select_solvers`](@ref) returns a list of compatible solvers.
148+
The function [`JSOSuite.select_optimizers`](@ref) returns a list of compatible optimizers.
149149
```@example
150150
using ADNLPModels, JSOSuite
151151
f = x -> 100 * (x[2] - x[1]^2)^2 + (x[1] - 1)^2
152152
x0 = [-1.2; 1.0]
153153
nlp = ADNLPModel(f, x0)
154-
JSOSuite.select_solvers(nlp)
154+
JSOSuite.select_optimizers(nlp)
155155
```
156156

157157
### Fine-tune solve call
158158

159159
All the keyword arguments are passed to the solver.
160-
Keywords available for all the solvers are given below:
160+
Keywords available for all the optimizers are given below:
161161

162162
- `atol`: absolute tolerance;
163163
- `rtol`: relative tolerance;

src/JSOSuite.jl

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using LinearOperators, NLPModelsModifiers, SolverCore
1111
using JSOSolvers, Percival
1212

1313
"""
14-
solvers
14+
optimizers
1515
1616
DataFrame with the JSO-compliant solvers and their properties.
1717
@@ -31,7 +31,7 @@ For each solver, the following are available:
3131
- `double_precision_only::Bool`: `true` if the solver only handles double precision (`Float64`);
3232
- `highest_derivative::Int`: order of the highest derivative used by the algorithm.
3333
"""
34-
solvers = DataFrame(
34+
optimizers = DataFrame(
3535
name = String[],
3636
name_solver = Symbol[],
3737
name_pkg = String[],
@@ -48,7 +48,7 @@ solvers = DataFrame(
4848
highest_derivative = Int[],
4949
)
5050
push!(
51-
solvers,
51+
optimizers,
5252
(
5353
"KNITRO",
5454
:KnitroSolver,
@@ -67,7 +67,7 @@ push!(
6767
),
6868
)
6969
push!(
70-
solvers,
70+
optimizers,
7171
(
7272
"LBFGS",
7373
:LBFGSSolver,
@@ -86,7 +86,7 @@ push!(
8686
),
8787
)
8888
push!(
89-
solvers,
89+
optimizers,
9090
(
9191
"R2",
9292
:R2Solver,
@@ -105,7 +105,7 @@ push!(
105105
),
106106
)
107107
push!(
108-
solvers,
108+
optimizers,
109109
(
110110
"TRON",
111111
:TronSolver,
@@ -124,7 +124,7 @@ push!(
124124
),
125125
)
126126
push!(
127-
solvers,
127+
optimizers,
128128
(
129129
"TRUNK",
130130
:TrunkSolver,
@@ -143,7 +143,7 @@ push!(
143143
),
144144
)
145145
push!(
146-
solvers,
146+
optimizers,
147147
(
148148
"TRON-NLS",
149149
:TronSolverNLS,
@@ -162,7 +162,7 @@ push!(
162162
),
163163
)
164164
push!(
165-
solvers,
165+
optimizers,
166166
(
167167
"TRUNK-NLS",
168168
:TrunkSolverNLS,
@@ -181,7 +181,7 @@ push!(
181181
),
182182
)
183183
push!(
184-
solvers,
184+
optimizers,
185185
(
186186
"CaNNOLeS",
187187
:CaNNOLeSSolver,
@@ -200,7 +200,7 @@ push!(
200200
),
201201
)
202202
push!(
203-
solvers,
203+
optimizers,
204204
(
205205
"IPOPT",
206206
:IpoptSolver,
@@ -219,7 +219,7 @@ push!(
219219
),
220220
)
221221
push!(
222-
solvers,
222+
optimizers,
223223
(
224224
"DCISolver",
225225
:DCIWorkspace,
@@ -238,7 +238,7 @@ push!(
238238
),
239239
)
240240
push!(
241-
solvers,
241+
optimizers,
242242
(
243243
"FletcherPenaltySolver",
244244
:FPSSSolver,
@@ -257,7 +257,7 @@ push!(
257257
),
258258
)
259259
push!(
260-
solvers,
260+
optimizers,
261261
(
262262
"Percival",
263263
:PercivalSolver,
@@ -276,7 +276,7 @@ push!(
276276
),
277277
)
278278
push!(
279-
solvers,
279+
optimizers,
280280
(
281281
"RipQP",
282282
:RipQPSolver,
@@ -367,7 +367,7 @@ stats
367367
"Execution stats: first-order stationary"
368368
```
369369
370-
The list of available solver can be obtained using `JSOSuite.solvers[!, :name]` or see [`select_solvers`](@ref).
370+
The list of available solver can be obtained using `JSOSuite.optimizers[!, :name]` or see [`select_optimizers`](@ref).
371371
372372
```jldoctest; output = false
373373
using JSOSuite
@@ -379,7 +379,7 @@ stats
379379
"Execution stats: first-order stationary"
380380
```
381381
382-
Some solvers are available after loading only.
382+
Some optimizers are available after loading only.
383383
384384
```jldoctest; output = false
385385
using JSOSuite
@@ -406,11 +406,11 @@ function solve end
406406
solve!(solver::AbstractOptimizationSolver, model::Union{AbstractNLPModel, JuMP.Model}, stats; kwargs...)
407407
408408
`JSOSuite` extension of `SolverCore.solve!`.
409-
The first argument should be of type `SolverCore.AbstractOptimizationSolver`, see for instance `JSOSuite.solvers[!, :name_solver]`.
409+
The first argument should be of type `SolverCore.AbstractOptimizationSolver`, see for instance `JSOSuite.optimizers[!, :name_solver]`.
410410
"""
411411
function SolverCore.solve!(solver, args...; kwargs...)
412412
throw(
413-
"solve! not implemented first argument should be of type `SolverCore.AbstractOptimizationSolver` and not $(typeof(solver)), see for instance `JSOSuite.solvers[!, :name_solver]`.",
413+
"solve! not implemented first argument should be of type `SolverCore.AbstractOptimizationSolver` and not $(typeof(solver)), see for instance `JSOSuite.optimizers[!, :name_solver]`.",
414414
)
415415
end
416416

@@ -420,7 +420,7 @@ include("solve.jl")
420420

421421
@init begin
422422
@require CaNNOLeS = "5a1c9e79-9c58-5ec0-afc4-3298fdea2875" begin
423-
JSOSuite.solvers[JSOSuite.solvers.name .== "CaNNOLeS", :is_available] .= 1
423+
JSOSuite.optimizers[JSOSuite.optimizers.name .== "CaNNOLeS", :is_available] .= 1
424424
function solve(::Val{:CaNNOLeS}, nlp; kwargs...)
425425
return CaNNOLeS.cannoles(nlp; linsolve = :ldlfactorizations, kwargs...)
426426
end
@@ -430,7 +430,7 @@ end
430430

431431
@init begin
432432
@require DCISolver = "bee2e536-65f6-11e9-3844-e5bb4c9c55c9" begin
433-
JSOSuite.solvers[JSOSuite.solvers.name .== "DCISolver", :is_available] .= 1
433+
JSOSuite.optimizers[JSOSuite.optimizers.name .== "DCISolver", :is_available] .= 1
434434
function solve(::Val{:DCISolver}, nlp; kwargs...)
435435
return DCISolver.dci(nlp; kwargs...)
436436
end
@@ -439,7 +439,7 @@ end
439439

440440
@init begin
441441
@require FletcherPenaltySolver = "e59f0261-166d-4fee-8bf3-5e50457de5db" begin
442-
JSOSuite.solvers[JSOSuite.solvers.name .== "FletcherPenaltySolver", :is_available] .= 1
442+
JSOSuite.optimizers[JSOSuite.optimizers.name .== "FletcherPenaltySolver", :is_available] .= 1
443443
function solve(::Val{:FletcherPenaltySolver}, nlp; kwargs...)
444444
return FletcherPenaltySolver.fps_solve(nlp; kwargs...)
445445
end
@@ -448,7 +448,7 @@ end
448448

449449
@init begin
450450
@require NLPModelsIpopt = "f4238b75-b362-5c4c-b852-0801c9a21d71" begin
451-
JSOSuite.solvers[JSOSuite.solvers.name .== "IPOPT", :is_available] .= 1
451+
JSOSuite.optimizers[JSOSuite.optimizers.name .== "IPOPT", :is_available] .= 1
452452
include("solvers/ipopt_solve.jl")
453453
end
454454
end
@@ -457,7 +457,7 @@ end
457457
@require NLPModelsKnitro = "bec4dd0d-7755-52d5-9a02-22f0ffc7efcb" begin
458458
@init begin
459459
@require NLPModelsKnitro = "bec4dd0d-7755-52d5-9a02-22f0ffc7efcb" begin
460-
JSOSuite.solvers[JSOSuite.solvers.name .== "KNITRO", :is_available] .= KNITRO.has_knitro()
460+
JSOSuite.optimizers[JSOSuite.optimizers.name .== "KNITRO", :is_available] .= KNITRO.has_knitro()
461461
end
462462
end
463463
include("solvers/knitro_solve.jl")
@@ -466,7 +466,7 @@ end
466466

467467
@init begin
468468
@require RipQP = "1e40b3f8-35eb-4cd8-8edd-3e515bb9de08" begin
469-
JSOSuite.solvers[JSOSuite.solvers.name .== "RipQP", :is_available] .= 1
469+
JSOSuite.optimizers[JSOSuite.optimizers.name .== "RipQP", :is_available] .= 1
470470
include("solvers/ripqp_solve.jl")
471471
end
472472
end
@@ -506,7 +506,7 @@ nlps = (
506506
ADNLPModel(x -> 100 * (x[2] - x[1]^2)^2 + (x[1] - 1)^2, [-1.2; 1.0]),
507507
ADNLPModel(x -> 4 * (x[2] - x[1]^2)^2 + (x[1] - 1)^2, [-1.2; 1.0]),
508508
)
509-
names = ["LBFGS", "TRON"] # see `JSOSuite.solvers.name` for the complete list
509+
names = ["LBFGS", "TRON"] # see `JSOSuite.optimizers.name` for the complete list
510510
stats = bmark_solvers(nlps, names, atol = 1e-3, verbose = 0, colstats = [:name, :nvar, :ncon, :status])
511511
keys(stats)
512512
@@ -532,7 +532,7 @@ nlps = (
532532
ADNLPModel(x -> 100 * (x[2] - x[1]^2)^2 + (x[1] - 1)^2, [-1.2; 1.0]),
533533
ADNLPModel(x -> 4 * (x[2] - x[1]^2)^2 + (x[1] - 1)^2, [-1.2; 1.0]),
534534
)
535-
names = ["LBFGS", "TRON"] # see `JSOSuite.solvers.name` for the complete list
535+
names = ["LBFGS", "TRON"] # see `JSOSuite.optimizers.name` for the complete list
536536
other_solvers = Dict{Symbol, Function}(
537537
:test => nlp -> lbfgs(nlp; mem = 2, atol = 1e-3, verbose = 0),
538538
)

0 commit comments

Comments
 (0)