-
Notifications
You must be signed in to change notification settings - Fork 776
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
对多个文档按照要求修改 #5453
对多个文档按照要求修改 #5453
Changes from 6 commits
c39d05a
7017d37
39a5c8f
7d381bb
73fb698
68519d1
45b4bd7
edca5d5
0a151b7
da5f0a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
.. _cn_api_fluid_layers_unfold: | ||
|
||
unfold | ||
Unfold | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good job!英文文档删除一下 this op 吧~ |
||
------------------------------- | ||
|
||
.. py:function:: paddle.nn.Unfold(kernel_size=[3,3], strides=1, paddings=1, dilation=1, name=None) | ||
.. py:class:: paddle.nn.Unfold(kernel_sizes, dilations=1, paddings=0, strides=1, name=None) | ||
|
||
|
||
|
||
|
||
实现的功能与卷积中用到的 im2col 函数一样,通常也被称作为 im2col 过程。对于每一个卷积核覆盖下的区域,元素会被重新排成一列。当卷积核在整个图片上滑动时,将会形成一系列的列向量。对于每一个输入形状为[N, C, H, W]的 ``x``,都将会按照下面公式计算出一个形状为[N, Cout, Lout]的输出。 | ||
|
||
.. note:: | ||
对应的 `functional 方法` 请参考::ref:`cn_api_nn_functional_unfold` 。 | ||
对应的 `functional 方法` 请参考::ref:`cn_api_nn_functional_unfold`。 | ||
|
||
|
||
**样例**: | ||
|
@@ -31,10 +31,10 @@ unfold | |
参数 | ||
:::::::::::: | ||
|
||
- **kernel_size** (int|list of int) – 卷积核的尺寸,整数或者整型列表。如果为整型列表,应包含两个元素 ``[k_h, k_w]``,卷积核大小为 ``k_h * k_w``;如果为整数 k,会被当作整型列表 ``[k, k]`` 处理 | ||
- **strides** (int|list of int,可选) – 卷积步长,整数或者整型列表。如果为整型列表,应该包含两个元素 ``[stride_h, stride_w]``。如果为整数,则 ``stride_h = stride_w = strides``。默认值为 1 | ||
- **paddings** (int|list of int,可选) – 每个维度的扩展,整数或者整型列表。如果为整型列表,长度应该为 4 或者 2;长度为 4 对应的 padding 参数是:[padding_top, padding_left,padding_bottom, padding_right],长度为 2 对应的 padding 参数是[padding_h, padding_w],会被当作[padding_h, padding_w, padding_h, padding_w]处理。如果为整数 padding,则会被当作[padding, padding, padding, padding]处理。默认值为 0 | ||
- **kernel_sizes** (int|list of int) – 卷积核的尺寸,整数或者整型列表。如果为整型列表,应包含两个元素 ``[k_h, k_w]``,卷积核大小为 ``k_h * k_w``;如果为整数 k,会被当作整型列表 ``[k, k]`` 处理 | ||
- **dilations** (int|list of int,可选) – 卷积膨胀,整型列表或者整数。如果为整型列表,应该包含两个元素[dilation_h, dilation_w]。如果是整数 dilation,会被当作整型列表[dilation, dilation]处理。默认值为 1 | ||
- **paddings** (int|list of int,可选) – 每个维度的扩展,整数或者整型列表。如果为整型列表,长度应该为 4 或者 2;长度为 4 对应的 padding 参数是:[padding_top, padding_left,padding_bottom, padding_right],长度为 2 对应的 padding 参数是[padding_h, padding_w],会被当作[padding_h, padding_w, padding_h, padding_w]处理。如果为整数 padding,则会被当作[padding, padding, padding, padding]处理。默认值为 0 | ||
- **strides** (int|list of int,可选) – 卷积步长,整数或者整型列表。如果为整型列表,应该包含两个元素 ``[stride_h, stride_w]``。如果为整数,则 ``stride_h = stride_w = strides``。默认值为 1 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
形状 | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,7 +6,7 @@ Upsample | |||||
.. py:class:: paddle.nn.Upsample(size=None, scale_factor=None, mode='nearest', align_corners=False, align_mode=0, data_format='NCHW', name=None) | ||||||
|
||||||
|
||||||
该 OP 用于调整一个 batch 中图片的大小。 | ||||||
用于调整一个 batch 中图片的大小。 | ||||||
|
||||||
输入为 3-D Tensor 时形状为(num_batches, channels, in_w),输入为 4-D Tensor 时形状为(num_batches, channels, in_h, in_w)或者(num_batches, in_h, in_w, channels),输入为 5-D Tensor 时形状为(num_batches, channels, in_d, in_h, in_w)或者(num_batches, in_d, in_h, in_w, channels),并且调整大小只适用于深度,高度和宽度对应的维度。 | ||||||
|
||||||
|
@@ -150,17 +150,17 @@ https://en.wikipedia.org/wiki/Bicubic_interpolation | |||||
参数 | ||||||
::::::::: | ||||||
|
||||||
- **size** (list|tuple|Variable|None) - 输出 Tensor,输入为 3D 张量时,形状为为(out_w)的 1-D Tensor。输入为 4D 张量时,形状为为(out_h, out_w)的 2-D Tensor。输入为 5-D Tensor 时,形状为(out_d, out_h, out_w)的 3-D Tensor。如果 :code:`out_shape` 是列表,每一个元素可以是整数或者形状为[1]的变量。如果 :code:`out_shape` 是变量,则其维度大小为 1。默认值为 None。 | ||||||
- **scale_factor** (float|Tensor|list|tuple|None)-输入的高度或宽度的乘数因子。out_shape 和 scale 至少要设置一个。out_shape 的优先级高于 scale。默认值为 None。如果 scale_factor 是一个 list 或 tuple,它必须与输入的 shape 匹配。 | ||||||
- **size** (list|tuple|Tensor|None) - 输出 Tensor 的形状,输入为 3D 张量时,形状为为(out_w)的 1-D Tensor。输入为 4D 张量时,形状为为(out_h, out_w)的 2-D Tensor。输入为 5-D Tensor 时,形状为(out_d, out_h, out_w)的 3-D Tensor。如果 :code:`size` 是列表,每一个元素可以是整数或者形状为[1]的变量。如果 :code:`size` 是变量,则其维度大小为 1。默认值为 None。 | ||||||
- **scale_factor** (float|Tensor|list|tuple|None)-输入的深度、高度或宽度的缩放因子。:code:`size` 和 :code:`scale_factor` 至少要设置一个。:code:`size` 的优先级高于:code:`scale_factor`。默认值为 None。如果 scale_factor 是一个 list 或 tuple,它必须与输入的 shape 匹配。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 另外 size=None, scale_factor=None ,所以这俩是可选参数啦 |
||||||
- **mode** (str,可选) - 插值方法。支持"bilinear"或"trilinear"或"nearest"或"bicubic"或"linear"或"area"。默认值为"nearest"。 | ||||||
- **align_corners** (bool,可选)- 一个可选的 bool 型参数,如果为 True,则将输入和输出张量的 4 个角落像素的中心对齐,并保留角点像素的值。默认值为 True | ||||||
- **align_mode** (int,可选)- 双线性插值的可选项。可以是 '0' 代表 src_idx = scale *(dst_indx + 0.5)-0.5;如果为'1',代表 src_idx = scale * dst_index。 | ||||||
- **data_format** (str,可选)- 指定输入的数据格式,输出的数据格式将与输入保持一致。对于 3-D Tensor,支持 NCHW(num_batches, channels, width),对于 4-D Tensor,支持 NCHW(num_batches, channels, height, width) 或者 NHWC(num_batches, height, width, channels),对于 5-D Tensor,支持 NCDHW(num_batches, channels, depth, height, width)或者 NDHWC(num_batches, depth, height, width, channels),默认值:'NCHW'。 | ||||||
- **align_corners** (bool,可选) - 一个可选的 bool 型参数,如果为 True,则将输入和输出张量的 4 个角落像素的中心对齐,并保留角点像素的值。默认值为 False。 | ||||||
- **align_mode** (int,可选) - 双线性插值的可选项。可以是 '0' 代表 src_idx = scale *(dst_indx + 0.5)-0.5;如果为'1',代表 src_idx = scale * dst_index。默认值为 0。 | ||||||
- **data_format** (str,可选) - 指定输入的数据格式,输出的数据格式将与输入保持一致。对于 3-D Tensor,支持 NCW(num_batches, channels, width)或者 NWC(num_batches, width, channels),对于 4-D Tensor,支持 NCHW(num_batches, channels, height, width) 或者 NHWC(num_batches, height, width, channels),对于 5-D Tensor,支持 NCDHW(num_batches, channels, depth, height, width)或者 NDHWC(num_batches, depth, height, width, channels),默认值:'NCHW'。 | ||||||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||||||
|
||||||
返回 | ||||||
:::::::::::: | ||||||
3-D Tensor,形状为 (num_batches, channels, out_w) ;4-D Tensor,形状为 (num_batches, channels, out_h, out_w) 或 (num_batches, out_h, out_w, channels);或者 5-D Tensor,形状为 (num_batches, channels, out_d, out_h, out_w) 或 (num_batches, out_d, out_h, out_w, channels)。 | ||||||
3-D Tensor,形状为(num_batches, channels, out_w)或者(num_batches, out_w, channels);4-D Tensor,形状为 (num_batches, channels, out_h, out_w) 或 (num_batches, out_h, out_w, channels);或者 5-D Tensor,形状为 (num_batches, channels, out_d, out_h, out_w) 或 (num_batches, out_d, out_h, out_w, channels)。 | ||||||
|
||||||
|
||||||
代码示例 | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -29,13 +29,13 @@ mse_loss | |||||
::::::::: | ||||||
- **input** (Tensor) - 预测值,维度为 :math:`[N_1, N_2, ..., N_k]` 的多维 Tensor。数据类型为 float32 或 float64。 | ||||||
- **label** (Tensor) - 目标值,维度为 :math:`[N_1, N_2, ..., N_k]` 的多维 Tensor。数据类型为 float32 或 float64。 | ||||||
- **reduction** (string, optional) - 输出的归约方法可以是'none'、'mean'或'sum'。 | ||||||
- **reduction** (string, 可选) - 输出的归约方法可以是'none'、'mean'或'sum'。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 顺便英文文档也改一下吧~ |
||||||
|
||||||
- 如果 :attr:`reduction` 是 ``'mean'``,则返回减少的平均损失。 | ||||||
- 如果 :attr:`reduction` 是 ``'sum'``,则返回减少的总损失。 | ||||||
- 如果 :attr: `reduction` 为 `'none'`,返回未减少的损失。默认为 `'mean'`。 | ||||||
|
||||||
- **name** (str, optional) - 操作的名称(可选,默认为 None)。 更多信息请参考:ref:`api_guide_Name`。 | ||||||
- **name** (str, 可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||||||
|
||||||
返回 | ||||||
::::::::: | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle.nn.Maxout(groups, axis=1, name=None)
所以group其实应该是必选参数,没有默认值
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实这个翻译还是有点问题的,groups
英文的需要在paddle的源代码里改?也就是还需要下载 paddlepaddle的源?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对的,英文文档在 https://github.com/PaddlePaddle/paddle ,#5453 (comment) 说了怎么找相应的源代码