From 045dc6d1525acd0c860a61f2b0fb96dd8c0aa095 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Fri, 20 Sep 2013 16:57:01 +0100 Subject: [PATCH] sparse_gp_multioutput test added --- GPy/testing/unit_tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/GPy/testing/unit_tests.py b/GPy/testing/unit_tests.py index 6bb624df..e4d9e063 100644 --- a/GPy/testing/unit_tests.py +++ b/GPy/testing/unit_tests.py @@ -238,6 +238,18 @@ class GradientTests(unittest.TestCase): m.constrain_fixed('.*rbf_var', 1.) self.assertTrue(m.checkgrad()) + def multioutput_sparse_regression_1D(self): + X1 = np.random.rand(500, 1) * 8 + X2 = np.random.rand(300, 1) * 5 + X = np.vstack((X1, X2)) + Y1 = np.sin(X1) + np.random.randn(*X1.shape) * 0.05 + Y2 = -np.sin(X2) + np.random.randn(*X2.shape) * 0.05 + Y = np.vstack((Y1, Y2)) + + k1 = GPy.kern.rbf(1) + m = GPy.models.SparseGPMultioutputRegression(X_list=[X1,X2],Y_list=[Y1,Y2],kernel_list=[k1]) + m.constrain_fixed('.*rbf_var', 1.) + self.assertTrue(m.checkgrad()) if __name__ == "__main__": print "Running unit tests, please be (very) patient..."