Download Elefant, User's Manual
Transcript
The data x1 x1, x2 and x2 are two dimensional numpy.array. 5.5.2 Details of the kernels The class CVectorKernel is the abstract class for all kernels that operate on vectorial data. It has three main branches of descendants: This kernel CLinearKernel computes conventional inner product (vanilla dot) on two data points, ie. K(x1i , x2j ) = hx1i , x2j i. This kernel is singled out as a separate class because the manipulation of the resulting kernel matrix can be computed efficiently by blocking and clever bracketing. This is an CDotProductKernel abstract class. All kernels that are functions of the inner product, ie. K(x1i , x2j ) = Kappa(hx1i , x2j i) derive from this class. Currently there are three specific kernels derived from this class. They are different in their constructors and the Kappa function. CPolynomialKernel Given a Kappa(x) numpy.array, x with entries (x)ij = hx1i , x2j i, it computes the polynomial kernel of the form: Kappa(x) = (scale · x + offset)degree . (5.1) The three __init__(degree=2, offset=1.0, scale=1.0, blocksize=128) parameters, degree, offset and scale, are all scalars. The default constructor creates polynomial kernel of degree of 2. CTahnKernel Given a Kappa(x) numpy.array, x with entries (x)ij = hx1i , x2j i, it computes the Tahn kernel of the form: Kappa(x) = tanh(scale · x + offset). __init__(offset=1.0, scale=1.0, blocksize=128) (5.2) The two parameters, offset and scale, are both scalars. CExpKernel Given a Kappa(x) numpy.array, x with entries (x)ij = hx1i , x2j i, it computes the Exponential kernel of the form: Kappa(x) = exp(scale · x + offset). __init__(offset=1.0, scale=1.0, blocksize=128) (5.3) The two parameters, offset and scale, are both scalars. 56 Chapter 5. Kernels