為什麼高斯核函式對映到無窮維度?
阿新 • • 發佈:2019-02-08
Consider the polynomial kernel of degree 2 defined by, where and .
Thereby, the kernel function can be written as,
.
Now, let us try to come up with a feature map such that the kernel function can be written as .
Consider the following feature map, . Basically, this feature map is mapping the points in to
points in .
Also, notice that, which
is essentially our kernel function.
This means that our kernel function is actually computing the inner/dot product of points in . That is, it is implicitly mapping our points from to .
NOTE:我們要做的是將線性不可分的sample對映到高維空間(在這個空間中線性可分),然後在這個高維空間中衡量兩個sample之間的相似性,即做點積。在上述的多項式核函式例子中,闡述了通過核函式同樣可以達到我們的目的,而且省略了顯示對映的環節。
Now, coming to RBF.
Let us consider the RBF kernel again for points in . Then, the kernel can be written as
(assuming gamma = 1). Using the taylor series you can write this as,
to
an infinite vector. Thus, RBF implicitly maps every point to an infinite dimensional space.
Thereby, the kernel function can be written as,
.
Now, let us try to come up with a feature map such that the kernel function can be written as .
Consider the following feature map, . Basically, this feature map is mapping the points in
This means that our kernel function is actually computing the inner/dot product of points in . That is, it is implicitly mapping our points from to .
NOTE:我們要做的是將線性不可分的sample對映到高維空間(在這個空間中線性可分),然後在這個高維空間中衡量兩個sample之間的相似性,即做點積。在上述的多項式核函式例子中,闡述了通過核函式同樣可以達到我們的目的,而且省略了顯示對映的環節。
Now, coming to RBF.
Let us consider the RBF kernel again for points in . Then, the kernel can be written as
(assuming gamma = 1). Using the taylor series you can write this as,
Now, if we were to come up with a feature map just like we did for the polynomial kernel, you would realize that the feature map would map every point in our
NOTE:上面是RBF核函式(也可以理解為高斯核函式),在上面的轉換過程中核函式最終通過傅立葉展開為無窮項,而每項都是一個多項式核函式,從這裡可以看出高斯核函式對映之後為什麼是無窮維的。
另外需要注意一點就是,無窮維的向量並不意味著對兩個無窮維的向量相似性的度量。點積是衡量兩個無窮維向量相似值最終收斂到的值!