You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A workaround for activating HPs could be the following:
space= {
"a": [1, 2, 3, 4],
"b": ["red", "green", "blue"],
"c": [True, False],
"d": (0, 1)
}
config= {
"conditional_meta_info": {
# Only activate a when b is red or blue"a": ("b", ["red", "blue"]),
# only activate b when c is true (hence, also only activate a when c is True)"b": ("c", True),
# only activate d when b is blue and c is True"d": [("b", "blue"), ("c", True)]
}
}
# ...build space, sample from space...input_pipeline=pipeline.configure(trial.config)
forconfig_key, conditionsininput_pipeline.tail.config.pop("conditional_meta_info").items():
list_check=lambdac_v: (c_vifisinstance(c_v, list) else [c_v])
conditions=list_check(conditions)
ifany(
# 1. Check if relevant key already deleted or not part of the config, if so we# assume the condition is not met.
(condition_keynotininput_pipeline.tail.config) or# 2. Check if condition is not met directly.
(input_pipeline.tail.config[condition_key] notinlist_check(condition_values))
# - check this for all possible conditionsforcondition_key, condition_valuesinconditions
):
# If any of the above for any condition, delete the config key;# removing it from the pipeline.delinput_pipeline.tail.config[config_key]
We build a space with all HPs and remove deactivated HPs post hoc.
Just a suggestion, it's a bit redundant but hopefully clear in terms of how it would work
The text was updated successfully, but these errors were encountered: