Skip to content
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

Documentation/Inspection ask/tell #1206

Open
benjamc opened this issue Feb 27, 2025 · 3 comments · May be fixed by #1212
Open

Documentation/Inspection ask/tell #1206

benjamc opened this issue Feb 27, 2025 · 3 comments · May be fixed by #1212
Assignees
Labels
discussion documentation Documentation is needed/added.
Milestone

Comments

@benjamc
Copy link
Collaborator

benjamc commented Feb 27, 2025

  • document that ask and tell does not care about n_trials (but the initial design does)
  • should there be no initial design preset for using ask/tell?
  • what happens if you use the random facade /sobol and you ask for more than the specified trials? does sobol depend on the number of trials? if it does, raise a warning
@benjamc benjamc added discussion documentation Documentation is needed/added. labels Feb 27, 2025
@benjamc benjamc added this to the v2.4 milestone Feb 27, 2025
@timruhkopf
Copy link
Collaborator

timruhkopf commented Feb 27, 2025

should there be no initial design preset for using ask/tell?

I was actually hoping that one could just set n_configs=0 in get_initial_design, but this line seems to silently overwrite user intention and still asks for at least one configuration from the initial design. I think this is bad conduct.
Btw. setting n_trials=0 in the scenario will raise, because of the n_configs=1 overwrite here

Either way the initial_design configuration is populated in the ConfigSelector._initial_design_configs and only executed/ask'ed for when ConfigSelector.iter is being called, which i think should only be done once the intensifier is being queried for a new configuration. So i suspect that an ask call will trigger this initial design config (checked this just now and it actually does)

Similarly passing None to the HyperparameterOptmizationFacade.__init__(initial_design=None) will just instantiate the default by get_initial_design which I think is confusing behaviour. But this is apparently how facades work.

@timruhkopf
Copy link
Collaborator

timruhkopf commented Feb 27, 2025

Changing the previously mentioned line to _n_configs=max(0,min(...)) will indeed produce no initial design configs, but in turn raises -- This line warns us about a potential malfunction of smac without initial design configs, but as it turns out an ask will eventually collect the first config by configspace.sample_configuration by means of ConfigSelector.__iter__ if there is no runhistory provided in advance. So it seems that the ConfigSelector can actually handle this edge case.

however the int(max(0, min())) has the side effect, that once we set n_configs=1 scenario.n_trials=1 this will yield a int(max(0,0.25)) and in turn not sample a configuration from the initial_design despite our best intentions

@timruhkopf
Copy link
Collaborator

what happens if you use the random facade /sobol and you ask for more than the specified trials? does sobol depend on the number of trials? if it does, raise a warning

is not an issue. Only dependency is through the above mentioned line. I.e. in determining how many configs should be used in the initial design based off the assumed share of max_ratio of the trials : min(self._n_configs, (max_ratio * scenario.n_trials). Other than that, once the initial configs that have been determined in the ConfigSelector and are depleted by ask in ConfigSelector.__iter__ the ask will continue to run the usual __iter__ loop including model training. At this point n_trials becomes irrelevant and we can continue to ask indefinetly.

@timruhkopf timruhkopf linked a pull request Feb 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion documentation Documentation is needed/added.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants