def GetSuggestions(self, request, context): """ Main function to provide suggestion. """ algorithm_name, config = OptimizerConfiguration.convertAlgorithmSpec( request.experiment.spec.algorithm) if algorithm_name != "bayesianoptimization": raise Exception( "Failed to create the algorithm: {}".format(algorithm_name)) if self.is_first_run: search_space = HyperParameterSearchSpace.convert( request.experiment) self.base_service = BaseSkoptService( base_estimator=config.base_estimator, n_initial_points=config.n_initial_points, acq_func=config.acq_func, acq_optimizer=config.acq_optimizer, random_state=config.random_state, search_space=search_space) self.is_first_run = False trials = Trial.convert(request.trials) new_trials = self.base_service.getSuggestions(trials, request.request_number) return api_pb2.GetSuggestionsReply( parameter_assignments=Assignment.generate(new_trials))
def GetSuggestions(self, request, context): """ Main function to provide suggestion. """ base_serice = BaseChocolateService( algorithm_name=request.experiment.spec.algorithm.algorithm_name) search_space = HyperParameterSearchSpace.convert(request.experiment) trials = Trial.convert(request.trials) new_assignments = base_serice.getSuggestions(search_space, trials, request.request_number) return api_pb2.GetSuggestionsReply( parameter_assignments=Assignment.generate(new_assignments))
def GetSuggestions(self, request, context): """ Main function to provide suggestion. """ name, config = OptimizerConfiguration.convertAlgorithmSpec( request.experiment.spec.algorithm) base_serice = BaseHyperoptService( algorithm_name=name, random_state=config.random_state) search_space = HyperParameterSearchSpace.convert(request.experiment) trials = Trial.convert(request.trials) new_assignments = base_serice.getSuggestions( search_space, trials, request.request_number) return api_pb2.GetSuggestionsReply( parameter_assignments=Assignment.generate(new_assignments) )
def GetSuggestions(self, request, context): """ Main function to provide suggestion. """ name, config = OptimizerConfiguration.convert_algorithm_spec( request.experiment.spec.algorithm) if self.is_first_run: search_space = HyperParameterSearchSpace.convert(request.experiment) self.base_service = BaseHyperoptService( algorithm_name=name, algorithm_conf=config, search_space=search_space) self.is_first_run = False trials = Trial.convert(request.trials) new_assignments = self.base_service.getSuggestions(trials, request.request_number) return api_pb2.GetSuggestionsReply( parameter_assignments=Assignment.generate(new_assignments) )