Ejemplo n.º 1
0
    def __init__(self, path=None):
        super().__init__(path)
        ones = np.ones(self.config.dimension)

        self._dist_initial = np.sqrt(np.log(1 / self.config.initial_value) / 4)
        self._x0 = self._dist_initial * ones / np.sqrt(self.config.dimension)
        self._max_value = 1.0
        self._domain = ContinuousDomain(-ones, ones)
Ejemplo n.º 2
0
    def __init__(self, path=None):
        super().__init__(path)
        self._max_value = self.config.s

        theta = np.random.normal(size=self.config.dimension)
        self._theta = theta / np.linalg.norm(theta) * self.config.s
        self._domain = ContinuousDomain(-2 * np.ones(self.config.dimension),
                                        2 * np.ones(self.config.dimension))
Ejemplo n.º 3
0
 def __init__(self, path=None):
     super().__init__(path)
     self._max_value = 1.03162842
     d = self.config.dimension
     if d <= 2:
         raise Exception(
             "Need dimension at least 3 to create embedded version of Camelback"
         )
     self._x0 = np.array([0.5, 0.2] + [0.] * (d - 2))
     self._domain = ContinuousDomain(np.array([-2, -1] + [-1] * (d - 2)),
                                     np.array([2, 1] + [1] * (d - 2)))
Ejemplo n.º 4
0
    def test_norm_denorm_same(self):
        self.init()

        for i in range(20):

            self.X = (np.random.random((self.dim,)) - 0.5) * 2.

            assert (self.X <= 1.0).all()
            assert (self.X >= -1.0).all()

            domain = ContinuousDomain(np.asarray([-5] * self.dim), np.asarray([2] * self.dim))

            X_norm = rembo_algorithm.normalize(self.X, domain)
            X_denorm = rembo_algorithm.denormalize(X_norm, domain)

            assert np.isclose(self.X, X_denorm).all(), ("Not quite the same values after norm+denorm! ", (self.X, X_denorm))
Ejemplo n.º 5
0
 def __init__(self, path=None):
     super().__init__(path)
     self._x0 = np.array([0., 0.])
     self._max_value = 1.
     self._domain = ContinuousDomain(np.array([-0.5, -0.5]),
                                     np.array([0.5, 0.5]))
Ejemplo n.º 6
0
 def __init__(self, path=None):
     super().__init__(path)
     self._x0 = np.array([0.5, 0.2])
     self._x0 = np.array([-0.12977758051079197, 0.2632096107305229])
     self._max_value = 1.03162842
     self._domain = ContinuousDomain(np.array([-2, -1]), np.array([2, 1]))
Ejemplo n.º 7
0
 def __init__(self, path=None):
     super().__init__(path)
     self._x = np.array([1.])
     self._max_value = 1.0026469
     self._domain = ContinuousDomain(np.array([-1]), np.array([2]))
Ejemplo n.º 8
0
 def __init__(self, path=None):
     super().__init__(path)
     self._x = np.array([0.1])
     self._max_value = 1.1  # at 0.5
     self._domain = ContinuousDomain(np.array([0.]), np.array([1]))
Ejemplo n.º 9
0
 def __init__(self, path=None):
     super().__init__(path)
     self._x = np.array([15])
     self._max_value = 1.25375424  # determined using scipy.minimze
     self._domain = ContinuousDomain(np.array([-20]), np.array([20]))
Ejemplo n.º 10
0
 def __init__(self, path=None):
     super().__init__(path)
     ones = np.ones(self.config.dimension)
     self._x0 = 0.5 * ones / np.sqrt(self.config.dimension)
     self._max_value = 1.0
     self._domain = ContinuousDomain(-ones, ones)