Skip to content

Commit a56a9d6

Browse files
authored
[Docathon][Fix Doc Format No.55-59] fix LayerNorm_cn API (#7476)
1 parent 812e273 commit a56a9d6

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

docs/api/paddle/nn/LayerNorm_cn.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ LayerNorm
1616
1717
\\y=f(\frac{g}{\sigma}(x-\mu) + b)\\
1818
19-
- :math:`x`:该层神经元的向量表示
20-
- :math:`H`:层中隐藏神经元个数
21-
- :math:`\epsilon`:添加较小的值到方差中以防止除零
22-
- :math:`g`:可训练的增益参数
23-
- :math:`b`:可训练的偏置参数
19+
- :math:`x` :该层神经元的向量表示
20+
- :math:`H` :层中隐藏神经元个数
21+
- :math:`\epsilon` :添加较小的值到方差中以防止除零
22+
- :math:`g` :可训练的增益参数
23+
- :math:`b` :可训练的偏置参数
2424

2525

2626
参数
2727
::::::::::::
2828

2929
- **normalized_shape** (int|list|tuple) – 需规范化的 shape,期望的输入 shape 为 ``[*, normalized_shape[0], normalized_shape[1], ..., normalized_shape[-1]]`` 。如果是单个整数,则此模块将在最后一个维度上规范化(此时最后一维的维度需与该参数相同)。
3030
- **epsilon** (float,可选) - 指明在计算过程中是否添加较小的值到方差中以防止除零。默认值:1e-05。
31-
weight_attr (ParamAttr|bool|None, 可选) - 用于指定可训练的增益参数 :math:g 的属性。如果为 False,则不使用权重(即权重参数为 None);如果为 None,则会使用一个默认的 ParamAttr 作为权重的属性设置,该属性将权重初始化为 1。默认值为 None,表示使用默认的权重属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr`。
32-
bias_attr (ParamAttr|bool|None, 可选) - 用于指定可训练的偏置参数 :math:b 的属性。如果为 False,则不使用偏置(即偏置参数为 None);如果为 None,则会使用一个默认的 ParamAttr 作为偏置的属性设置,该属性将偏置初始化为 0。默认值为 None,表示使用默认的偏置属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr`。
31+
- **weight_attr** (ParamAttr|bool|None, 可选) - 用于指定可训练的增益参数 :math:`g` 的属性。如果为 False,则不使用权重(即权重参数为 None);如果为 None,则会使用一个默认的 ParamAttr 作为权重的属性设置,该属性将权重初始化为 1。默认值为 None,表示使用默认的权重属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr`。
32+
- **bias_attr** (ParamAttr|bool|None, 可选) - 用于指定可训练的偏置参数 :math:`b` 的属性。如果为 False,则不使用偏置(即偏置参数为 None);如果为 None,则会使用一个默认的 ParamAttr 作为偏置的属性设置,该属性将偏置初始化为 0。默认值为 None,表示使用默认的偏置属性。具体用法请参见 :ref:`cn_api_paddle_ParamAttr`。
3333
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
3434

3535
形状

docs/api/paddle/nn/MaxPool3D_cn.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ MaxPool3D
1010
例如:
1111

1212
输入:
13-
X 形状::math:`\left ( N,C,D_{in}, H_{in},W_{in} \right )`
13+
X 形状: :math:`\left ( N,C,D_{in}, H_{in},W_{in} \right )`
1414
属性:
15-
kernel_size: :math:`ksize [kD, kH, kW]`
16-
stride: :math:`stride`
15+
kernel_size :math:`ksize [kD, kH, kW]`
16+
stride :math:`stride`
1717
输出:
18-
Out 形状::math:`\left ( N,C,D_{out}, H_{out},W_{out} \right )`
18+
Out 形状: :math:`\left ( N,C,D_{out}, H_{out},W_{out} \right )`
1919
.. math::
20-
.. math::
2120
\text{out}(N_i, C_j, d, h, w) ={} & \max_{k=0, \ldots, kD-1} \max_{m=0, \ldots, kH-1} \max_{n=0, \ldots, kW-1} \\
2221
& \text{input}(N_i, C_j, \text{stride[0]} \times d + k,
2322
\text{stride[1]} \times h + m, \text{stride[2]} \times w + n)

docs/api/paddle/nn/functional/max_pool3d_cn.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ max_pool3d
1010
例如:
1111

1212
输入:
13-
X 形状::math:`\left ( N,C,D_{in}, H_{in},W_{in} \right )`
13+
X 形状: :math:`\left ( N,C,D_{in}, H_{in},W_{in} \right )`
1414
属性:
1515
kernel_size: :math:`[kD, kH, kW]`
1616
stride: :math:`stride`
1717
输出:
18-
Out 形状::math:`\left ( N,C,D_{out}, H_{out},W_{out} \right )`
18+
Out 形状: :math:`\left ( N,C,D_{out}, H_{out},W_{out} \right )`
1919
.. math::
20-
.. math::
2120
\text{out}(N_i, C_j, d, h, w) ={} & \max_{k=0, \ldots, kD-1} \max_{m=0, \ldots, kH-1} \max_{n=0, \ldots, kW-1} \\
2221
& \text{input}(N_i, C_j, \text{stride[0]} \times d + k,
2322
\text{stride[1]} \times h + m, \text{stride[2]} \times w + n)

docs/api/paddle/sparse/nn/BatchNorm_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BatchNorm
88
99
构建稀疏 ``BatchNorm`` 类的一个可调用对象,具体用法参照 ``代码示例`` 。可以处理 4D SparseCooTensor ,实现了批归一化层(Batch Normalization Layer)的功能,可用作卷积和全连接操作的批归一化函数,根据当前批次数据按通道计算的均值和方差进行归一化。更多详情请参考: `Batch Normalization : Accelerating Deep Network Training by Reducing Internal Covariate Shift <https://arxiv.org/pdf/1502.03167.pdf>`_ 。
1010

11-
当 use_global_stats = False 时 :math: `\mu_{\beta}` 和 :math: `\sigma_{\beta}^{2}` 是 minibatch 的统计数据。计算公式如下:
11+
当 use_global_stats = False 时 :math:`\mu_{\beta}` 和 :math:`\sigma_{\beta}^{2}` 是 minibatch 的统计数据。计算公式如下:
1212

1313
.. math::
1414

docs/api/paddle/sparse/nn/SubmConv2D_cn.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SubmConv2D
99

1010
子流形稀疏二维卷积层(submanifold sparse convolution2d layer)根据输入计算输出,卷积核和步长、填充、空洞大小(dilations)一组参数。
1111
输入(input)和输出(Output)是多维的稀疏张量(Sparse Coo Tensor),
12-
形状为 :math:[N,H,W,C] 其中 N 是批尺寸,C 是通道,H 是特征高度,W 是特征宽度。
12+
形状为 :math:`[N,H,W,C]` 其中 N 是批尺寸,C 是通道,H 是特征高度,W 是特征宽度。
1313
如果提供了 bias_attr,则添加偏置项到卷积的输出。
1414
对于每一个输入 :math:`X`,方程是:
1515

@@ -18,11 +18,11 @@ SubmConv2D
1818
1919
其中:
2020

21-
- :math:`X`: 输入值, NDHWC 格式的 Tencer。
22-
- :math:`W`: 卷积核值, NDHWC 格式的 Tencer。
23-
- :math:`\\ast`: 子流形卷积运算, 参考论文: https://arxiv.org/abs/1706.01307。
24-
- :math:`b`: 偏置值, 形状为[M]的 1-D Tencer。
25-
- :math:`Out`: 输出值, :math:`Out` 和 :math:`X` 的形状可能不同。
21+
- :math:`X` : 输入值, NDHWC 格式的 Tencer。
22+
- :math:`W` : 卷积核值, NDHWC 格式的 Tencer。
23+
- :math:`\\ast` : 子流形卷积运算, 参考论文: https://arxiv.org/abs/1706.01307。
24+
- :math:`b` : 偏置值, 形状为[M]的 1-D Tencer。
25+
- :math:`Out` : 输出值, :math:`Out` 和 :math:`X` 的形状可能不同。
2626

2727
参数
2828
::::::::::::
@@ -44,7 +44,7 @@ SubmConv2D
4444
- **groups** (int, 可选): - 二维卷积层的组号。根据 Alex Krizhevsky 的 Deep CNN 论文中的分组卷积:当 group = 2 时, 卷积核的前半部分仅连接到输入通道的前半部分, 而卷积核的后半部分仅连接到输入通道的后半部分。默认值为 1。
4545
- **padding_mode** (str, 可选): - ``'zeros'`` , ``'reflect'`` , ``'replicate'`` 或 ``'circular'`` 。 目前仅支持 ``'zeros'`` 。
4646
- **key** (str, 可选): - key 用于保存或使用相同的规则手册,规则手册的定义和作用是指 https://pdfs.semanticscholar.org/5125/a16039cabc6320c908a4764f32596e018ad3.pdf。默认值为 None。
47-
- **weight_attr** (ParamAttr, 可选): - conv2d 的可学习参数/权重的参数属性。如果设置为 None 或 ParamAttr 的一个属性,则 conv2d 将创建 ParamAttr 作为 param_attr。 如果设置为 None, 则参数初始化为:math:`Normal(0.0, std)`, 并且 :math:`std` 是:math:`(\frac{2.0 }{filter\_elem\_num})^{0.5}`,默认值为 None。
47+
- **weight_attr** (ParamAttr, 可选): - conv2d 的可学习参数/权重的参数属性。如果设置为 None 或 ParamAttr 的一个属性,则 conv2d 将创建 ParamAttr 作为 param_attr。 如果设置为 None, 则参数初始化为 :math:`Normal(0.0, std)` , 并且 :math:`std` 是 :math:`(\frac{2.0 }{filter\_elem\_num})^{0.5}` ,默认值为 None。
4848
- **bias_attr** (ParamAttr|bool, 可选): - conv2d 偏差的参数属性。如果设置为 False, 则不会向输出单位添加任何偏置。如果设置为 None 或 ParamAttr 的一个属性,则 conv2d 将创建 ParamAttr 作为 bias_attr。如果未设置 bias_attr 的初始值设定项,则偏置初始化为零。默认值为 None。
4949
- **data_format** (str, 可选): 指定输入布局的数据格式。它可以是 "NCHW" 或 "NHWC"。目前仅支持 "NHWC"。
5050

0 commit comments

Comments
 (0)