module documentation

An example experiment script with restarts and batching sweeping over a noise parameter.

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 final_condition Undocumented
Variable final_conditions Undocumented
Variable minimal_print Undocumented
Variable noisifier Undocumented
Variable observer Undocumented
Variable output_folder Undocumented
Variable problem 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')
final_condition =

Undocumented

Value
res[1]
final_conditions =

Undocumented

Value
collections.defaultdict(list)
minimal_print =

Undocumented

Value
cocoex.utilities.MiniPrint()
noisifier =

Undocumented

Value
cocoex.noiser.Noisifier(p_add=added_noise)
observer =

Undocumented

Value
cocoex.Observer(suite_name,
                """result_folder: {0}  algorithm_name: {1}  algorithm_info: "{2}↵
"  settings: "{2}\"""".format(output_folder,
                              (fmin.__module__+'.'+fmin.__name__),
                              str(noisifier.parameters).replace('\'', '')))
output_folder =

Undocumented

Value
"""{}{}_of_{}_{}D_on_{}{}""".format(float(added_noise),
                                    fmin.__name__,
                                    (fmin.__module__ or ''),
                                    int((budget_multiplier+0.499)),
                                    suite_name,
                                    (('_batch{:0' + str(len(str(number_of_batche↵
s - 1))) + '}of{}').format(
...
problem =

Undocumented

Value
noisifier.noisify(problem)
repeater =

Undocumented

Value
cocoex.ExperimentRepeater(budget_multiplier,
                          min_successes=(0.75 * int(suite_filter.split('-')[1]) ↵
if 'indices:1-' in suite_filter else 11
    ),
                          max_sweeps=100)
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: str =

Undocumented

Value
'dimensions: 2,3,5,10,20 instance_indices:1-5'
suite_name: str =

Undocumented

Value
'bbob'
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]