Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions docs/src/tutorials/ensemble.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ 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[i])
function prob_func(prob, ctx)
remake(prob, u0 = x0s[ctx.sim_id])
end

ensembleprob = EnsembleProblem(prob; prob_func)
@time sol = solve(ensembleprob, OptimizationOptimJL.BFGS(),
EnsembleThreads(), trajectories = 4, maxiters = 5)
@show findmin(i -> sol[i].objective, 1:4)[1]
@show minimum(s.objective for s in sol.u)
```

With the same number of iterations (5) we get a much lower (1/100th) objective value by using multiple initial points. The initialization strategy used here was a pretty trivial one but approaches based on Quasi-Monte Carlo sampling should be typically more effective.
2 changes: 1 addition & 1 deletion docs/src/tutorials/remakecomposition.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ res1 = solve(prob, BBO_adaptive_de_rand_1_bin(), maxiters = 4000)
This is a good start can we converge to the global optimum?

```@example polyalg
prob = remake(prob, u0 = res1.minimizer)
prob = remake(prob, u0 = res1.u)
res2 = solve(prob, OptimizationLBFGSB.LBFGSB(), maxiters = 100)

@show res2.objective
Expand Down
Loading