From a5208f474ec0880eac02392c4d186fdd6b35d2d9 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Thu, 6 Jun 2013 10:59:34 +0100 Subject: [PATCH 1/3] modified lengthscale gradients - demo works now. --- GPy/kern/rbf.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/GPy/kern/rbf.py b/GPy/kern/rbf.py index 2d316234..d1e0797c 100644 --- a/GPy/kern/rbf.py +++ b/GPy/kern/rbf.py @@ -96,13 +96,13 @@ class rbf(Kernpart): var_len3 = self.variance / np.power(self.lengthscale, 3) if X2 is None: # save computation for the symmetrical case - dvardLdK += dvardLdK.T + dvardLdK = dvardLdK + dvardLdK.T code = """ int q,i,j; double tmp; for(q=0; q Date: Thu, 6 Jun 2013 11:24:00 +0100 Subject: [PATCH 2/3] removed visualize dependencies and added dKdiag_dX for linear --- GPy/kern/linear.py | 3 +++ GPy/util/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/GPy/kern/linear.py b/GPy/kern/linear.py index b2aa29f9..402e6ead 100644 --- a/GPy/kern/linear.py +++ b/GPy/kern/linear.py @@ -100,6 +100,9 @@ class linear(Kernpart): def dK_dX(self, dL_dK, X, X2, target): target += (((X2[:, None, :] * self.variances)) * dL_dK[:, :, None]).sum(0) + def dKdiag_dX(self,dL_dKdiag,X,target): + target += 2.*self.variances*dL_dKdiag[:,None]*X + #---------------------------------------# # PSI statistics # #---------------------------------------# diff --git a/GPy/util/__init__.py b/GPy/util/__init__.py index 27d25518..cbb5e250 100644 --- a/GPy/util/__init__.py +++ b/GPy/util/__init__.py @@ -11,6 +11,6 @@ import misc import warping_functions import datasets import mocap -import visualize +#import visualize import decorators import classification From feb7b04c51f0a602834619c0b16eface8ff730b3 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Thu, 6 Jun 2013 14:02:42 +0100 Subject: [PATCH 3/3] removing unused link_functions --- GPy/likelihoods/link_functions.py | 40 ++++++------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/GPy/likelihoods/link_functions.py b/GPy/likelihoods/link_functions.py index cd5ae0c5..3b9a55b2 100644 --- a/GPy/likelihoods/link_functions.py +++ b/GPy/likelihoods/link_functions.py @@ -19,41 +19,15 @@ class LinkFunction(object): def __init__(self): pass -class Identity(LinkFunction): - def transf(self,mu): - return mu - - def inv_transf(self,f): - return f - - def log_inv_transf(self,f): - return np.log(f) - -class Log(LinkFunction): - - def transf(self,mu): - return np.log(mu) - - def inv_transf(self,f): - return np.exp(f) - - def log_inv_transf(self,f): - return f - -class Log_ex_1(LinkFunction): - def transf(self,mu): - return np.log(np.exp(mu) - 1) - - def inv_transf(self,f): - return np.log(np.exp(f)+1) - - def log_inv_tranf(self,f): - return np.log(np.log(np.exp(f)+1)) - class Probit(LinkFunction): + """ + Probit link function: Squashes a likelihood between 0 and 1 + """ + def transf(self,mu): + pass def inv_transf(self,f): - return std_norm_cdf(f) + pass def log_inv_transf(self,f): - return np.log(std_norm_cdf(f)) + pass