module documentation

A short yet complete example experiment script with restarts and batching.

Arguments

This script must be called with 1-3 arguments:

budget_multiplier [number_of_batches batch_to_execute]

budget_multiplier times dimension is the budget within which problem instances are run repeatedly as long as too few successes are observed.

batch_to_execute can only be omitted when number_of_batches == 1. When number_of_batches > 1, the script must be executed repeatedly (e.g., in parallel) with the different values for batch_to_execute = 0..number_of_batches-1 to get data for the full experiment.

Usage

To apply the code to a different solver/algorithm, fmin must be re-assigned or re-defined accordingly, and the below code must be edited at the two places marked with "### input" around lines 40 and 80.

See also: https://coco-platform.org/getting-started#experiment

Variable __author__ Undocumented
Variable __copyright__ Undocumented
Variable batcher Undocumented
Variable cma Undocumented
Variable dsl Undocumented
Variable final_condition Undocumented
Variable final_conditions Undocumented
Variable minimal_print Undocumented
Variable observer Undocumented
Variable output_folder Undocumented
Variable repeater Undocumented
Variable res Undocumented
Variable scipy Undocumented
Variable suite Undocumented
Variable suite_filter Undocumented
Variable suite_name Undocumented
Variable time0 Undocumented
Variable time1 Undocumented
Variable timings Undocumented
Variable ts Undocumented
Variable xopt Undocumented
__author__: str =

Undocumented

Value
'Nikolaus Hansen'
__copyright__: str =

Undocumented

Value
'public domain'
batcher =

Undocumented

Value
cocoex.BatchScheduler(number_of_batches, batch_to_execute)
cma =

Undocumented

Value
cocoex.utilities.forgiving_import('cma')
dsl =

Undocumented

Value
cocopp.main(observer.result_folder)
final_condition =

Undocumented

Value
res[1]
final_conditions =

Undocumented

Value
collections.defaultdict(list)
minimal_print =

Undocumented

Value
cocoex.utilities.MiniPrint()
observer =

Undocumented

Value
cocoex.Observer(suite_name, ('result_folder: '+output_folder))
output_folder =

Undocumented

Value
"""{}_of_{}_{}D_on_{}{}""".format(fmin.__name__,
                                  (fmin.__module__ or ''),
                                  int((budget_multiplier+0.499)),
                                  suite_name,
                                  (('_batch{:0' + str(len(str(number_of_batches ↵
- 1))) + '}of{}').format(
    batch_to_execute, number_of_batches) if number_of_batches > 1 else ''))
repeater =

Undocumented

Value
cocoex.ExperimentRepeater(budget_multiplier,
                          min_successes=(0.75 * int(suite_filter.split('-')[1]) ↵
if 'indices:1-' in suite_filter else 11
    ))
res =

Undocumented

Value
fmin(problem, repeater.initial_solution_proposal(problem))
scipy =

Undocumented

Value
cocoex.utilities.forgiving_import('scipy')
suite =

Undocumented

Value
cocoex.Suite(suite_name, '', suite_filter)
suite_filter =

Undocumented

Value
'dimensions: '+('20,40,80,160,320' if 'large' in suite_name else '2,3,5,10,20')+' instance_indices:1-↵
5'
suite_name: str =

Undocumented

Value
'bbob-largescale'
time0 =

Undocumented

Value
time.time()
time1 =

Undocumented

Value
time.time()
timings =

Undocumented

Value
collections.defaultdict(list)
ts =

Undocumented

Value
sorted(timings[dimension])
xopt =

Undocumented

Value
res[0]