slightly improved computation for var_Gauss method

This commit is contained in:
James Hensman 2015-09-04 15:11:50 +01:00
parent d28483807d
commit 56acbf4e0a

View file

@ -47,7 +47,10 @@ class VarGauss(LatentFunctionInference):
dL_dthetaL = np.array([])
dF_da = np.dot(K, dF_dm)
SigmaB = Sigma*self.beta
dF_db = -np.diag(Sigma.dot(np.diag(dF_dv.flatten())).dot(SigmaB))*2
#dF_db_ = -np.diag(Sigma.dot(np.diag(dF_dv.flatten())).dot(SigmaB))*2
dF_db = -2*np.sum(Sigma**2 * (dF_dv * self.beta), 0)
#assert np.allclose(dF_db, dF_db_)
KL = 0.5*(Alogdet + np.trace(Ai) - num_data + np.sum(m*self.alpha))
dKL_da = m
A_A2 = Ai - Ai.dot(Ai)