Skip to content

Commit 7edb332

Browse files
committed
[Docs] Fix inline backticks in RNN CN docs
1 parent fd0ee87 commit 7edb332

6 files changed

Lines changed: 22 additions & 22 deletions

File tree

docs/api/paddle/nn/GRU_cn.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ GRU
3636
- **hidden_size** (int) - 隐藏状态 :math:`h` 大小。
3737
- **num_layers** (int,可选) - 循环网络的层数。例如,将层数设为 2,会将两层 GRU 网络堆叠在一起,第二层的输入来自第一层的输出。默认为 1。
3838
- **direction** (str,可选) - 网络迭代方向,可设置为 forward 或 bidirect(或 bidirectional)。forward 指从序列开始到序列结束的单向 GRU 网络方向,bidirectional 指从序列开始到序列结束,又从序列结束到开始的双向 GRU 网络方向。默认为 forward。
39-
- **time_major** (bool,可选) - 指定 input 的第一个维度是否是 time steps。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],否则为[batch_size,time_steps,input_size]。`time_steps` 指输入序列的长度。默认为 False。
39+
- **time_major** (bool,可选) - 指定 input 的第一个维度是否是 time steps。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],否则为[batch_size,time_steps,input_size]。``time_steps`` 指输入序列的长度。默认为 False。
4040
- **dropout** (float,可选) - dropout 概率,指的是出第一层外每层输入时的 dropout 概率。范围为[0, 1]。默认为 0。
4141
- **weight_ih_attr** (ParamAttr,可选) - weight_ih 的参数。默认为 None。
4242
- **weight_hh_attr** (ParamAttr,可选) - weight_hh 的参数。默认为 None。
@@ -47,14 +47,14 @@ GRU
4747
输入
4848
::::::::::::
4949

50-
- **inputs** (Tensor) - 网络输入。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,input_size]。`time_steps` 指输入序列的长度。
50+
- **inputs** (Tensor) - 网络输入。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,input_size]。``time_steps`` 指输入序列的长度。
5151
- **initial_states** (Tensor,可选) - 网络的初始状态,形状为[num_layers * num_directions, batch_size, hidden_size]。如果没有给出则会以全零初始化。
5252
- **sequence_length** (Tensor,可选) - 指定输入序列的实际长度,形状为[batch_size],数据类型为 int64 或 int32。在输入序列中所有 time step 不小于 sequence_length 的元素都会被当作填充元素处理(状态不再更新)。
5353

5454
输出
5555
::::::::::::
5656

57-
- **outputs** (Tensor) - 输出,由前向和后向 cell 的输出拼接得到。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,num_directions * hidden_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,num_directions * hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,否则等于 1。`time_steps` 指输出序列的长度。
57+
- **outputs** (Tensor) - 输出,由前向和后向 cell 的输出拼接得到。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,num_directions * hidden_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,num_directions * hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,否则等于 1。``time_steps`` 指输出序列的长度。
5858
- **final_states** (Tensor) - 最终状态。形状为[num_layers * num_directions, batch_size, hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,返回值的前向和后向的状态的索引是 0,2,4,6..。和 1,3,5,7...,否则等于 1。
5959

6060
代码示例

docs/api/paddle/nn/LSTMCell_cn.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LSTMCell
2323
h_{t} &= o_{t} * \tanh (c_{t})\\
2424
y_{t} &= h_{t}
2525
26-
若设置了 `proj_size`,隐状态 :math:`h_{t}` 将会被映射到指定维度:
26+
若设置了 ``proj_size``,隐状态 :math:`h_{t}` 将会被映射到指定维度:
2727

2828
.. math::
2929
h_{t} = h_{t} * W_{proj\_size}
@@ -45,7 +45,7 @@ LSTMCell
4545
- **weight_hh_attr** (ParamAttr,可选) - weight_hh 的参数。默认为 None。
4646
- **bias_ih_attr** (ParamAttr,可选) - bias_ih 的参数。默认为 None。
4747
- **bias_hh_attr** (ParamAttr,可选) - bias_hh 的参数。默认为 None。
48-
- **proj_size** (int,可选) - 若大于 0,则会使用投影层将隐状态隐射到指定大小,其值必须小于 `hidden_size` 。默认为 0。
48+
- **proj_size** (int,可选) - 若大于 0,则会使用投影层将隐状态隐射到指定大小,其值必须小于 ``hidden_size`` 。默认为 0。
4949
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
5050

5151
变量
@@ -65,8 +65,8 @@ LSTMCell
6565
输出
6666
::::::::::::
6767

68-
- **outputs** (Tensor) - 输出。形状为[batch_size, hidden_size],对应公式中的 :math:`h_{t}`, 当设置了 `proj_size` 时,输出形状会被映射为[batch_size, proj_size]。
69-
- **new_states** (tuple) - 一个包含两个 Tensor 的元组,每个 Tensor 的形状都为[batch_size, hidden_size],新一轮的隐藏状态。形状为[batch_size, hidden_size],对应公式中的 :math:`h_{t},c_{t}`。当设置了 `proj_size` 时,:math:`h_{t}` 会被映射为[batch_size, proj_size]。
68+
- **outputs** (Tensor) - 输出。形状为[batch_size, hidden_size],对应公式中的 :math:`h_{t}`, 当设置了 ``proj_size`` 时,输出形状会被映射为[batch_size, proj_size]。
69+
- **new_states** (tuple) - 一个包含两个 Tensor 的元组,每个 Tensor 的形状都为[batch_size, hidden_size],新一轮的隐藏状态。形状为[batch_size, hidden_size],对应公式中的 :math:`h_{t},c_{t}`。当设置了 ``proj_size`` 时,:math:`h_{t}` 会被映射为[batch_size, proj_size]。
7070

7171
.. note::
7272
所有的变换矩阵的权重和偏置都默认初始化为 Uniform(-std, std),其中 std = :math:`\frac{1}{\sqrt{hidden\_size}}`。对于参数初始化,详情请参考 :ref:`cn_api_paddle_ParamAttr`。

docs/api/paddle/nn/LSTM_cn.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LSTM
2929
3030
y_{t} & = h_{t}
3131
32-
若设置了 `proj_size`,隐状态 :math:`h_{t}` 将会被映射到指定维度:
32+
若设置了 ``proj_size``,隐状态 :math:`h_{t}` 将会被映射到指定维度:
3333

3434
.. math::
3535
h_{t} = h_{t} * W_{proj\_size}
@@ -44,27 +44,27 @@ LSTM
4444
- **hidden_size** (int) - 隐藏状态 :math:`h` 大小。
4545
- **num_layers** (int,可选) - 循环网络的层数。例如,将层数设为 2,会将两层 GRU 网络堆叠在一起,第二层的输入来自第一层的输出。默认为 1。
4646
- **direction** (str,可选) - 网络迭代方向,可设置为 forward 或 bidirect(或 bidirectional)。forward 指从序列开始到序列结束的单向 GRU 网络方向,bidirectional 指从序列开始到序列结束,又从序列结束到开始的双向 GRU 网络方向。默认为 forward。
47-
- **time_major** (bool,可选) - 指定 input 的第一个维度是否是 time steps。如果 time_major 为 True,则 Tensor 的形状为[time_steps, batch_size, input_size],否则为[batch_size, time_steps, input_size]。`time_steps` 指输入序列的长度。默认为 False。
47+
- **time_major** (bool,可选) - 指定 input 的第一个维度是否是 time steps。如果 time_major 为 True,则 Tensor 的形状为[time_steps, batch_size, input_size],否则为[batch_size, time_steps, input_size]。``time_steps`` 指输入序列的长度。默认为 False。
4848
- **dropout** (float,可选) - dropout 概率,指的是除第一层外每层输入时的 dropout 概率。范围为[0, 1]。默认为 0。
4949
- **weight_ih_attr** (ParamAttr,可选) - weight_ih 的参数。默认为 None。
5050
- **weight_hh_attr** (ParamAttr,可选) - weight_hh 的参数。默认为 None。
5151
- **bias_ih_attr** (ParamAttr,可选) - bias_ih 的参数。默认为 None。
5252
- **bias_hh_attr** (ParamAttr,可选) - bias_hh 的参数。默认为 None。
53-
- **proj_size** (int,可选) - 若大于 0,则会使用投影层将隐状态隐射到指定大小,其值必须小于 `hidden_size` 。默认为 0。
53+
- **proj_size** (int,可选) - 若大于 0,则会使用投影层将隐状态隐射到指定大小,其值必须小于 ``hidden_size`` 。默认为 0。
5454
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
5555

5656
输入
5757
::::::::::::
5858

59-
- **inputs** (Tensor) - 网络输入。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,input_size]。`time_steps` 指输入序列的长度。
59+
- **inputs** (Tensor) - 网络输入。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,input_size]。``time_steps`` 指输入序列的长度。
6060
- **initial_states** (tuple,可选) - 网络的初始状态,一个包含 h 和 c 的元组,形状为[num_layers * num_directions, batch_size, hidden_size]。如果没有给出则会以全零初始化。
6161
- **sequence_length** (Tensor,可选) - 指定输入序列的实际长度,形状为[batch_size],数据类型为 int64 或 int32。在输入序列中所有 time step 不小于 sequence_length 的元素都会被当作填充元素处理(状态不再更新)。
6262

6363
输出
6464
::::::::::::
6565

66-
- **outputs** (Tensor) - 输出,由前向和后向 cell 的输出拼接得到。如果 time_major 为 True,则 Tensor 的形状为[time_steps, batch_size, num_directions * hidden_size],当设置了 `proj_size` 时,输出形状会被映射为[time_steps, batch_size, num_directions * proj_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,num_directions * hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,否则等于 1。`time_steps` 指输出序列的长度。
67-
- **final_states** (tuple) - 最终状态,一个包含 h 和 c 的元组。形状为[num_layers * num_directions, batch_size, hidden_size],当设置了 `proj_size` 时, h 的形状会被映射为[num_layers * num_directions, batch_size, proj_size]。 当 direction 设置为 bidirectional 时,num_directions 等于 2,返回值的前向和后向的状态的索引是 0,2,4,6..。和 1,3,5,7...,否则等于 1。
66+
- **outputs** (Tensor) - 输出,由前向和后向 cell 的输出拼接得到。如果 time_major 为 True,则 Tensor 的形状为[time_steps, batch_size, num_directions * hidden_size],当设置了 ``proj_size`` 时,输出形状会被映射为[time_steps, batch_size, num_directions * proj_size],如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,num_directions * hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,否则等于 1。``time_steps`` 指输出序列的长度。
67+
- **final_states** (tuple) - 最终状态,一个包含 h 和 c 的元组。形状为[num_layers * num_directions, batch_size, hidden_size],当设置了 ``proj_size`` 时, h 的形状会被映射为[num_layers * num_directions, batch_size, proj_size]。 当 direction 设置为 bidirectional 时,num_directions 等于 2,返回值的前向和后向的状态的索引是 0,2,4,6..。和 1,3,5,7...,否则等于 1。
6868

6969

7070
代码示例

docs/api/paddle/nn/RNNTLoss_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RNNTLoss
2424

2525
返回
2626
:::::::::
27-
``Tensor``,输入 ``input`` 和标签 ``labels`` 间的 `rnnt loss`。如果 :attr:`reduction` 是 ``'none'``,则输出 loss 的维度为 [batch_size]。如果 :attr:`reduction` 是 ``'mean'`` 或 ``'sum'``,则输出 Loss 的维度为 []。数据类型与输入的 ``input`` 一致。
27+
``Tensor``,输入 ``input`` 和标签 ``labels`` 间的 ``rnnt loss``。如果 :attr:`reduction` 是 ``'none'``,则输出 loss 的维度为 [batch_size]。如果 :attr:`reduction` 是 ``'mean'`` 或 ``'sum'``,则输出 Loss 的维度为 []。数据类型与输入的 ``input`` 一致。
2828

2929
代码示例
3030
:::::::::

docs/api/paddle/nn/SimpleRNNCell_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SimpleRNNCell
1919
2020
y_{t} & = h_{t}
2121
22-
其中的 `act` 表示激活函数。
22+
其中的 ``act`` 表示激活函数。
2323

2424
详情请参考论文:`Finding Structure in Time <https://onlinelibrary.wiley.com/doi/pdf/10.1207/s15516709cog1402_1>`_ 。
2525

docs/api/paddle/nn/SimpleRNN_cn.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ SimpleRNN
2626
- **hidden_size** (int) - 隐藏状态 :math:`h` 大小。
2727
- **num_layers** (int,可选) - 循环网络的层数。例如,将层数设为 2,会将两层 GRU 网络堆叠在一起,第二层的输入来自第一层的输出。默认为 1。
2828
- **direction** (str,可选) - 网络迭代方向,可设置为 forward 或 bidirect(或 bidirectional)。forward 指从序列开始到序列结束的单向 GRU 网络方向,bidirectional 指从序列开始到序列结束,又从序列结束到开始的双向 GRU 网络方向。默认为 forward。
29-
- **time_major** (bool,可选) - 指定 input 的第一个维度是否是 time steps。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],否则为[batch_size,time_steps,input_size]。`time_steps` 指输入序列的长度。默认为 False。
29+
- **time_major** (bool,可选) - 指定 input 的第一个维度是否是 time steps。如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size],否则为[batch_size,time_steps,input_size]。``time_steps`` 指输入序列的长度。默认为 False。
3030
- **dropout** (float,可选) - dropout 概率,指的是出第一层外每层输入时的 dropout 概率。范围为[0, 1]。默认为 0。
3131
- **activation** (str,可选) - 网络中每个单元的激活函数。可以是 tanh 或 relu。默认为 tanh。
3232
- **weight_ih_attr** (ParamAttr,可选) - weight_ih 的参数。默认为 None。
@@ -37,23 +37,23 @@ SimpleRNN
3737
输入
3838
::::::::::::
3939

40-
- **inputs** (Tensor) - 网络输入。如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,input_size],如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size]。 `time_steps` 指输入序列的长度。
40+
- **inputs** (Tensor) - 网络输入。如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,input_size],如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,input_size]。 ``time_steps`` 指输入序列的长度。
4141
- **initial_states** (Tensor,可选) - 网络的初始状态,形状为[num_layers * num_directions, batch_size, hidden_size]。如果没有给出则会以全零初始化。
4242
- **sequence_length** (Tensor,可选) - 指定输入序列的实际长度,形状为[batch_size],数据类型为 int64 或 int32。在输入序列中所有 time step 不小于 sequence_length 的元素都会被当作填充元素处理(状态不再更新)。
4343

4444
输出
4545
::::::::::::
4646

47-
- **outputs** (Tensor) - 输出,由前向和后向 cell 的输出拼接得到。如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,num_directions * hidden_size],如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,num_directions * hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,否则等于 1。 `time_steps` 指输出序列的长度。
47+
- **outputs** (Tensor) - 输出,由前向和后向 cell 的输出拼接得到。如果 time_major 为 False,则 Tensor 的形状为[batch_size,time_steps,num_directions * hidden_size],如果 time_major 为 True,则 Tensor 的形状为[time_steps,batch_size,num_directions * hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,否则等于 1。 ``time_steps`` 指输出序列的长度。
4848
- **final_states** (Tensor) - 最终状态。形状为[num_layers * num_directions, batch_size, hidden_size],当 direction 设置为 bidirectional 时,num_directions 等于 2,返回值的前向和后向的状态的索引是 0,2,4,6..。和 1,3,5,7...,否则等于 1。
4949

5050
变量
5151
::::::::::::
5252

53-
- **weight_ih_l[k]** (Parameter) - 第 k 层输入层到隐藏层变换矩阵的权重,如果 `k = 0`,形状为 `[hidden_size, input_size]`。否则,形状为 `[hidden_size, num_directions * hidden_size]` 。
54-
- **weight_hh_l[k]** (Parameter) - 第 k 层隐藏层到隐藏层变换矩阵的权重,形状为 `[hidden_size, hidden_size]` 。
55-
- **bias_ih_l[k]** (Parameter) - 第 k 层输入层到隐藏层的变换矩阵的偏置,形状为 `[hidden_size]` 。
56-
- **bias_hh_l[k]** (Parameter) - 第 k 层隐藏层到隐藏层的变换矩阵的偏置,形状为 `[hidden_size]` 。
53+
- **weight_ih_l[k]** (Parameter) - 第 k 层输入层到隐藏层变换矩阵的权重,如果 ``k = 0``,形状为 ``[hidden_size, input_size]``。否则,形状为 ``[hidden_size, num_directions * hidden_size]`` 。
54+
- **weight_hh_l[k]** (Parameter) - 第 k 层隐藏层到隐藏层变换矩阵的权重,形状为 ``[hidden_size, hidden_size]`` 。
55+
- **bias_ih_l[k]** (Parameter) - 第 k 层输入层到隐藏层的变换矩阵的偏置,形状为 ``[hidden_size]`` 。
56+
- **bias_hh_l[k]** (Parameter) - 第 k 层隐藏层到隐藏层的变换矩阵的偏置,形状为 ``[hidden_size]`` 。
5757

5858
代码示例
5959
::::::::::::

0 commit comments

Comments
 (0)