class RunlengthBasedTargetValues(TargetValues):
Constructor: RunlengthBasedTargetValues(run_lengths, reference_data, smallest_target, times_dimension, ...)
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('bbob') >>> 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 ERT 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 | __call__ |
Get all target values for the respective function and dimension and reference ERT values (passed during initialization). fun_dim is a tuple (fun_nb, dimension) like (1, 20) for the 20-D sphere. |
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 | __len__ |
Undocumented |
Method | initialize |
lazy initialization to prevent slow import |
Method | label |
return i-th target value as string |
Method | label |
Undocumented |
Method | labels |
target values as a list of str |
Method | loglabel |
decimals is used for round |
Instance Variable | force |
Undocumented |
Instance Variable | initialized |
Undocumented |
Instance Variable | reference |
Undocumented |
Instance Variable | reference |
Undocumented |
Instance Variable | run |
Undocumented |
Instance Variable | smallest |
Undocumented |
Instance Variable | step |
Undocumented |
Instance Variable | target |
Undocumented |
Instance Variable | times |
Undocumented |
Instance Variable | unique |
Undocumented |
Method | _generate |
compute for all target values, starting with 1e-8, the ert value and store it in the reference_data_set attribute |
Instance Variable | _short |
Undocumented |
Inherited from TargetValues
:
Method | loglabels |
log10 of the target values as a list of str |
Instance Variable | __dict__ |
Undocumented |
Instance Variable | target |
Undocumented |
Property | short |
Undocumented |
Static Method | _discretize |
return a "similar" list with targets in [10**i/5] |
cocopp.pproc.TargetValues.__call__
Get all target values for the respective function and dimension
and reference ERT 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 ERT for targets that, within the given budget, the reference algorithm just failed to achieve.
cocopp.pproc.TargetValues.__init__
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 | sequence of values. |
reference | 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 | |
times | |
force | 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. |
unique | Undocumented |
step | 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". |