From 070137504aff443342cc8ce10f66cec89d3c3966 Mon Sep 17 00:00:00 2001 From: Alan Saul Date: Mon, 17 Aug 2015 16:06:43 +0100 Subject: [PATCH 1/3] Added full cov prediction --- GPy/models/gp_var_gauss.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GPy/models/gp_var_gauss.py b/GPy/models/gp_var_gauss.py index 729b6bb8..c7926c52 100644 --- a/GPy/models/gp_var_gauss.py +++ b/GPy/models/gp_var_gauss.py @@ -78,7 +78,7 @@ class GPVariationalGaussianApproximation(Model): dF_dK = self.alpha*dF_dm.T + np.dot(tmp*dF_dv, tmp.T) self.kern.update_gradients_full(dF_dK - dKL_dK, self.X) - def _raw_predict(self, Xnew): + def _raw_predict(self, Xnew, full_cov=False): """ Predict the function(s) at the new point(s) Xnew. @@ -89,7 +89,12 @@ class GPVariationalGaussianApproximation(Model): Kux = self.kern.K(self.X, Xnew) mu = np.dot(Kux.T, self.alpha) WiKux = np.dot(Wi, Kux) - Kxx = self.kern.Kdiag(Xnew) - var = Kxx - np.sum(WiKux*Kux, 0) + if full_cov: + Kxx = self.kern.K(Xnew) + var = Kxx - np.dot(Kux.T, WiKux) + else: + Kxx = self.kern.Kdiag(Xnew) + var = Kxx - np.sum(WiKux*Kux, 0) + var = var.reshape(-1,1) - return mu, var.reshape(-1,1) + return mu, var From 88855d3c940a0fd0c23dca060686952f7ffbbd00 Mon Sep 17 00:00:00 2001 From: Alan Saul Date: Tue, 8 Sep 2015 18:07:57 +0100 Subject: [PATCH 2/3] Removed annoying print --- GPy/inference/latent_function_inference/laplace.py | 1 - 1 file changed, 1 deletion(-) diff --git a/GPy/inference/latent_function_inference/laplace.py b/GPy/inference/latent_function_inference/laplace.py index 2f089141..69eda64a 100644 --- a/GPy/inference/latent_function_inference/laplace.py +++ b/GPy/inference/latent_function_inference/laplace.py @@ -171,7 +171,6 @@ class Laplace(LatentFunctionInference): #define the objective function (to be maximised) def obj(Ki_f, f): ll = -0.5*np.sum(np.dot(Ki_f.T, f)) + np.sum(likelihood.logpdf(f, Y, Y_metadata=Y_metadata)) - print(ll) if np.isnan(ll): import ipdb; ipdb.set_trace() # XXX BREAKPOINT return -np.inf From 25b655a6e4a8e97e5c32cf323fe0511989c6fbf1 Mon Sep 17 00:00:00 2001 From: Zhenwen Dai Date: Tue, 8 Sep 2015 21:38:48 +0100 Subject: [PATCH 3/3] bug fix for compilation on Mac --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ef51cd3e..93217fb4 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def ismac(): if ismac(): compile_flags = [ '-O3', ] - link_args = [''] + link_args = [] else: compile_flags = [ '-fopenmp', '-O3', ] link_args = ['-lgomp']