mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[Tune] Bug fix - HEBOSearch - accept iterables as a config search space (#24678)
HEBOSearch algorithm currently fails if the config search space contains a categorical parameter where each category is an iterable. For instance, choosing the hidden layers of a NN: ` hyperparam_search_space = {'hidden_sizes': tune.choice([[512, 256, 128], [1024, 512, 256]])}` This is due to the creation of the Pandas DataFrame with HEBO suggested parameters, without explicitly telling Pandas that the hyper-parameter suggestion is a single row of data while the index is being defined as a single row. This results in an exception such as "ValueError: Length of values (3) does not match length of index (1)". Co-authored-by: Makan Arastuie <makan.arastuie@seagate.com>
This commit is contained in:
parent
e95207a298
commit
5e23d9e298
1 changed files with 2 additions and 2 deletions
|
@ -272,7 +272,7 @@ class HEBOSearch(Searcher):
|
|||
|
||||
if self._initial_points:
|
||||
params = self._initial_points.pop(0)
|
||||
suggestion = pd.DataFrame(params, index=[0])
|
||||
suggestion = pd.DataFrame([params], index=[0])
|
||||
else:
|
||||
if (
|
||||
self._batch_filled
|
||||
|
@ -283,7 +283,7 @@ class HEBOSearch(Searcher):
|
|||
suggestion = self._opt.suggest(n_suggestions=self._max_concurrent)
|
||||
self._suggestions_cache = suggestion.to_dict("records")
|
||||
params = self._suggestions_cache.pop(0)
|
||||
suggestion = pd.DataFrame(params, index=[0])
|
||||
suggestion = pd.DataFrame([params], index=[0])
|
||||
self._live_trial_mapping[trial_id] = suggestion
|
||||
if len(self._live_trial_mapping) >= self._max_concurrent:
|
||||
self._batch_filled = True
|
||||
|
|
Loading…
Add table
Reference in a new issue