Kernel Functions

A kernel function takes input vectors from the original (\(p\)-dimensional) space and returns the dot product of the vectors in the \(s\)-dimensional feature space. Thus, having \(x,y \in \mathbb{R}^p\) and \(\phi \in \mathbb{R}^p \leftarrow \mathbb{R}^s\), the kernel function is

\[K(x, y) \equiv <\phi (x), \phi (y)>\]

Where \(\phi(x)\) is a vector-valued function: \(\phi(x) = \phi_1(x), \phi_2(x), \ldots, \phi_s(x)\).

If \(\phi (x) = x\), the kernel is linear. Kernels are used in the SVM model, but for some tasks they could be used separately to transform vectors from one space to another.

The following table describes current device support:

Kernel type

CPU

GPU

Linear

Yes

Yes

Polynomial

Yes

No

RBF

Yes

Yes

Sigmoid

Yes

No

Examples: Linear Kernel

Examples: Polynomial Kernel

Examples: RBF Kernel

Batch Processing:

Examples: Sigmoid Kernel