mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
Some bugfixes that have affected GPLVM/sparseGPLVM since the hetero noise change
This commit is contained in:
parent
a166187231
commit
3f924bea8f
2 changed files with 6 additions and 5 deletions
|
|
@ -53,10 +53,10 @@ class GPLVM(GP):
|
|||
return np.hstack((dL_dX.flatten(),GP._log_likelihood_gradients(self)))
|
||||
|
||||
def plot(self):
|
||||
assert self.Y.shape[1]==2
|
||||
pb.scatter(self.Y[:,0],self.Y[:,1],40,self.X[:,0].copy(),linewidth=0,cmap=pb.cm.jet)
|
||||
assert self.likelihood.Y.shape[1]==2
|
||||
pb.scatter(self.likelihood.Y[:,0],self.likelihood.Y[:,1],40,self.X[:,0].copy(),linewidth=0,cmap=pb.cm.jet)
|
||||
Xnew = np.linspace(self.X.min(),self.X.max(),200)[:,None]
|
||||
mu, var = self.predict(Xnew)
|
||||
mu, var, upper, lower = self.predict(Xnew)
|
||||
pb.plot(mu[:,0], mu[:,1],'k',linewidth=1.5)
|
||||
|
||||
def plot_latent(self):
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ class sparse_GPLVM(sparse_GP_regression, GPLVM):
|
|||
return sparse_GP_regression.log_likelihood(self)
|
||||
|
||||
def dL_dX(self):
|
||||
dL_dpsi1 = self.dL_dpsi1 + 2.*np.dot(self.dL_dpsi2,self.psi1)
|
||||
#dL_dpsi1 = self.dL_dpsi1 + 2.*np.dot(self.dL_dpsi2,self.psi1)
|
||||
dL_dpsi1 = self.dL_dpsi1 + 2.*np.dot(self.dL_dpsi2[0,:,:],self.psi1)
|
||||
|
||||
dL_dX = self.kern.dKdiag_dX(self.dL_dpsi0,self.X)
|
||||
dL_dX += self.kern.dK_dX(dL_dpsi1.T,self.X,self.Z)
|
||||
|
|
@ -55,5 +56,5 @@ class sparse_GPLVM(sparse_GP_regression, GPLVM):
|
|||
def plot(self):
|
||||
GPLVM.plot(self)
|
||||
#passing Z without a small amout of jitter will induce the white kernel where we don;t want it!
|
||||
mu, var = sparse_GP_regression.predict(self, self.Z+np.random.randn(*self.Z.shape)*0.0001)
|
||||
mu, var, upper, lower = sparse_GP_regression.predict(self, self.Z+np.random.randn(*self.Z.shape)*0.0001)
|
||||
pb.plot(mu[:, 0] , mu[:, 1], 'ko')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue