随机梯度下降(SGD)在第k个训练迭代的更新
R
e
q
u
i
r
e
:
学
习
率
ϵ
k
R
e
q
u
i
r
e
:
初
始
参
数
θ
w
h
i
l
e
停
止
准
则
为
满
足
d
o
从
训
练
集
中
采
包
含
m
个
样
本
{
x
(
1
)
,
.
.
.
,
x
(
m
)
}
的
小
批
量
,
其
中
x
(
i
)
对
应
目
标
为
y
(
i
)
。
计
算
梯
度
估
计
:
g
^
←
+
1
m
∇
θ
∑
i
L
(
f
(
x
(
i
)
;
θ
)
,
y
(
i
)
)
应
用
更
新
:
θ
←
θ
−
ϵ
g
^
e
n
d
w
h
i
l
e
\begin{aligned} Requ&ire:学习率\epsilon_k \\Requ&ire:初始参数\theta \\wh&ile 停止准则为满足 do \\&从训练集中采包含m个样本\{x^{(1)},...,x^{(m)}\}的小批量,其中x^{(i)}对应目标为y^{(i)}。 \\&计算梯度估计:\hat{g} \leftarrow + \tfrac{1}{m}\nabla_\theta\textstyle\sum_iL(f(x^{(i)};\theta),y^{(i)}) \\&应用更新:\theta\leftarrow\theta-\epsilon\hat{g} \\en&d \;while \end{aligned}
RequRequwhenire:学习率ϵkire:初始参数θile停止准则为满足do从训练集中采包含m个样本{x(1),...,x(m)}的小批量,其中x(i)对应目标为y(i)。计算梯度估计:g^←+m1∇θ∑iL(f(x(i);θ),y(i))应用更新:θ←θ−ϵg^dwhile
其中L表示损失函数,
∇
\nabla
∇表示梯度计算,
f
(
x
(
i
)
;
θ
)
f(x^{(i)};\theta)
f(x(i);θ)表示在
θ
\theta
θ的情况下,x的值,其实就是预测值
参考:https://zhuanlan.zhihu.com/p/36327151
https://zhuanlan.zhihu.com/p/31708783