mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
coregionalisation seems to be a go-go
This commit is contained in:
parent
af510d166a
commit
f881e65761
3 changed files with 20 additions and 12 deletions
|
|
@ -64,13 +64,13 @@ class coregionalise(kernpart):
|
|||
|
||||
partial_small = np.zeros_like(self.B)
|
||||
for i in range(self.Nout):
|
||||
for j in range(i,self.Nout):
|
||||
for j in range(self.Nout):
|
||||
tmp = np.sum(partial[(ii==i)*(jj==j)])
|
||||
partial_small[i,j] = tmp
|
||||
partial_small[j,i] = tmp
|
||||
|
||||
dkappa = np.diag(partial_small)
|
||||
dW = 2.*(self.W[:,None,:]*partial_small[:,:,None]).sum(0)
|
||||
partial_small += partial_small.T
|
||||
dW = (self.W[:,None,:]*partial_small[:,:,None]).sum(0)
|
||||
|
||||
target += np.hstack([dW.flatten(),dkappa])
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ class product_orthogonal(kernpart):
|
|||
def K(self,X,X2,target):
|
||||
"""Compute the covariance matrix between X and X2."""
|
||||
if X2 is None: X2 = X
|
||||
target1 = np.zeros((X.shape[0],X2.shape[0]))
|
||||
target2 = np.zeros((X.shape[0],X2.shape[0]))
|
||||
target1 = np.zeros_like(target)
|
||||
target2 = np.zeros_like(target)
|
||||
self.k1.K(X[:,:self.k1.D],X2[:,:self.k1.D],target1)
|
||||
self.k2.K(X[:,self.k1.D:],X2[:,self.k1.D:],target2)
|
||||
target += target1 * target2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue