def K(self,X,X2,target):
Compute the covariance matrix between X and X2.
self._K_computations(X,X2)
target += self._K1*self._K2
def _K_computations(self,X,X2):
Compute the two kernel matrices.
After Change
return parameter names.
return [self.k1.name + "_" + param_name for param_name in self.k1._get_param_names()] + [self.k2.name + "_" + param_name for param_name in self.k2._get_param_names()]
def K(self,X,X2,target):
Compute the covariance matrix between X and X2.
if X2 is None: X2 = X
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
def dK_dtheta(self,dL_dK,X,X2,target):