Skip to content

Commit

Permalink
Update ensemble_nondes.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Dec 10, 2024
1 parent ee118ef commit dfcb209
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/downstream/ensemble_nondes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ ensembleprob = Optimization.EnsembleProblem(

sol = Optimization.solve(ensembleprob, OptimizationOptimJL.BFGS(),
EnsembleThreads(), trajectories = 4, maxiters = 5)
@test findmin(i -> sol.u[i].objective, 1:4)[1] < sol1.objective
@test findmin(i -> sol.u[i].objective, 1:4)[1] <= sol1.objective

sol = Optimization.solve(ensembleprob, OptimizationOptimJL.BFGS(),
EnsembleDistributed(), trajectories = 4, maxiters = 5)
@test findmin(i -> sol.u[i].objective, 1:4)[1] < sol1.objective
@test findmin(i -> sol.u[i].objective, 1:4)[1] <= sol1.objective

prob = OptimizationProblem(optf, x0, lb = [-0.5, -0.5], ub = [0.5, 0.5])
ensembleprob = Optimization.EnsembleProblem(
prob, prob_func = (prob, i, repeat) -> remake(prob, u0 = rand(-0.5:0.001:0.5, 2)))

sol = Optimization.solve(ensembleprob, OptimizationOptimJL.BFGS(),
EnsembleThreads(), trajectories = 5, maxiters = 5)
@test findmin(i -> sol.u[i].objective, 1:4)[1] < sol1.objective
@test findmin(i -> sol.u[i].objective, 1:4)[1] <= sol1.objective

sol = Optimization.solve(ensembleprob, OptimizationOptimJL.BFGS(),
EnsembleDistributed(), trajectories = 5, maxiters = 5)
@test findmin(i -> sol.u[i].objective, 1:4)[1] < sol1.objective
@test findmin(i -> sol.u[i].objective, 1:4)[1] <= sol1.objective

using NonlinearSolve

Expand Down

0 comments on commit dfcb209

Please sign in to comment.