cocopp.pproc.RunlengthBasedTargetValues(TargetValues)
class documentationcocopp.pproc
(View In Hierarchy)
a class instance call returns f-target values based on reference runlengths:
>>> import cocopp >>> # make sure to use the right `bbob` test suite for the test below: >>> cocopp.genericsettings.isNoisy = False >>> cocopp.genericsettings.isNoiseFree = False >>> cocopp.config.config('GECCOBBOBTestbed') >>> targets = cocopp.pproc.RunlengthBasedTargetValues([0.5, 1.2, 3, 10, 50]) # by default times_dimension==True >>> # make also sure to have loaded the corresponding reference algo >>> # from BBOB-2009: >>> targets.reference_data = 'testbedsettings' >>> t = targets(fun_dim=(1, 20)) # doctest:+ELLIPSIS Loading best algorithm data from ... >>> assert 6.30957345e+01 <= t[0] <= 6.30957346e+01 >>> assert t[-1] == 1.00000000e-08
returns a list of target f-values for F1 in 20-D, based on the aRT values [0.5,...,50].
Details: The computation starts from the smallest budget and the resulting f-target must always be at least a factor of force_different_targets_factor smaller than the previous one. If the smallest_target is superseded, the log values are linearly rescaled such that the easiest found target remains the same and the smallest target becomes smallest_target.
TODO: see compall/determineFtarget2.FunTarget
Static Method | cast | idempotent cast to RunlengthBasedTargetValues class type |
Method | __init__ | calling the class instance returns run-length based target values based on the reference data, individually computed for a given (funcId, dimension). |
Method | initialize | lazy initialization to prevent slow import |
Method | __len__ | Undocumented |
Method | __call__ | No summary |
Method | label | return i-th target value as string |
Method | loglabel | decimals is used for round |
Method | labels | target values as a list of str |
Method | label_name | Undocumented |
Method | _generate_erts | compute for all target values, starting with 1e-8, the ert value and store it in the reference_data_set attribute |
Inherited from TargetValues:
Method | short_info | Undocumented |
Method | loglabels | log10 of the target values as a list of str |
Static Method | _discretize | return a "similar" list with targets in [10**i/5] |
calling the class instance returns run-length based target values based on the reference data, individually computed for a given (funcId, dimension).
TODO: check use case where reference_data is a dictionary similar to bestalg.bestAlgorithmEntries with each key dim_fun a reference DataSet, computed by bestalg module or portfolio module.
dsList, sortedAlgs, dictAlg = pproc.processInputArgs(args) ref_data = refalg.generate(dictAlg) targets = RunlengthBasedTargetValues([1, 2, 4, 8], ref_data)
Parameters | run_lengths | sequence of values. |
reference_data | can be a string indicating the filename of a reference algorithm data set such as "refalgs/best2009-bbob.tar.gz" or a dictionary of best data sets (e.g. from bestalg.generate(...)) or a list of algorithm folder/data names (not thoroughly tested). If chosen as testbedsettings, the reference algorithm specified in testbedsettings.py will be used. | |
smallest_target | ||
times_dimension | ||
force_different_targets_factor | given the target values are computed from the reference_data, enforces that all target values are different by at last forced_different_targets_factor if forced_different_targets_factor. Default 10**0.04 means that within the typical precision of 10**0.2 at most five consecutive targets can be identical. | |
step_to_next_difficult_target | the next more difficult target (just) not reached within the target run length is chosen, where step_to_next_difficult_target defines "how much more difficult". |
Get all target values for the respective function and dimension
and reference aRT values (passed during initialization). fun_dim
is a tuple (fun_nb, dimension) like (1, 20) for the 20-D
sphere.
if discretize all targets are in [10**i/5 for i in N], in case achieved via rounding on the log-scale.
Details: f_target = arg min_f { ERT_ref(f) > max(1, target_budget * dimension**times_dimension_flag) }, where f are the values of the DataSet target attribute. The next difficult target is chosen not smaller as target / 10**0.2.
Returned are the aRT for targets that, within the given budget, the reference algorithm just failed to achieve.