未验证 提交 bf1b4bb6 编写于 作者: X Xing Wu 提交者: GitHub

fix doc errors, test=develop (#2023)

上级 f9504d11
......@@ -35,7 +35,7 @@ GRUCell
.. code-block:: python
import paddle.fluid.layers as layers
cell = layers.rnn.GRUCell(hidden_size=256)
cell = layers.GRUCell(hidden_size=256)
.. py:method:: call(inputs, states)
......
......@@ -10,7 +10,7 @@ lstm
.. note::
该OP仅支持 GPU 设备运行
该OP实现了 LSTM,即 Long-Short Term Memory(长短期记忆)运算 - `Hochreiter, S., & Schmidhuber, J. (1997) <http://deeplearning.cs.cmu.edu/pdfs/Hochreiter97_lstm.pdf>`_。
该OP实现了 LSTM,即 Long-Short Term Memory(长短期记忆)运算 - `Hochreiter, S., & Schmidhuber, J. (1997) <https://www.bioinf.jku.at/publications/older/2604.pdf>`_。
该OP的实现不包括 diagonal/peephole 连接,参见 `Gers, F. A., & Schmidhuber, J. (2000) <ftp://ftp.idsia.ch/pub/juergen/TimeCount-IJCNN2000.pdf>`_。
如果需要使用 peephole 连接方法,请使用 :ref:`cn_api_fluid_layers_dynamic_lstm` 。
......
......@@ -52,22 +52,14 @@ Long-Short Term Memory(LSTM)循环神经网络计算单元。该OP用于完
import paddle.fluid as fluid
dict_dim, emb_dim, hidden_dim = 128, 64, 512
data = fluid.layers.data(name='step_data', shape=[1], dtype='int32')
x = fluid.layers.embedding(input=data, size=[dict_dim, emb_dim])
pre_hidden = fluid.layers.data(name='pre_hidden', shape=[hidden_dim], dtype='float32')
pre_cell = fluid.layers.data(name='pre_cell', shape=[hidden_dim], dtype='float32')
data = fluid.data(name='step_data', shape=[None], dtype='int64')
x = fluid.embedding(input=data, size=[dict_dim, emb_dim])
pre_hidden = fluid.data(
name='pre_hidden', shape=[None, hidden_dim], dtype='float32')
pre_cell = fluid.data(
name='pre_cell', shape=[None, hidden_dim], dtype='float32')
hidden = fluid.layers.lstm_unit(
x_t=x,
hidden_t_prev=pre_hidden,
cell_t_prev=pre_cell)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册