[minibatch] added coverage for branching, spottet bug in X_variance

This commit is contained in:
mzwiessele 2016-03-08 11:19:50 +00:00
parent 88a9b92c80
commit 67043e83d7
2 changed files with 13 additions and 12 deletions

View file

@ -54,7 +54,7 @@ class BGPLVMTest(unittest.TestCase):
def test_lik_comparisons_m0_s0(self):
# Test if the different implementations give the exact same likelihood as the full model.
# All of the following settings should give the same likelihood and gradients as the full model:
m = GPy.models.bayesian_gplvm_minibatch.BayesianGPLVMMiniBatch(self.Y, self.Q, missing_data=False, stochastic=False)
m = GPy.models.bayesian_gplvm_minibatch.BayesianGPLVMMiniBatch(self.Y, self.Q, X_variance=self.m_full.X.variance.values, missing_data=False, stochastic=False)
m[:] = self.m_full[:]
np.testing.assert_almost_equal(m.log_likelihood(), self.m_full.log_likelihood(), 7)
np.testing.assert_allclose(m.gradient, self.m_full.gradient)