Unverified Commit f2ddea0a authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

fix parameter converting (#4407)

parent c837bfc0
...@@ -213,6 +213,7 @@ class GridSearchTuner(Tuner): ...@@ -213,6 +213,7 @@ class GridSearchTuner(Tuner):
# convert self.vector to "formatted" parameters # convert self.vector to "formatted" parameters
params = {} params = {}
for i, spec in enumerate(self.space.values()): for i, spec in enumerate(self.space.values()):
if spec.is_activated_in(params):
x = self.grid[i][self.vector[i]] x = self.grid[i][self.vector[i]]
if spec.categorical: if spec.categorical:
params[spec.key] = x params[spec.key] = x
...@@ -247,6 +248,6 @@ def _grid_size_info(grid): ...@@ -247,6 +248,6 @@ def _grid_size_info(grid):
if len(grid) == 1: if len(grid) == 1:
return str(len(grid[0])) return str(len(grid[0]))
sizes = [len(candidates) for candidates in grid] sizes = [len(candidates) for candidates in grid]
mul = 'x'.join(str(s) for s in sizes) mul = '×'.join(str(s) for s in sizes)
total = np.prod(sizes) total = np.prod(sizes)
return f'({mul}) = {total}' return f'({mul}) = {total}'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment