mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 20:12:38 +02:00
fixed Browninan motion kern (doesnt seem to have a unittest?)
This commit is contained in:
parent
48b0ac6399
commit
a03b0f1179
1 changed files with 13 additions and 12 deletions
|
|
@ -41,20 +41,21 @@ class Brownian(kernpart):
|
||||||
def Kdiag(self,X,target):
|
def Kdiag(self,X,target):
|
||||||
target += self.variance*X.flatten()
|
target += self.variance*X.flatten()
|
||||||
|
|
||||||
def dK_dtheta(self,X,X2,target):
|
def dK_dtheta(self,dL_dK,X,X2,target):
|
||||||
target += np.fmin(X,X2.T)
|
target += np.sum(np.fmin(X,X2.T)*dL_dK)
|
||||||
|
|
||||||
def dKdiag_dtheta(self,X,target):
|
def dKdiag_dtheta(self,dL_dKdiag,X,target):
|
||||||
target += X.flatten()
|
target += np.dot(X.flatten(), dL_dKdiag)
|
||||||
|
|
||||||
def dK_dX(self,X,X2,target):
|
def dK_dX(self,dL_dK,X,X2,target):
|
||||||
target += self.variance
|
raise NotImplementedError, "TODO"
|
||||||
target -= self.variance*theta(X-X2.T)
|
#target += self.variance
|
||||||
if X.shape==X2.shape:
|
#target -= self.variance*theta(X-X2.T)
|
||||||
if np.all(X==X2):
|
#if X.shape==X2.shape:
|
||||||
np.add(target[:,:,0],self.variance*np.diag(X2.flatten()-X.flatten()),target[:,:,0])
|
#if np.all(X==X2):
|
||||||
|
#np.add(target[:,:,0],self.variance*np.diag(X2.flatten()-X.flatten()),target[:,:,0])
|
||||||
|
|
||||||
|
|
||||||
def dKdiag_dX(self,X,target):
|
def dKdiag_dX(self,dL_dKdiag,X,target):
|
||||||
target += self.variance
|
target += self.variance*dL_dKdiag[:,None]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue