From 0e7bacbec9e9d2cc3740c46098c6f51f5a1254f2 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Mon, 17 Aug 2015 13:34:09 +0100 Subject: [PATCH] adding new test for cholesky backprop --- GPy/testing/cython_tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GPy/testing/cython_tests.py b/GPy/testing/cython_tests.py index f88f12f3..fd257e5b 100644 --- a/GPy/testing/cython_tests.py +++ b/GPy/testing/cython_tests.py @@ -51,11 +51,16 @@ class test_stationary(np.testing.TestCase): class test_choleskies_backprop(np.testing.TestCase): def setUp(self): - self.dL, self.L = np.random.randn(2, 100, 100) + a =np.random.randn(10,12) + A = a.dot(a.T) + self.L = GPy.util.linalg.jitchol(A) + self.dL = np.random.randn(10,10) def test(self): r1 = GPy.util.choleskies._backprop_gradient_pure(self.dL, self.L) r2 = GPy.util.choleskies.choleskies_cython.backprop_gradient(self.dL, self.L) + r3 = GPy.util.choleskies.choleskies_cython.backprop_gradient_par_c(self.dL, self.L) np.testing.assert_allclose(r1, r2) + np.testing.assert_allclose(r1, r3)