Skip to content

Commit

Permalink
Refactor python files of suggestion services (kubeflow#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Mar 24, 2020
1 parent 25e5d73 commit a90d396
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions pkg/suggestion/v1alpha3/base_health_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
SERVICE_NAME = _health_pb2.DESCRIPTOR.services_by_name['Health'].full_name


class _Watcher():

class _Watcher:
def __init__(self):
self._condition = threading.Condition()
self._responses = collections.deque()
Expand Down
1 change: 1 addition & 0 deletions pkg/suggestion/v1alpha3/hyperband_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
logger.setLevel(DEBUG)
logger.addHandler(handler)


class HyperbandService(api_pb2_grpc.SuggestionServicer, HealthServicer):
def GetSuggestions(self, request, context):
"""
Expand Down
2 changes: 1 addition & 1 deletion pkg/suggestion/v1alpha3/hyperopt_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pkg.apis.manager.v1alpha3.python import api_pb2
from pkg.apis.manager.v1alpha3.python import api_pb2_grpc

from pkg.suggestion.v1alpha3.internal.search_space import HyperParameter, HyperParameterSearchSpace
from pkg.suggestion.v1alpha3.internal.search_space import HyperParameterSearchSpace
from pkg.suggestion.v1alpha3.internal.trial import Trial, Assignment
from pkg.suggestion.v1alpha3.hyperopt.base_hyperopt_service import BaseHyperoptService
from pkg.suggestion.v1alpha3.base_health_service import HealthServicer
Expand Down
6 changes: 3 additions & 3 deletions pkg/suggestion/v1alpha3/nasrl_service.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logging
from logging import getLogger, StreamHandler, INFO, DEBUG
from logging import getLogger, StreamHandler, INFO
import json
import os
import time
import tensorflow as tf
import grpc

Expand All @@ -13,7 +12,8 @@
from pkg.suggestion.v1alpha3.NAS_Reinforcement_Learning.AlgorithmSettings import parseAlgorithmSettings
from pkg.suggestion.v1alpha3.base_health_service import HealthServicer

class NAS_RL_Experiment(object):

class NAS_RL_Experiment:
def __init__(self, request, logger):
self.logger = logger
self.experiment_name = request.experiment.name
Expand Down
1 change: 1 addition & 0 deletions pkg/suggestion/v1alpha3/parameter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
from sklearn.preprocessing import MinMaxScaler


class ParameterConfig:
"""
Class to hold the parameter configuration for an experiment.
Expand Down

0 comments on commit a90d396

Please sign in to comment.