module documentation

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 loop over all problems in suite calling coco_optimize(solver, problem, budget * problem.dimension, max_runs) for each eligible problem.
Function coco_optimize fun is a callable, to be optimized by solver.
Function default_observer_options 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_batch Undocumented
Variable max_runs Undocumented
Variable number_of_batches Undocumented
Variable observer_options Undocumented
Variable suite_instance Undocumented
Variable suite_name Undocumented
Variable suite_options Undocumented
def batch_loop(solver, suite, observer, budget, max_runs, current_batch, number_of_batches):

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.

def coco_optimize(solver, fun, max_evals, observer, max_runs=1000000000.0):

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.

def default_observer_options(budget_=None, suite_name_=None, current_batch_=None):

return defaults computed from input parameters or current global vars

def main(budget=budget, max_runs=max_runs, current_batch=current_batch, number_of_batches=number_of_batches):

Initialize suite and observer, then benchmark solver by calling batch_loop(SOLVER, suite, observer, budget,...

budget: int =

Undocumented

current_batch: int =

Undocumented

max_runs: float =

Undocumented

number_of_batches: int =

Undocumented

observer_options =

Undocumented

suite_instance: str =

Undocumented

suite_name: str =

Undocumented

suite_options: str =

Undocumented