DEPRECATED: use rather example_experiment_complete.py
A Python script for the COCO experimentation module cocoex
.
Usage from a system shell:
python example_experiment.py bbob
runs a full but short experiment on the bbob suite. The optimization
algorithm used is determined by the SOLVER
attribute in this file:
python example_experiment.py bbob 20
runs the same experiment but with a budget of 20 * dimension f-evaluations:
python example_experiment.py bbob-biobj 1e3 1 20
runs the first of 20 batches with maximal budget of 1000 * dimension f-evaluations on the bbob-biobj suite. All batches must be run to generate a complete data set.
Usage from a python shell:
>>> import example_experiment as ee >>> ee.suite_name = "bbob-biobj" >>> ee.SOLVER = ee.random_search # which is default anyway >>> ee.observer_options['algorithm_info'] = '"default of example_experiment.py"' >>> ee.main(5, 1+9, 2, 300) # doctest: +ELLIPSIS Benchmarking solver...
runs the 2nd of 300 batches with budget 5 * dimension and at most 9 restarts.
Calling example_experiment
without parameters prints this
help and the available suite names.
DEPRECATED: use rather example_experiment2.py
Function | batch |
loop over all problems in suite calling coco_optimize(solver, problem, budget * problem.dimension, max_runs) for each eligible problem. |
Function | coco |
fun is a callable, to be optimized by solver . |
Function | default |
return defaults computed from input parameters or current global vars |
Function | main |
Initialize suite and observer, then benchmark solver by calling batch_loop(SOLVER, suite, observer, budget,... |
Variable | budget |
Undocumented |
Variable | current |
Undocumented |
Variable | max |
Undocumented |
Variable | number |
Undocumented |
Variable | observer |
Undocumented |
Variable | suite |
Undocumented |
Variable | suite |
Undocumented |
Variable | suite |
Undocumented |
loop over all problems in suite
calling
coco_optimize(solver, problem, budget * problem.dimension, max_runs)
for each eligible problem.
A problem is eligible if problem_index + current_batch - 1 modulo number_of_batches equals 0.
This distribution into batches is likely to lead to similar runtimes for the batches, which is usually desirable.
fun
is a callable, to be optimized by solver
.
The solver
is called repeatedly with different initial solutions
until either the max_evals
are exhausted or max_run
solver calls
have been made or the solver
has not called fun
even once
in the last run.
Return number of (almost) independent runs.
Initialize suite and observer, then benchmark solver by calling batch_loop(SOLVER, suite, observer, budget,...