Skip to content

Commit 4f072a7

Browse files
Merge pull request #1005 from francis-biocurie/patch-1
Update the multistart optimization tutorial in `ensemble.md`
2 parents d7b0fcf + 694ac42 commit 4f072a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/src/tutorials/ensemble.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ of optimization, this is useful for performing multistart optimization.
55

66
This can be useful for complex, low dimensional problems. We demonstrate this, again, on the rosenbrock function.
77

8+
We first execute a single local optimization with `OptimizationOptimJL.BFGS` and `maxiters=5`:
9+
810
```@example ensemble
911
using Optimization, OptimizationOptimJL, Random
1012
@@ -18,10 +20,14 @@ prob = OptimizationProblem(optf, x0, [1.0, 100.0])
1820
@time sol1 = Optimization.solve(prob, OptimizationOptimJL.BFGS(), maxiters = 5)
1921
2022
@show sol1.objective
23+
```
2124

25+
This results is compared to a multistart approach with 4 random initial points:
26+
27+
```@example ensemble
2228
x0s = [x0, x0 .+ rand(2), x0 .+ rand(2), x0 .+ rand(2)]
2329
function prob_func(prob, i, repeat)
24-
remake(prob, u0 = x0s[1])
30+
remake(prob, u0 = x0s[i])
2531
end
2632
2733
ensembleprob = Optimization.EnsembleProblem(prob; prob_func)

0 commit comments

Comments
 (0)