mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-24 14:15:14 +02:00
Merge branch 'devel' of github.com:SheffieldML/GPy into devel
This commit is contained in:
commit
a56f56e9fa
1 changed files with 5 additions and 4 deletions
|
|
@ -7,12 +7,13 @@ import unittest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ..util import linalg_cython
|
from ..util import linalg_cython
|
||||||
|
from ..util import choleskies_cython
|
||||||
config.set('cython', 'working', 'True')
|
config.set('cython', 'working', 'True')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
config.set('cython', 'working', 'False')
|
config.set('cython', 'working', 'False')
|
||||||
|
|
||||||
"""
|
"""
|
||||||
These tests make sure that the opure python and cython codes work the same
|
These tests make sure that the pure python and cython codes work the same
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@unittest.skipIf(not config.getboolean('cython', 'working'),"Cython modules have not been built on this machine")
|
@unittest.skipIf(not config.getboolean('cython', 'working'),"Cython modules have not been built on this machine")
|
||||||
|
|
@ -67,8 +68,8 @@ class test_choleskies_backprop(np.testing.TestCase):
|
||||||
self.L = GPy.util.linalg.jitchol(A)
|
self.L = GPy.util.linalg.jitchol(A)
|
||||||
self.dL = np.random.randn(10,10)
|
self.dL = np.random.randn(10,10)
|
||||||
def test(self):
|
def test(self):
|
||||||
r1 = GPy.util.choleskies._backprop_gradient_pure(self.dL, self.L)
|
r1 = choleskies._backprop_gradient_pure(self.dL, self.L)
|
||||||
r2 = GPy.util.choleskies.choleskies_cython.backprop_gradient(self.dL, self.L)
|
r2 = choleskies_cython.backprop_gradient(self.dL, self.L)
|
||||||
r3 = GPy.util.choleskies.choleskies_cython.backprop_gradient_par_c(self.dL, self.L)
|
r3 = choleskies_cython.backprop_gradient_par_c(self.dL, self.L)
|
||||||
np.testing.assert_allclose(r1, r2)
|
np.testing.assert_allclose(r1, r2)
|
||||||
np.testing.assert_allclose(r1, r3)
|
np.testing.assert_allclose(r1, r3)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue