Skip to content

Commit 733d982

Browse files
Upgrade Optuna from v2.x.x to v3.0.0 (#1942)
* Use new distributions in Optuna v3 * Update optuna to v3
1 parent ca903e2 commit 733d982

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
grpcio==1.41.1
22
protobuf==3.19.1
33
googleapis-common-protos==1.53.0
4-
optuna<3.0.0
4+
optuna>=3.0.0

pkg/suggestion/v1beta1/optuna/base_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ def _get_optuna_search_space(self):
9191
search_space = {}
9292
for param in self.search_space.params:
9393
if param.type == INTEGER:
94-
search_space[param.name] = optuna.distributions.IntUniformDistribution(int(param.min), int(param.max))
94+
search_space[param.name] = optuna.distributions.IntDistribution(int(param.min), int(param.max))
9595
elif param.type == DOUBLE:
96-
search_space[param.name] = optuna.distributions.UniformDistribution(float(param.min), float(param.max))
96+
search_space[param.name] = optuna.distributions.FloatDistribution(float(param.min), float(param.max))
9797
elif param.type == CATEGORICAL or param.type == DISCRETE:
9898
search_space[param.name] = optuna.distributions.CategoricalDistribution(param.list)
9999
return search_space

0 commit comments

Comments
 (0)