From 9170067e52a10b4739daee2be67be571961aa48a Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Mon, 7 Oct 2013 07:42:44 +0100 Subject: [PATCH] comment linear x linear for testing purposes --- GPy/kern/kern.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/GPy/kern/kern.py b/GPy/kern/kern.py index 4a822758..7778f2f2 100644 --- a/GPy/kern/kern.py +++ b/GPy/kern/kern.py @@ -433,8 +433,8 @@ class kern(Parameterized): prod = np.multiply(tmp1, tmp2) crossterms += prod[:, :, None] + prod[:, None, :] - # target += crossterms - return target + crossterms + target += crossterms + return target def dpsi2_dtheta(self, dL_dpsi2, Z, mu, S): """Gradient of the psi2 statistics with respect to the parameters.""" @@ -462,8 +462,8 @@ class kern(Parameterized): # compute the "cross" terms # TODO: we need input_slices here. for p1, p2 in itertools.permutations(self.parts, 2): - if p1.name == 'linear' and p2.name == 'linear': - raise NotImplementedError("We don't handle linear/linear cross-terms") +# if p1.name == 'linear' and p2.name == 'linear': +# raise NotImplementedError("We don't handle linear/linear cross-terms") tmp = np.zeros((mu.shape[0], Z.shape[0])) p1.psi1(Z, mu, S, tmp) p2.dpsi1_dZ((tmp[:, None, :] * dL_dpsi2).sum(1), Z, mu, S, target) @@ -477,9 +477,8 @@ class kern(Parameterized): # compute the "cross" terms # TODO: we need input_slices here. for p1, p2 in itertools.permutations(self.parts, 2): - if p1.name == 'linear' and p2.name == 'linear': - raise NotImplementedError("We don't handle linear/linear cross-terms") - +# if p1.name == 'linear' and p2.name == 'linear': +# raise NotImplementedError("We don't handle linear/linear cross-terms") tmp = np.zeros((mu.shape[0], Z.shape[0])) p1.psi1(Z, mu, S, tmp) p2.dpsi1_dmuS((tmp[:, None, :] * dL_dpsi2).sum(1) * 2., Z, mu, S, target_mu, target_S)