Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor python files of suggestion services #1107

Merged
merged 1 commit into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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