mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-07 11:02:38 +02:00
likelihood test
This commit is contained in:
parent
4ce2eb2ac6
commit
a9a285c790
1 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue