Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronkl committed Oct 18, 2016
1 parent 06c0f8c commit 74c1ec0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions robo/test/test_ei.py
Expand Up @@ -14,7 +14,7 @@ class EITestCase(unittest.TestCase):
def setUp(self):
self.X_lower = np.array([0])
self.X_upper = np.array([1])
self.rng = np.random.RandomState(42)
self.rng = np.random.RandomState(np.random.randint(1, 100000))
self.X = init_random_uniform(self.X_lower, self.X_upper, 10, self.rng)
self.Y = np.sin(self.X)
self.kernel = GPy.kern.RBF(input_dim=1)
Expand All @@ -41,9 +41,10 @@ def test_general_interface(self):
assert dadx.shape[1] == x_test.shape[1]

def test_check_grads(self):

x_ = np.array([[self.rng.rand()]])

assert check_grad(self.ei, lambda x: self.ei(x, True)[1], x_) < 1e-3
assert check_grad(self.ei, lambda x: self.ei(x, True)[1], x_, epsilon=1e-6) < 1e-3

if __name__ == "__main__":
unittest.main()

0 comments on commit 74c1ec0

Please sign in to comment.