Esempio n. 1
0
 def __init__(self, gamma):
     Kernel.__init__(self)
     
     if type(gamma) is not float:
         raise TypeError("Gamma must be float")
     
     self.gamma = gamma
Esempio n. 2
0
    def __init__(self, width, nu=1.5, sigma=1.0):
        Kernel.__init__(self)
        #GenericTests.check_type(width,'width',float)
        GenericTests.check_type(nu, 'nu', float)
        GenericTests.check_type(sigma, 'sigma', float)

        self.width = width
        self.nu = nu
        self.sigma = sigma
Esempio n. 3
0
 def __init__(self, width=1.0, nu=1.5, sigma=1.0):
     Kernel.__init__(self)
     GenericTests.check_type(width,'width',float)
     GenericTests.check_type(nu,'nu',float)
     GenericTests.check_type(sigma,'sigma',float)
     
     self.width = width
     self.nu = nu
     self.sigma = sigma
Esempio n. 4
0
 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
Esempio n. 5
0
 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
Esempio n. 6
0
 def __str__(self):
     s = self.__class__.__name__ + "=["
     s += "p=" + str(self.p)
     s += "alpha=" + str(self.alpha)
     s += ", " + Kernel.__str__(self)
     s += "]"
     return s
 def __init__(self, sigma=1.0, is_sparse=False):
     Kernel.__init__(self)
     self.width = sigma
     self.is_sparse = is_sparse
Esempio n. 8
0
 def __init__(self, is_sparse=False):
     Kernel.__init__(self)
     self.is_sparse = is_sparse
Esempio n. 9
0
 def __init__(self, degree, theta=1.0):
     Kernel.__init__(self)
     self.degree = degree
     self.theta = theta
Esempio n. 10
0
 def __init__(self, p=1, alpha=0.5, sigma=1.0):
     Kernel.__init__(self)
     self.p = p
     self.alpha = alpha
     self.sigma = sigma
Esempio n. 11
0
 def __str__(self):
     s=self.__class__.__name__+ "=["
     s += "" + Kernel.__str__(self)
     s += "]"
     return s
Esempio n. 12
0
 def HSIC_V_statistic(Kx, Ky):
     Kxc = Kernel.center_kernel_matrix(Kx)
     Kyc = Kernel.center_kernel_matrix(Ky)
     return np.sum(Kxc * Kyc)
Esempio n. 13
0
 def __init__(self, data_kernel):
     Kernel.__init__(self)
     self.data_kernel = data_kernel
Esempio n. 14
0
 def __init__(self, is_sparse = False):
     Kernel.__init__(self)
     self.is_sparse = is_sparse
Esempio n. 15
0
 def __init__(self, list_of_kernels):
     Kernel.__init__(self)
     self.list_of_kernels = list_of_kernels
Esempio n. 16
0
 def HSIC_V_statistic(Kx,Ky):
     Kxc=Kernel.center_kernel_matrix(Kx)
     Kyc=Kernel.center_kernel_matrix(Ky)
     return np.sum(Kxc*Kyc)
Esempio n. 17
0
 def __init__(self, sigma):
     Kernel.__init__(self)
     GenericTests.check_type(sigma, 'sigma', float)
     self.width = sigma
Esempio n. 18
0
 def __init__(self):
     Kernel.__init__(self)
Esempio n. 19
0
 def __str__(self):
     s=self.__class__.__name__+ "=["
     s += "degree="+ str(self.degree)
     s += ", " + Kernel.__str__(self)
     s += "]"
     return s
Esempio n. 20
0
 def __str__(self):
     s = self.__class__.__name__ + "=["
     s += "gamma=" + str(self.gamma)
     s += ", " + Kernel.__str__(self)
     s += "]"
     return s
Esempio n. 21
0
 def __init__(self, degree,theta=1.0):
     Kernel.__init__(self)
     self.degree = degree
     self.theta = theta
Esempio n. 22
0
 def __str__(self):
     s = self.__class__.__name__ + "=["
     s += ", " + Kernel.__str__(self)
     s += "]"
     return s
Esempio n. 23
0
 def __init__(self, list_of_kernels):
     Kernel.__init__(self)
     self.list_of_kernels = list_of_kernels