(self, X=None, y=None, do_optimize=True)
return x
Suggests a new point to evaluate.

        Parameters
        ----------
        X: np.ndarray(N,D)
            Initial points that are already evaluated
        y: np.ndarray(N,1)
            Function values of the already evaluated points
        do_optimize: bool
            If true the hyperparameters of the model are
            optimized before the acquisition function is
            maximized.
        Returns
        -------
        np.ndarray(1,D)
            Suggested point
Suggests a new point to evaluate.
Suggests a new point to evaluate .
def choose_next(self, X=None, y=None, do_optimize=True):
        """
        Suggests a new point to evaluate.

        Parameters
        ----------
        X: np.ndarray(N,D)
            Initial points that are already evaluated
        y: np.ndarray(N,1)
            Function values of the already evaluated points
        do_optimize: bool
            If true the hyperparameters of the model are
            optimized before the acquisition function is
            maximized.
        Returns
        -------
        np.ndarray(1,D)
            Suggested point
        """

        if X is None and y is None:
            x = self.initial_design(self.lower, self.upper, 1, rng=self.rng)[0, :]

        elif X.shape[0] == 1:
            # We need at least 2 data points to train a GP
            x = self.initial_design(self.lower, self.upper, 1, rng=self.rng)[0, :]

        else:
            try:
                logger.info("Train model...")
                t = time.time()
                self.model.train(X, y, do_optimize=do_optimize)
                logger.info("Time to train the model: %f", (time.time() - t))
            except:
                logger.error("Model could not be trained!")
                raise
            self.acquisition_func.update(self.model)

            logger.info("Maximize acquisition function...")
            t = time.time()
            x = self.maximize_func.maximize()

            logger.info("Time to maximize the acquisition function: %f", (time.time() - t))

        return x
def choose_next ( self , X = None , y = None , do_optimize = True ) : if X is None and y is None : x = self . initial_design ( self . lower , self . upper , 1 , rng = self . rng ) [ 0 , : ] elif X . shape [ 0 ] == 1 : # We need at least 2 data points to train a GP x = self . initial_design ( self . lower , self . upper , 1 , rng = self . rng ) [ 0 , : ] else : try : logger . info ( "Train model..." ) t = time . time ( ) self . model . train ( X , y , do_optimize = do_optimize ) logger . info ( "Time to train the model: %f" , ( time . time ( ) - t ) ) except : logger . error ( "Model could not be trained!" ) raise self . acquisition_func . update ( self . model ) logger . info ( "Maximize acquisition function..." ) t = time . time ( ) x = self . maximize_func . maximize ( ) logger . info ( "Time to maximize the acquisition function: %f" , ( time . time ( ) - t ) ) return x