Kernel

A kernel $K(u,\,v)$ is valid if we can find a function $\phi(u)$ such that $K(u,\,v) = \phi^T(u)\phi(v)$.

A kernel function defines a notion of similarity.

To prove $K$ is valid, show that there exists a function $K(u,\,v) = \phi^T(u)\phi(v)$ for all $u,\,v$.

Quadratic Kernel: $K(x,\,z) = (x^Tz + c) ^2$

$=(\sum^n_{i=1} x_i z_i + c) + (\sum^n_{j=1} x_j z_j + c)$

$=\sum_{i=1}^n x_i^2 z_i^2 + \sum_{i\neq j}x_iz_ix_jz_j + 2c\sum x_i z_i + c^2$

$\phi(x) = [x_1^2\quad x_2^2\quad …\quad x_1x_2\quad x_1 x_3 \quad … \quad x_2 x_ 1 \quad ... \quad x_n x_{n-1}\quad ... \quad \sqrt{2}c x_1 \quad … \quad c]^T$

Mercer’s Theorem:

A kernel is valid iff the kernel matrix $K$ is positive semi definite.

$||x_m-x_n||^2_2$ is not positive semidefinite since the determinant of its matrix is not positive.

If $k(x,\,z)$ is a valid kernel, then $e^{k(x,\,z)}$ is also a valid kernel.

$e^{k(x,\,z)} = 1 + \sum^\infty_{n=1} \dfrac{k(x,\,z)}{n!}$