コード例 #1
0
ファイル: serving.py プロジェクト: vishalbelsare/bbopt
    def attempt_update(self, examples, params, allow_missing_data=False):
        """Update the serving backend with new parameters."""
        # since we're serving, ignore params and just extract the best example
        self.current_values = best_example(examples)["values"]

        # set new allow_missing_data and call init_fallback_backend if necessary
        self.allow_missing_data = allow_missing_data
        if not self.fallback_backend and self.allow_missing_data:
            self.init_fallback_backend()

        return True
コード例 #2
0
 def get_optimal_run(self):
     """Return a dictionary containing the optimal parameters and reward computed so far."""
     return best_example(self._examples)
コード例 #3
0
 def __init__(self, examples, params):
     # since we're serving, ignore params and just extract the best example
     self.current_values = best_example(examples)["values"]
コード例 #4
0
 def attempt_update(self, examples, params):
     """Update the serving backend with new parameters."""
     # since we're serving, ignore params and just extract the best example
     self.current_values = best_example(examples)["values"]
     return True