From f95666a8f9cb07209d80226ed1c5b0352b9eed75 Mon Sep 17 00:00:00 2001 From: Alan Saul Date: Mon, 6 May 2013 10:15:39 +0100 Subject: [PATCH] Merging --- GPy/likelihoods/Laplace.py | 1 + GPy/models/GP.py | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/GPy/likelihoods/Laplace.py b/GPy/likelihoods/Laplace.py index 9cacb0e1..5e28212e 100644 --- a/GPy/likelihoods/Laplace.py +++ b/GPy/likelihoods/Laplace.py @@ -98,6 +98,7 @@ class Laplace(likelihood): A = I + C #plt.imshow(A) #plt.show() + ki, _, _, _ = pdinv(self.K) I_KW_i, _, _, _ = pdinv(A) #FIXME: Careful dK_dthetaK is not the derivative with respect to the marginal just prior K! diff --git a/GPy/models/GP.py b/GPy/models/GP.py index d353e5dd..96ec6582 100644 --- a/GPy/models/GP.py +++ b/GPy/models/GP.py @@ -6,15 +6,9 @@ import numpy as np import pylab as pb from .. import kern from ..core import model -<<<<<<< HEAD -from ..util.linalg import pdinv,mdot -from ..util.plot import gpplot,x_frame1D,x_frame2D, Tango -from ..likelihoods import EP, Laplace -======= from ..util.linalg import pdinv, mdot from ..util.plot import gpplot, x_frame1D, x_frame2D, Tango -from ..likelihoods import EP ->>>>>>> upstream/devel +from ..likelihoods import EP, Laplace class GP(model): """ @@ -34,6 +28,7 @@ class GP(model): """ def __init__(self, X, likelihood, kernel, normalize_X=False): + self.has_uncertain_inputs=False # parse arguments self.X = X @@ -128,12 +123,12 @@ class GP(model): Note, we use the chain rule: dL_dtheta = dL_dK * d_K_dtheta """ - dL_dthetaK = self.kern.dK_dtheta(dL_dK=self.dL_dK, X=self.X, slices1=self.Xslices, slices2=self.Xslices) + dL_dthetaK = self.kern.dK_dtheta(dL_dK=self.dL_dK, X=self.X) if isinstance(self.likelihood, Laplace): dL_dthetaK_explicit = dL_dthetaK #Need to pass in a matrix of ones to get access to raw dK_dthetaK values without being chained fake_dL_dKs = np.ones(self.dL_dK.shape) - dK_dthetaK = self.kern.dK_dtheta(dL_dK=fake_dL_dKs, X=self.X, slices1=self.Xslices, slices2=self.Xslices) + dK_dthetaK = self.kern.dK_dtheta(dL_dK=fake_dL_dKs, X=self.X) dL_dthetaK_implicit = self.likelihood._Kgradients(self.dL_dK, dK_dthetaK) dL_dthetaK = dL_dthetaK_explicit + dL_dthetaK_implicit @@ -251,7 +246,7 @@ class GP(model): else: raise NotImplementedError, "Cannot define a frame with more than two input dimensions" - def plot(self, samples=0, plot_limits=None, which_data='all', which_functions='all', resolution=None, levels=20): + def plot(self, samples=0, plot_limits=None, which_data='all', which_functions='all', which_parts='all', resolution=None, levels=20): """ TODO: Docstrings! :param levels: for 2D plotting, the number of contour levels to use