Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/src/tutorials/ensemble.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ of optimization, this is useful for performing multistart optimization.

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

We first execute a single local optimization with `OptimizationOptimJL.BFGS` and `maxiters=5`:

```@example ensemble
using Optimization, OptimizationOptimJL, Random

Expand All @@ -18,10 +20,14 @@ prob = OptimizationProblem(optf, x0, [1.0, 100.0])
@time sol1 = Optimization.solve(prob, OptimizationOptimJL.BFGS(), maxiters = 5)

@show sol1.objective
```

This results is compared to a multistart approach with 4 random initial points:

```@example ensemble
x0s = [x0, x0 .+ rand(2), x0 .+ rand(2), x0 .+ rand(2)]
function prob_func(prob, i, repeat)
remake(prob, u0 = x0s[1])
remake(prob, u0 = x0s[i])
end

ensembleprob = Optimization.EnsembleProblem(prob; prob_func)
Expand Down