Skip to content

Commit

Permalink
Fix typo in suggestion packages (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata authored Apr 13, 2020
1 parent 298b8c3 commit e5bae59
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- Delete Suggestion deployment after Experiment is finished [#1061](https://github.com/kubeflow/katib/issues/1061)
- Save Suggestion state after deployment is deleted [#1062](https://github.com/kubeflow/katib/issues/1062)
- Reconsider the design of Trial Template [#906](https://github.com/kubeflow/katib/issues/906)
- Add validation for algortihms (a.k.a suggestions) [#1126](https://github.com/kubeflow/katib/issues/1126)
- Add validation for algorithms (a.k.a suggestions) [#1126](https://github.com/kubeflow/katib/issues/1126)

### Neural Architecture Search

Expand Down
4 changes: 2 additions & 2 deletions pkg/suggestion/v1alpha3/chocolate_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def GetSuggestions(self, request, context):
if self.is_first_run:
search_space = HyperParameterSearchSpace.convert(
request.experiment)
self.base_serice = BaseChocolateService(
self.base_service = BaseChocolateService(
algorithm_name=request.experiment.spec.algorithm.algorithm_name,
search_space=search_space)
self.is_first_run = False

trials = Trial.convert(request.trials)
new_assignments = self.base_serice.getSuggestions(
new_assignments = self.base_service.getSuggestions(
trials, request.request_number)
return api_pb2.GetSuggestionsReply(
parameter_assignments=Assignment.generate(new_assignments)
Expand Down
2 changes: 1 addition & 1 deletion pkg/suggestion/v1alpha3/hyperopt/base_hyperopt_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, algorithm_name=TPE_ALGORITHM_NAME, random_state=None, search_
# elif algorithm_name == 'hyperopt-mix':
# self.hyperopt_algorithm = hyperopt.mix.suggest
else:
raise Exception('"Failed to create the algortihm: {}'.format(algorithm_name))
raise Exception('"Failed to create the algorithm: {}'.format(algorithm_name))

self.search_space = search_space
# New hyperopt variables
Expand Down
2 changes: 1 addition & 1 deletion pkg/suggestion/v1alpha3/internal/search_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def convertParameter(p):
if p.parameter_type == api.INT:
# Default value for INT parameter step is 1
step = 1
if p.feasible_space.step != None and p.feasible_space.step != "":
if p.feasible_space.step is not None and p.feasible_space.step != "":
step = p.feasible_space.step
return HyperParameter.int(p.name, p.feasible_space.min, p.feasible_space.max, step)
elif p.parameter_type == api.DOUBLE:
Expand Down
2 changes: 1 addition & 1 deletion pkg/suggestion/v1alpha3/skopt_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def GetSuggestions(self, request, context):
algorithm_name, config = OptimizerConfiguration.convertAlgorithmSpec(
request.experiment.spec.algorithm)
if algorithm_name != "bayesianoptimization":
raise Exception("Failed to create the algortihm: {}".format(algorithm_name))
raise Exception("Failed to create the algorithm: {}".format(algorithm_name))

if self.is_first_run:
search_space = HyperParameterSearchSpace.convert(request.experiment)
Expand Down

0 comments on commit e5bae59

Please sign in to comment.