Skip to content

Commit

Permalink
Stats bbo
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Jan 4, 2024
1 parent 34bff41 commit 94ed95b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/OptimizationBBO/src/OptimizationBBO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{
t1 = time()

opt_ret = Symbol(opt_res.stop_reason)
stats = Optimization.OptimizationStats(opt_res.iterations, t1 - t0, opt_res.f_calls)
stats = Optimization.OptimizationStats(; iterations = opt_res.iterations, time = t1 - t0, fevals = opt_res.f_calls)

Check warning on line 181 in lib/OptimizationBBO/src/OptimizationBBO.jl

View check run for this annotation

Codecov / codecov/patch

lib/OptimizationBBO/src/OptimizationBBO.jl#L181

Added line #L181 was not covered by tests
SciMLBase.build_solution(cache, cache.opt,
BlackBoxOptim.best_candidate(opt_res),
BlackBoxOptim.best_fitness(opt_res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ function SciMLBase.__solve(cache::OptimizationCache{
t1 = time()

opt_ret = opt_res.stop.reason

stats = Optimization.OptimizationStats(; iterations = length(opt.logger.fmedian), time = t1 - t0, fevals = length(opt.logger.fmedian))

Check warning on line 108 in lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl

View check run for this annotation

Codecov / codecov/patch

lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl#L108

Added line #L108 was not covered by tests
SciMLBase.build_solution(cache, cache.opt,
opt_res.logger.xbest[end],
opt_res.logger.fbest[end]; original = opt_res,
retcode = opt_ret, solve_time = t1 - t0)
retcode = opt_ret, solve_time = t1 - t0,
stats = stats)
end

end

0 comments on commit 94ed95b

Please sign in to comment.