-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default parameter value is ignored for initial design #533
Comments
Dear Jendrik, Thank you for reporting the issue. I have to discuss this with the other developers, because it will change the results on some standard benchmarks quite a bit; but my intuition is that we want to change that in the next release. Best, |
Thanks for the info! |
Is there any workaround? my searchspace is very large. i would like to give smac at least a little hint by starting close to a usefull spot. |
Not yet, but a pull request would be very welcome (it should add this as an option, though). |
Workaround AModified sobol_design.py by prepending the default configuration SMAC3/smac/initial_design/default_configuration_design.py Lines 27 to 29 in 2b27e0d
Workaround Breplace 'SobolDesign' with 'None' SMAC3/smac/facade/smac_hpo_facade.py Line 39 in 2b27e0d
CauseI tracked down the bug. however, i am not able to predict the intended behavior. Both Bayesian optimizers select Sobol as initial design: SMAC3/smac/facade/smac_hpo_facade.py Line 39 in 2b27e0d
SMAC3/smac/facade/smac_bo_facade.py Line 56 in 2b27e0d
Therefore the initial_design is not None and the value for initial_incumbant in scenario is ignored SMAC3/smac/facade/smac_ac_facade.py Lines 427 to 430 in 2b27e0d
additionally Sobol design SMAC3/smac/initial_design/sobol_design.py Lines 46 to 50 in 2b27e0d
does not use the default configuration. I hope that helps others in tackle the issue. |
The documentation is not very verbose on what Sobol even is. |
I used the following workaround:
|
Has basically the same effect as Workaround B, but yours is obvoiusly better. |
@mfeurer is it recommended to disable sobol like #533 (comment) |
It depends on what you want to achieve. The HPO-facade uses a sobol sequence but in turn, it also uses less interleaved random configurations. Thus, if you disable the sobol sequence (workaround b) and you still use the HPO facade, SMAC will be more greedy compared to its default settings. Workaround A is most likely what you want in most cases. |
Thanks for the information. workaround A leads SMAC to prematurely stop after it finished its n+1 initial configurations (while n is the number SOBOL calcualtes from the time budget) so for 100 runs, it will stop after 25+1=26 |
@gamer01 could you please open a new issue on SMAC stopping prematurely with code to reproduce this? |
It only happens for my modified version. Therefore i would not deem it a bug in smac. (The Initializer seems to assume it has 25 elements, as it has 26 now, it stops) |
solved by skiping one sobol element from MySobol import SobolDesign
smac = SMAC4HPO(scenario=scenario, tae_runner=tae, initial_design=SobolDesign) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Good things may take a while, but with our latest release (2.0), this becomes an easy-to-fix issue: simply add to the classifier = SVM()
[....]
initial_design = HyperparameterOptimizationFacade.get_initial_design(
scenario,
n_configs=5,
additional_configs=[ # to get the default configuration in the initial design
classifier.configspace.get_default_configuration()
]
) This will result in SMAC executing the n_configs from the initial design and, subsequently, the default config you specified. Notice, that it is still not default behaviour to execute the configspace default (if available) |
At long last, this is now an optional feature; see PR #995. Setting Scenario([...], use_default_config=True) will make use of the default config. but it is not the default for legacy reasons, particularly because of the benchmarks, which would be solved by the default config as per Marius' comment above:
|
Steps/Code to Reproduce
Expected Results
The default value 1 is used for the initial design.
Actual Results
For some reason the default value 1 is ignored and instead (lower+upper)/2 is used as the default value.
Versions
0.11.0
The text was updated successfully, but these errors were encountered: