Week 11: 深度学习补遗:支持向量机

深度学习之支持向量机知识学习

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

    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

    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)=nl(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^

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值