文章目录
Week 11: 深度学习补遗:支持向量机
摘要
本周主要继续跟进李宏毅老师的进度,学习支持向量机相关的知识,研究其底层数学原理与数学推导。
Abstract
This week, we will continue to follow up on Mr. Hung-yi Lee’s progress, learning about support vector machines and studying their underlying mathematical principles and mathematical derivations.
1.Support Vector Machine 支持向量机
“Hinge Loss + Kernel Tree = Support Vector Machine”
对于一个基本的二元分类模型,可以描述如下:
D a t a : [ x 1 x 2 x 3 … y ^ 1 y ^ 2 y ^ 3 … ] y ^ n = + 1 , − 1 Data: \\ \begin{bmatrix} x^1&&x^2&&x^3&&\dots \\ \hat{y}^1&&\hat{y}^2&&\hat{y}^3&&\dots \end{bmatrix} \\ \hat{y}^n=+1,-1 Data:[x1y^1x2y^2x3y^3……]y^n=+1,−1
-
- 函数建模
g ( x ) = { f ( x ) > 0 O u t p u t = + 1 f ( x ) < 0 O u t p u t = − 1 g(x)=\left\{ \begin{aligned} f(x)>0\quad Output=+1 \\ f(x)<0\quad Output=-1 \end{aligned} \right. g(x)={ f(x)>0Output=+1f(x)<0Output=−1
-
- 损失函数
L ( f ) = ∑ n δ ( g ( x n ) ≠ y ^ n ) L(f)=\sum_n \delta (g(x^n)\neq \hat{y}^n) L(f)=n∑δ(g(xn)=y^n)
因为损失函数不可微,因此这个模型无法用梯度下降法求解。所以,我们要考虑用一个可微的函数来替代这个理想的损失函数。
Ideal Loss: L ( f ) = ∑ n δ ( g ( x n ) ≠ y ^ n ) Approximation: L ( f ) = ∑ n l ( f ( x n ) , y ^ n ) \begin{aligned} \text{Ideal Loss: }L(f)&=\sum_n\delta (g(x^n)\neq \hat{y}^n) \\ \text{Approximation: }L(f)&=\sum_nl(f(x^n),\hat{y}^n) \end{aligned} Ideal Loss: L(f)Approximation: L(f)=n∑δ(g(xn)=y^n)=n∑l(f(xn),y^n)
比如,平方损失,即如果 y ^ n = 1 \hat{y}^n=1 y^n=1,那么 f ( x ) f(x) f(x)接近1;如果 y ^ n = − 1 \hat{y}^n=-1 y^n=−1, f ( x ) f(x) f(x)接近负一,可以描述为 l ( f ( x n ) , y ^ n ) = ( y ^ n f ( x n ) − 1 ) 2 l(f(x^n),\hat{y}^n)=(\hat{y}^nf(x^n)-1)^2 l(f(xn),y^n)=(y^nf(xn)−1)2。简单来说,就是当 y ^ n = 1 \hat{y}^n=1 y^n=1时, l ( f ( x n ) , y ^ n ) = ( f ( x n ) − 1 ) 2 l(f(x^n),\hat{y}^n)=(f(x^n)-1)^2 l(f(xn),y^n)=(f(xn)−1)2;当 y ^ n = − 1 \hat{y}^n=-1 y^n=−1时, l ( f ( x n ) , y ^ n ) = ( − f ( x n ) − 1 ) 2 l(f(x^n),\hat{y}^n)=(-f(x^n)-1)^2 l(f(xn),y^n)=(−f(xn)−1)2。
Square Loss: l ( f ( x n ) , y ^ n ) = ( y ^ n f ( x n ) − 1 ) 2 = { ( f ( x n ) − 1 ) 2 while y ^ n = 1 ( − f ( x n ) − 1 ) 2 while y ^ n = − 1 \begin{aligned} \text{Square Loss: }l(f(x^n),\hat{y}^n)&=(\hat{y}^nf(x^n)-1)^2 \\ &=\left\{ \begin{aligned} (f(x^n)-1)^2\quad &\text{while }\hat{y}^n=1 \\ (-f(x^n)-1)^2\quad &\text{while }\hat{y}^n=-1 \end{aligned} \right. \end{aligned} Square Loss: l(f(xn),y^n)=(y^
深度学习之支持向量机知识学习

最低0.47元/天 解锁文章
502

被折叠的 条评论
为什么被折叠?



