解决问题
1.变长输入
2.输入之间有一定关系的
输入和输出之间的关系:
1对多:图像的文本描述
多对1:文字的情感分析
多对多:句子的翻译
网络结构
Elman Netword
h
t
=
σ
(
W
h
x
t
+
U
h
h
t
−
1
+
b
h
)
y
t
=
σ
(
W
y
h
t
+
b
y
)
\begin{aligned} h_t &= \sigma(W_hx_t + U_hh_{t-1} +b_h)\\ y_t &= \sigma(W_yh_t + b_y) \end{aligned}
htyt=σ(Whxt+Uhht−1+bh)=σ(Wyht+by)
Jardon Netword
h
t
=
σ
(
W
h
x
t
+
U
h
h
t
−
1
+
b
h
)
y
t
=
σ
(
W
y
h
t
+
b
y
)
\begin{aligned} h_t &= \sigma(W_hx_t + U_hh_{t-1} +b_h)\\ y_t &= \sigma(W_yh_t + b_y) \end{aligned}
htyt=σ(Whxt+Uhht−1+bh)=σ(Wyht+by)
RNN的变形
LSTM
f
t
:
遗
忘
门
,
之
前
的
信
息
需
要
多
少
被
遗
忘
i
t
:
输
入
门
:
x
t
有
多
少
信
息
需
要
记
住
c
‾
t
:
o
t
:
输
出
门
:
c
t
多
少
信
息
需
要
输
出
c
t
:
y
t
:
输
出
\begin{aligned} f_t&:遗忘门,之前的信息需要多少被遗忘\\ i_t&:输入门:x_t有多少信息需要记住\\ \overline{c}_t&:\\ o_t&:输出门:c_t多少信息需要输出\\ c_t&:\\ y_t&:输出 \end{aligned}
ftitctotctyt:遗忘门,之前的信息需要多少被遗忘:输入门:xt有多少信息需要记住::输出门:ct多少信息需要输出::输出
f
t
=
σ
(
W
f
[
x
t
,
h
t
−
1
]
+
b
f
)
i
t
=
σ
(
W
i
[
x
t
,
h
t
−
1
]
+
b
i
)
c
‾
t
=
t
a
n
h
(
W
c
[
x
t
,
h
t
−
1
]
+
b
c
)
c
t
=
f
t
c
t
−
1
+
i
t
c
‾
t
o
t
=
σ
(
W
o
[
x
t
,
h
t
−
1
]
+
b
o
)
h
t
=
o
t
t
a
n
h
(
c
t
)
\begin{aligned} f_t &= \sigma(W_f[x_{t},h_{t-1}] +b_f)\\ i_t &= \sigma(W_i[x_{t},h_{t-1}] +b_i)\\ \overline{c}_t &= tanh(W_c[x_{t},h_{t-1}] +b_c)\\ c_t &= f_tc_{t-1} + i_t\overline{c}_t\\ o_t &= \sigma(W_o[x_{t},h_{t-1}] +b_o)\\ h_t &=o_ttanh(c_t) \end{aligned}
ftitctctotht=σ(Wf[xt,ht−1]+bf)=σ(Wi[xt,ht−1]+bi)=tanh(Wc[xt,ht−1]+bc)=ftct−1+itct=σ(Wo[xt,ht−1]+bo)=ottanh(ct)