How to create a search space where one key-value depends on another key-value?

Both HyperOpt and BayesOpt don’t seem to support.

space = {
    "lr": tune.sample_from(lambda spec: random.uniform(1e-3, 1e-5)),
    "decay": tune.sample_from(lambda spec: spec.config.lr / 100.0),
}
  1. How do you suggest we go about using conditional search spaces for these algorithms?
  2. What all algorithms support tune.sample_from API?

Hmm, I see. Search Space API — Ray v2.0.0.dev0 Seems like we didn’t update the docs.

@Yard1 when you get the time, can you link to the hyperopt/optuna examples for conditional search spaces in the SearchSpace API page?

1 Like