added cholesy backprop test

This commit is contained in:
James Hensman 2015-04-29 14:37:51 +01:00
parent a772a6120a
commit edc868c213

View file

@ -49,6 +49,14 @@ class test_stationary(np.testing.TestCase):
g2 = self.k._lengthscale_grads_cython(self.dKxz, self.X, self.Z) g2 = self.k._lengthscale_grads_cython(self.dKxz, self.X, self.Z)
np.testing.assert_allclose(g1, g2) np.testing.assert_allclose(g1, g2)
class test_choleskies_backprop(np.testing.TestCase):
def setUp(self):
self.dL, self.L = np.random.randn(2, 100, 100)
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)
np.testing.assert_allclose(r1, r2)