Ejemplo n.º 1
0
    def test_cmaes(self):
        maximizer = CMAES(objective_function, self.lower, self.upper)
        x = maximizer.maximize()

        assert x.shape[0] == 2
        assert len(x.shape) == 1
        assert np.all(x >= self.lower)
        assert np.all(x <= self.upper)
Ejemplo n.º 2
0
    def test_cmaes(self):
        maximizer = CMAES(self.objective_function, self.lower, self.upper)
        x = maximizer.maximize()

        assert x.shape[0] == 2
        assert len(x.shape) == 1
        assert np.all(x >= self.lower)
        assert np.all(x <= self.upper)
Ejemplo n.º 3
0
    def test_cmaes(self):
        maximizer = CMAES(self.acquisition_func, self.branin.X_lower, self.branin.X_upper)
        x = maximizer.maximize(verbose=False)

        assert x.shape[0] == 1
        assert x.shape[1] == self.branin.n_dims
        assert np.all(x[:, 0] >= self.branin.X_lower[0])
        assert np.all(x[:, 1] >= self.branin.X_lower[1])
        assert np.all(x[:, 0] <= self.branin.X_upper[0])
        assert np.all(x[:, 1] <= self.branin.X_upper[1])
        assert np.all(x < self.branin.X_upper)
Ejemplo n.º 4
0
    def test_cmaes(self):
        maximizer = CMAES(self.acquisition_func, self.branin.X_lower,
                          self.branin.X_upper)

        x = maximizer.maximize()

        assert x.shape[0] == 1
        assert x.shape[1] == self.branin.n_dims
        assert np.all(x[:, 0] >= self.branin.X_lower[0])
        assert np.all(x[:, 1] >= self.branin.X_lower[1])
        assert np.all(x[:, 0] <= self.branin.X_upper[0])
        assert np.all(x[:, 1] <= self.branin.X_upper[1])
        assert np.all(x < self.branin.X_upper)