From 7a34e1c446a95ffd07d0a77c9c28730f2194d495 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Sun, 16 Dec 2012 17:16:03 +0000 Subject: [PATCH] some natural gradients of the uncollapsed GP implemented --- GPy/models/uncollapsed_sparse_GP.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/GPy/models/uncollapsed_sparse_GP.py b/GPy/models/uncollapsed_sparse_GP.py index 7c1cdb35..f0193a31 100644 --- a/GPy/models/uncollapsed_sparse_GP.py +++ b/GPy/models/uncollapsed_sparse_GP.py @@ -125,7 +125,14 @@ class uncollapsed_sparse_GP(sparse_GP_regression): Note that the natural gradient in either is given by the gradient in the other (See Hensman et al 2012 Fast Variational inference in the conjugate exponential Family) """ - foobar #TODO + dL_dmmT_S = -0.5*self.Lambda+self.q_u_canonical[1] + dL_dm = np.dot(self.Kmmi,self.psi1V) - self.q_u_canonical[0] + + #dL_dSim = + #dL_dmhSi = + + return np.hstack((dL_dm.flatten(),dL_dmmT_S.flatten())) # natgrad only, grad TODO + def plot(self, *args, **kwargs): """