ConfigSpace
ConfigSpace copied to clipboard
How to create a set of possible configurations (union)?
Hi Guys,
I'd like to create a set of possible configuration spaces and then create a union of them, for example:
cat_hp1 = CSH.CategoricalHyperparameter('cat_hp', choices=['red', 'green', 'blue'])
uniform_integer_hp1 = CSH.UniformIntegerHyperparameter(name='uni_int', lower=10, upper=100))
cs_set1.add_hyperparameters([cat_hp1, uniform_integer_hp1])
cat_hp2 = CSH.CategoricalHyperparameter('cat_hp', choices=['cyan', 'magenta', 'yellow', 'black])
uniform_integer_hp2 = CSH.UniformIntegerHyperparameter(name='uni_int', lower=1, upper=10))
cs_set2.add_hyperparameters([cat_hp2, uniform_integer_hp2])
Then combine these two into one configuration space cs_union
and sample from it, is that possible ?
There's a function called add_configuration_space
with which you can add one configuration space to another.
Thanks @mfeurer !
From what I understand add_configuration_space
will sample from all added configurations, is that correct ?
I'm looking for "kind of conditional?!" , for example let's assume I added two configuration "first" and "second" by calling add_configuration_space
. I would like to sample from either "first" or "second" , but not both, then on the selected sub-configuration sample it's variables as usual.
Is that possible ?
There's an argument parent_hyperparameter
that should do what you want here.