2-7 感知机对偶形式 梯度下降法的推导过程
Posted windmissing
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2-7 感知机对偶形式 梯度下降法的推导过程相关的知识,希望对你有一定的参考价值。
在感知机的原始形式中,模型为:
f
(
x
)
=
s
i
g
n
(
w
⋅
x
+
b
)
s
i
g
n
(
x
)
=
+
1
,
x
≥
0
−
1
,
x
<
0
(1)
f(x) = sign(w \\cdot x + b) \\\\ sign(x) = \\begincases +1, && x \\ge 0 \\\\ -1, && x \\lt 0 \\endcases \\tag 1
f(x)=sign(w⋅x+b)sign(x)=+1,−1,x≥0x<0(1)
对应的梯度下降法的偏导公式为:
w
n
e
w
=
w
o
l
d
+
η
y
i
x
i
b
n
e
w
=
b
o
l
d
+
η
y
i
(2)
\\begincases w_new = w_old + \\eta y_ix_i \\\\ b_new = b_old + \\eta y_i \\endcases \\tag 2
wnew=wold+ηyixibnew=bold+ηyi(2)
在感知机的对偶形式中,模型演变为:
f
(
x
)
=
s
i
g
n
(
∑
j
=
1
m
a
j
y
j
x
j
⋅
x
+
b
)
s
i
g
n
(
x
)
=
+
1
,
x
≥
0
−
1
,
x
<
0
f(x) = sign(\\sum_j=1^m a_jy_jx_j \\cdot x + b) \\\\ sign(x) = \\begincases +1, && x \\ge 0 \\\\ -1, && x \\lt 0 \\endcases
f(x)=sign(j=1∑majyjxj⋅x+b)sign(x)=+1,−1,x≥0x<0
感知机的对偶模型,实际是把原始模型中的w,b展开为:
w
=
∑
j
=
1
m
a
j
y
j
x
j
b
=
∑
j
=
1
m
a
j
y
j
(3)
\\begincases w = \\sum_j=1^m a_jy_jx_j \\\\ b = \\sum_j=1^m a_jy_j \\endcases \\tag 3
w=∑j=1majyjxjb=∑j=1majyj(3)
对应的梯度下降法的偏导公式中的w则演变为:
(
∑
j
=
1
m
a
j
y
j
x
j
)
n
e
w
=
(
∑
j
=
1
m
a
j
y
j
x
j
)
o
l
d
+
η
y
i
x
i
(4)
(\\sum_j=1^m a_jy_jx_j)_new = (\\sum_j=1^m a_jy_jx_j)_old + \\eta y_ix_i \\tag 4
(j=1∑majyjxj)new=(j=1∑majyjxj)old+ηyixi(4)
对以上公式进一步简化:
- 由于使用的是随机梯度下降法,假设误分类集合M中只有一个点 ( x j , y j ) (x_j, y_j) (xj,yj)
- 公式(4)左右两边都去掉
y
j
x
j
y_jx_j
yjxj,得到
( a j ) n e w = ( a j ) o l d + η (5) (a_j)_new = (a_j)_old + \\eta \\tag 5 (aj)new=(aj)old+η(5)
公式(3)中的b更新方式不变,与公式(5)结合,得:
(
a
j
)
n
e
w
=
(
a
j
)
o
l
d
+
η
b
n
e
w
=
b
o
l
d
+
a
j
y
j
(6)
\\begincases (a_j)_new = (a_j)_old + \\eta \\\\ b_new = b_old + a_jy_j \\endcases \\tag 6
(aj)new=(aj)old+ηb2-3 感知机梯度下降法的推导过程