Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rnn gluon with multilayer plot #152

Merged
merged 1 commit into from
Jan 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rnn gluon with multilayer plot
  • Loading branch information
astonzhang committed Jan 12, 2018
commit a0d9513b8246cbb43f218201ca74fd97b316888e
12 changes: 12 additions & 0 deletions chapter_recurrent-neural-networks/rnn-gluon.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ class RNNModel(gluon.Block):

对于一个多层循环神经网络,当前时刻隐含层的输入来自同一时刻输入层(如果有)或上一隐含层的输出。每一层的隐含状态只沿着同一层传递。

把[单层循环神经网络](rnn-scratch.md)中隐含层的每个单元当做一个函数$f$,这个函数在$t$时刻的输入是$\mathbf{X}_t, \mathbf{H}_{t-1}$,输出是$\mathbf{H}_t$:

$$f(\mathbf{X}_t, \mathbf{H}_{t-1}) = \mathbf{H}_t$$

假设输入为第0层,输出为第$L+1$层,在一共$L$个隐含层的循环神经网络中,上式中可以拓展成以下的函数:

$$f(\mathbf{H}_t^{(l-1)}, \mathbf{H}_{t-1}^{(l)}) = \mathbf{H}_t$$

如下图所示。

![](../img/multi-layer-rnn.svg)

```{.python .input}
model_name = 'rnn_relu'

Expand Down
2 changes: 2 additions & 0 deletions img/multi-layer-rnn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.