Skip to content

Commit

Permalink
Fix Optuna tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvelich committed Aug 17, 2021
1 parent 5316709 commit 6f36d29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/suggestion/v1beta1/goptuna/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ func toGoptunaSampler(algorithm *api_v1_beta1.AlgorithmSpec) (goptuna.Sampler, g
return nil, nil, err
}
opts = append(opts, tpe.SamplerOptionSeed(int64(seed)))
} else if s.Name == "startup_trials" {
} else if s.Name == "n_startup_trials" {
n, err := strconv.Atoi(s.Value)
if err != nil {
return nil, nil, err
}
opts = append(opts, tpe.SamplerOptionNumberOfStartupTrials(n))
} else if s.Name == "ei_candidates" {
} else if s.Name == "n_ei_candidates" {
n, err := strconv.Atoi(s.Value)
if err != nil {
return nil, nil, err
Expand Down
8 changes: 4 additions & 4 deletions test/suggestion/v1beta1/test_optuna_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def setup_method(self):
servicers, grpc_testing.strict_real_time())

@pytest.mark.parametrize(
["algorithm_name", "algorithm_settings"],
["algorithm_name", "algorithm_settings"],
[
["tpe", {"startup_trials": "20", "ei_candidates": "10", "random_state": "71"}],
["multivariate-tpe", {"startup_trials": "20", "ei_candidates": "10", "random_state": "71"}],
["tpe", {"n_startup_trials": "20", "n_ei_candidates": "10", "random_state": "71"}],
["multivariate-tpe", {"n_startup_trials": "20", "n_ei_candidates": "10", "random_state": "71"}],
["cmaes", {"restart_strategy": "ipop", "sigma": "2", "random_state": "71"}],
["random", {"random_state": "71"}],
],
Expand All @@ -47,7 +47,7 @@ def test_get_suggestion(self, algorithm_name, algorithm_settings):
spec=api_pb2.ExperimentSpec(
algorithm=api_pb2.AlgorithmSpec(
algorithm_name=algorithm_name,
algorithm_settings = [
algorithm_settings=[
api_pb2.AlgorithmSetting(
name=name,
value=value
Expand Down

0 comments on commit 6f36d29

Please sign in to comment.