def get_spectrum_on_data(self, Mx, My): '''Mx and My are Kx Ky when rff =False Mx and My are phix, phiy when rff =True''' if self.rff | self.induce_set: Cx = np.cov(Mx.T) Cy = np.cov(My.T) lambdax = np.linalg.eigvalsh(Cx) lambday = np.linalg.eigvalsh(Cy) else: Kxc = Kernel.center_kernel_matrix(Mx) Kyc = Kernel.center_kernel_matrix(My) lambdax = np.linalg.eigvalsh(Kxc) lambday = np.linalg.eigvalsh(Kyc) return lambdax, lambday
def get_spectrum_on_data(self, Mx, My): '''Mx and My are Kx Ky when rff =False Mx and My are phix, phiy when rff =True''' if self.rff|self.induce_set: Cx = np.cov(Mx.T) Cy = np.cov(My.T) lambdax=np.linalg.eigvalsh(Cx) lambday=np.linalg.eigvalsh(Cy) else: Kxc = Kernel.center_kernel_matrix(Mx) Kyc = Kernel.center_kernel_matrix(My) lambdax=np.linalg.eigvalsh(Kxc) lambday=np.linalg.eigvalsh(Kyc) return lambdax,lambday
def HSIC_V_statistic(Kx, Ky): Kxc = Kernel.center_kernel_matrix(Kx) Kyc = Kernel.center_kernel_matrix(Ky) return np.sum(Kxc * Kyc)
def HSIC_V_statistic(Kx,Ky): Kxc=Kernel.center_kernel_matrix(Kx) Kyc=Kernel.center_kernel_matrix(Ky) return np.sum(Kxc*Kyc)