numbbo / coco

Numerical Black-Box Optimization Benchmarking Framework
https://numbbo.github.io/coco
Other
254 stars 85 forks source link

How to set and obtain the detail info for observer options? #2275

Closed tinaZC closed 2 days ago

tinaZC commented 2 months ago

May I ask how to set and obtain the detail info for observer options, such as number_targed_triggers, Number_evaluation triggers, Target_precision. It seems can be set or obtained, but I couldn't find any relevant introduction in the help document.

tinaZC commented 2 months ago

The default value of number_target_triggers is 100 (see https://numbbo.github.io/coco-doc/C/#observer-parameters ), but it is said that "the The default target precision values are 51 evenly logspaced values between 10−8 and 102“ in 《COCO: a platform for comparing continuous optimizers in a black-box setting》. 1 2

brockho commented 2 months ago

Hello,

Many thanks for your question. Let me give you a first general reply and if this is not detailed enough, I am sure we can figure out how to help more concretely.

First of all, there is a difference for the target choices between logging and displaying. For logging, the default is to trigger the writing of data, every time any of number_target_triggers (=100 by default) target values per order of magnitude are reached. So if you are not interested in displaying runtimes for target values smaller than the lowest target (typically $10^{-8}$ for most COCO test suites), you don't have to touch this. For displaying, the default depends on the test suite that is used (for example "51 evenly logspaced values between $10^{−8}$ and $10^{2}$ for the bbob test suite).

To answer your actual question, you should be able to change both defaults. For the experimental part, this will change slightly, depending on the language you use, but for python, for example, you can do this as

observer = cocoex.Observer(suite_name, "number_target_triggers: 101, result_folder: " + output_folder)

[line 118 of the example_experiment2.py]

For the postprocessing part, the choice of the displayed targets is both suite- and plot-dependent and is defined in the testbedsettings.py file. For example, to change the displayed targets in the empirical runtime distributions plots (aka ECDF plots, aka data profiles, ...) for the bbob suite and for more than two algorithms, you will have to do the following:

import cocopp
cocopp.testbedsettings.GECCOBBOBTestbed.settings['pprldmany_target_values'] = [10, 1, 0.1, 0.01, 0.001]
cocopp.testbedsettings.GECCOBBOBTestbed.settings['pprldmany_target_range_latex'] = '$10^{[-3..1]}$'
cocopp.config.config()

While the second and third line set the parameters, the last line makes sure that these are actually taken into account for the next cocopp.main(...) call. Each test suite class' settings is a dictionary and has different entries for the different plots, for example pptablemany_targetsOfInterest for the displayed targets in the tables for more than two algorithms. There is no single place (right now) where the displayed targets can be changed globally because it depends on the plot as well as on the suite what are reasonable values.

Hope that helped. If you have further questions, please let us know.

tinaZC commented 2 months ago

Dear numbbo,

Your explanation is very clear, and thank you very much for your timely and detailed reply. I'll give it a try, and if there are any questions, I'll ask for your help.

Thank you again.

Tina. ------------------ 原始邮件 ------------------ 发件人: "numbbo/coco" @.>; 发送时间: 2024年4月19日(星期五) 晚上9:09 @.>; @.**@.>; 主题: Re: [numbbo/coco] How to set and obtain the detail info for observer options? (Issue #2275)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>