Skip to content

Commit 883c96a

Browse files
committed
fix docs for Optimization@v5
1 parent 3f00112 commit 883c96a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/src/optimization_packages/optimization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Optimization.Sophia
1818

1919
```@example L-BFGS
2020
21-
using Optimization, Zygote
21+
using Optimization, OptimizationLBFGS, Zygote
2222
2323
rosenbrock(x, p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2
2424
x0 = zeros(2)
2525
p = [1.0, 100.0]
2626
2727
optf = OptimizationFunction(rosenbrock, AutoZygote())
2828
prob = Optimization.OptimizationProblem(optf, x0, p)
29-
sol = solve(prob, Optimization.LBFGS())
29+
sol = solve(prob, LBFGS())
3030
```
3131

3232
### With nonlinear and bounds constraints
@@ -41,7 +41,7 @@ optf = OptimizationFunction(rosenbrock, AutoZygote(), cons = con2_c)
4141
prob = OptimizationProblem(optf, x0, p, lcons = [1.0, -Inf],
4242
ucons = [1.0, 0.0], lb = [-1.0, -1.0],
4343
ub = [1.0, 1.0])
44-
res = solve(prob, Optimization.LBFGS(), maxiters = 100)
44+
res = solve(prob, LBFGS(), maxiters = 100)
4545
```
4646

4747
### Train NN with Sophia

docs/src/tutorials/certification.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This works with the `structural_analysis` keyword argument to `OptimizationProbl
77
We'll use a simple example to illustrate the convexity structure certification process.
88

99
```@example symanalysis
10-
using SymbolicAnalysis, Zygote, LinearAlgebra, Optimization
10+
using SymbolicAnalysis, Zygote, LinearAlgebra, Optimization, OptimizationLBFGS
1111
1212
function f(x, p = nothing)
1313
return exp(x[1]) + x[1]^2
@@ -16,7 +16,7 @@ end
1616
optf = OptimizationFunction(f, Optimization.AutoForwardDiff())
1717
prob = OptimizationProblem(optf, [0.4], structural_analysis = true)
1818
19-
sol = solve(prob, Optimization.LBFGS(), maxiters = 1000)
19+
sol = solve(prob, LBFGS(), maxiters = 1000)
2020
```
2121

2222
The result can be accessed as the `analysis_results` field of the solution.

docs/src/tutorials/remakecomposition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The SciML interface provides a `remake` function which allows you to recreate th
1111
Let's look at a 10 dimensional schwefel function in the hypercube $x_i \in [-500, 500]$.
1212

1313
```@example polyalg
14-
using Optimization, Random
14+
using OptimizationLBFGS, Random
1515
using OptimizationBBO, ReverseDiff
1616
1717
Random.seed!(122333)
@@ -47,7 +47,7 @@ This is a good start can we converge to the global optimum?
4747

4848
```@example polyalg
4949
prob = remake(prob, u0 = res1.minimizer)
50-
res2 = solve(prob, Optimization.LBFGS(), maxiters = 100)
50+
res2 = solve(prob, LBFGS(), maxiters = 100)
5151
5252
@show res2.objective
5353
```

0 commit comments

Comments
 (0)