Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo n.º 8
0
 def __init__(self, is_sparse=False):
     Kernel.__init__(self)
     self.is_sparse = is_sparse
Exemplo n.º 9
0
 def __init__(self, degree, theta=1.0):
     Kernel.__init__(self)
     self.degree = degree
     self.theta = theta
Exemplo 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
Exemplo n.º 11
0
 def __str__(self):
     s=self.__class__.__name__+ "=["
     s += "" + Kernel.__str__(self)
     s += "]"
     return s
Exemplo 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)
Exemplo n.º 13
0
 def __init__(self, data_kernel):
     Kernel.__init__(self)
     self.data_kernel = data_kernel
Exemplo n.º 14
0
 def __init__(self, is_sparse = False):
     Kernel.__init__(self)
     self.is_sparse = is_sparse
Exemplo n.º 15
0
 def __init__(self, list_of_kernels):
     Kernel.__init__(self)
     self.list_of_kernels = list_of_kernels
Exemplo 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)
Exemplo n.º 17
0
 def __init__(self, sigma):
     Kernel.__init__(self)
     GenericTests.check_type(sigma, 'sigma', float)
     self.width = sigma
Exemplo n.º 18
0
 def __init__(self):
     Kernel.__init__(self)
Exemplo n.º 19
0
 def __str__(self):
     s=self.__class__.__name__+ "=["
     s += "degree="+ str(self.degree)
     s += ", " + Kernel.__str__(self)
     s += "]"
     return s
Exemplo n.º 20
0
 def __str__(self):
     s = self.__class__.__name__ + "=["
     s += "gamma=" + str(self.gamma)
     s += ", " + Kernel.__str__(self)
     s += "]"
     return s
Exemplo n.º 21
0
 def __init__(self, degree,theta=1.0):
     Kernel.__init__(self)
     self.degree = degree
     self.theta = theta
Exemplo n.º 22
0
 def __str__(self):
     s = self.__class__.__name__ + "=["
     s += ", " + Kernel.__str__(self)
     s += "]"
     return s
Exemplo n.º 23
0
 def __init__(self, list_of_kernels):
     Kernel.__init__(self)
     self.list_of_kernels = list_of_kernels