MLOS
MLOS copied to clipboard
Optimizer not erroring on spurious configuration elements
The Bayesian Optimization notebook had a typo
optimizer_config.experiment_designer_config_fraction_random_suggestions = .1
It should have been
optimizer_config.experiment_designer_config.fraction_random_suggestions = .1
It would be great if we could check that the config is valid when instantiating.
For reference, the optimizer was created via
optimizer_factory = BayesianOptimizerFactory()
optimizer = optimizer_factory.create_local_optimizer(
optimization_problem=optimization_problem,
optimizer_config=optimizer_config
)
What happened here was a new key-value pair was created in the config: experiment_designer_config_fraction_random_suggestions = 0.1
The existing key-value pair: experiment_designer_config.fraction_random_suggestions = 0.5 remained unchanged.
Thus, the resulting configuration contained all required keys, and values for those keys were within allowed ranges (and we assert that both of those conditions are true before creating the optimizer).
It also contained an additional key-value pair, that was ignored.
To me, a valid config that specifies some superfluous parameters remains a valid config, but if you wish to warn the user that they may have added an unexpected parameter, feel free to implement a "strict" check too.
Thanks, I figured that's what had happened. I think it would be good to warn the user. Guiding the users away from mistakes is always good, and this one (mistyping a parameter name) seems an easy mistake to make.