mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-07 11:02:38 +02:00
add ssgplvm model test
This commit is contained in:
parent
00e4ac152a
commit
e9cc56e8e8
1 changed files with 13 additions and 1 deletions
|
|
@ -704,7 +704,19 @@ class GradientTests(np.testing.TestCase):
|
||||||
lik = GPy.likelihoods.Gaussian()
|
lik = GPy.likelihoods.Gaussian()
|
||||||
m = GPy.models.GPVariationalGaussianApproximation(X, Y, kernel=kern, likelihood=lik)
|
m = GPy.models.GPVariationalGaussianApproximation(X, Y, kernel=kern, likelihood=lik)
|
||||||
self.assertTrue(m.checkgrad())
|
self.assertTrue(m.checkgrad())
|
||||||
|
|
||||||
|
def test_ssgplvm(self):
|
||||||
|
from GPy import kern
|
||||||
|
from GPy.models import SSGPLVM
|
||||||
|
from GPy.examples.dimensionality_reduction import _simulate_matern
|
||||||
|
|
||||||
|
D1, D2, D3, N, num_inducing, Q = 13, 5, 8, 45, 3, 9
|
||||||
|
_, _, Ylist = _simulate_matern(D1, D2, D3, N, num_inducing, False)
|
||||||
|
Y = Ylist[0]
|
||||||
|
k = kern.Linear(Q, ARD=True) # + kern.white(Q, _np.exp(-2)) # + kern.bias(Q)
|
||||||
|
# k = kern.RBF(Q, ARD=True, lengthscale=10.)
|
||||||
|
m = SSGPLVM(Y, Q, init="rand", num_inducing=num_inducing, kernel=k, group_spike=True)
|
||||||
|
self.assertTrue(m.checkgrad())
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print("Running unit tests, please be (very) patient...")
|
print("Running unit tests, please be (very) patient...")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue