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

Fix duplicated imports #1133

Merged
merged 2 commits into from
Apr 13, 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
6 changes: 2 additions & 4 deletions pkg/suggestion/v1alpha3/chocolate/base_chocolate_service.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import json
import numpy as np
import chocolate as choco
import logging
import base64

from pkg.suggestion.v1alpha3.internal.search_space import *
from pkg.suggestion.v1alpha3.internal.trial import *
from pkg.suggestion.v1alpha3.internal.constant import *
from pkg.suggestion.v1alpha3.internal.trial import Assignment

logger = logging.getLogger(__name__)

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 @@ -3,9 +3,9 @@

from pkg.apis.manager.v1alpha3.python import api_pb2
from pkg.apis.manager.v1alpha3.python import api_pb2_grpc
from pkg.apis.manager.health.python import health_pb2

from pkg.suggestion.v1alpha3.internal.search_space import HyperParameter, HyperParameterSearchSpace, DOUBLE
from pkg.suggestion.v1alpha3.internal.constant import *
from pkg.suggestion.v1alpha3.internal.search_space import HyperParameterSearchSpace
from pkg.suggestion.v1alpha3.internal.trial import Trial, Assignment
from pkg.suggestion.v1alpha3.chocolate.base_chocolate_service import BaseChocolateService
from pkg.suggestion.v1alpha3.base_health_service import HealthServicer
Expand Down
6 changes: 3 additions & 3 deletions pkg/suggestion/v1alpha3/hyperopt/base_hyperopt_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
import numpy as np
import logging

from pkg.suggestion.v1alpha3.internal.search_space import *
from pkg.suggestion.v1alpha3.internal.trial import *
from pkg.suggestion.v1alpha3.internal.constant import *
from pkg.suggestion.v1alpha3.internal.trial import Assignment

logger = logging.getLogger(__name__)

TPE_ALGORITHM_NAME = "tpe"
RANDOM_ALGORITHM_NAME = "random"


class BaseHyperoptService(object):
def __init__(self, algorithm_name=TPE_ALGORITHM_NAME, random_state=None, search_space=None):
self.algorithm_name = algorithm_name
Expand Down Expand Up @@ -64,7 +65,6 @@ def create_fmin(self):

self.fmin.catch_eval_exceptions = False


def getSuggestions(self, trials, request_number):
"""
Get the new suggested trials with the given algorithm.
Expand Down
Empty file.
7 changes: 7 additions & 0 deletions pkg/suggestion/v1alpha3/internal/constant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MAX_GOAL = "MAXIMIZE"
MIN_GOAL = "MINIMIZE"

INTEGER = "INTEGER"
DOUBLE = "DOUBLE"
CATEGORICAL = "CATEGORICAL"
DISCRETE = "DISCRETE"
7 changes: 1 addition & 6 deletions pkg/suggestion/v1alpha3/internal/search_space.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import logging
from pkg.apis.manager.v1alpha3.python import api_pb2 as api

MAX_GOAL = "MAXIMIZE"
MIN_GOAL = "MINIMIZE"
from .constant import *

INTEGER = "INTEGER"
DOUBLE = "DOUBLE"
CATEGORICAL = "CATEGORICAL"
DISCRETE = "DISCRETE"

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
Expand Down
10 changes: 4 additions & 6 deletions pkg/suggestion/v1alpha3/skopt/base_skopt_service.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import json
import numpy as np
import skopt
import datetime
import logging
import skopt

from pkg.suggestion.v1alpha3.internal.search_space import *
from pkg.suggestion.v1alpha3.internal.trial import *
import datetime
from pkg.suggestion.v1alpha3.internal.constant import *
from pkg.suggestion.v1alpha3.internal.trial import Assignment

logger = logging.getLogger(__name__)

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 @@ -2,7 +2,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.skopt.base_skopt_service import BaseSkoptService
from pkg.suggestion.v1alpha3.base_health_service import HealthServicer
Expand Down