From a9a285c7906c38b98c00343d759a570dbe98a81d Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Mon, 10 Mar 2014 08:17:19 +0000 Subject: [PATCH] likelihood test --- GPy/testing/likelihood_tests.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GPy/testing/likelihood_tests.py b/GPy/testing/likelihood_tests.py index d2a236dd..631f2ec2 100644 --- a/GPy/testing/likelihood_tests.py +++ b/GPy/testing/likelihood_tests.py @@ -651,7 +651,7 @@ class LaplaceTests(unittest.TestCase): m2['.*white'].constrain_fixed(1e-6) m2['.*rbf.variance'].constrain_bounded(1e-4, 10) m2.randomize() - + if debug: print m1 print m2 @@ -663,9 +663,8 @@ class LaplaceTests(unittest.TestCase): if debug: print m1 print m2 - - m2.parameters_changed() - #m2._set_params(m1._get_params()) + + m2[:] = m1[:] #Predict for training points to get posterior mean and variance post_mean, post_var, _, _ = m1.predict(X) @@ -701,8 +700,9 @@ class LaplaceTests(unittest.TestCase): np.testing.assert_almost_equal(m1.log_likelihood(), m2.log_likelihood(), decimal=2) #Check marginals are the same with random m1.randomize() - #m2._set_params(m1._get_params()) - m2.parameters_changed() + import ipdb;ipdb.set_trace() + m2[:] = m1[:] + np.testing.assert_almost_equal(m1.log_likelihood(), m2.log_likelihood(), decimal=2) #Check they are checkgradding