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

修复 paddle.assign 等 API 的文档 #4850

Merged
merged 15 commits into from
Jun 6, 2022

Conversation

BrilliantYuKaimin
Copy link
Contributor

PADDLEPADDLE_PR=42942
涉及到的 API 有

  • paddle.assign
  • paddle.where
  • paddle.nn.AdaptiveAvgPool1D
  • paddle.nn.functional.adaptive_avg_pool1d
  • paddle.nn.initializer.XavierNormal
  • paddle.nn.initializer.XavierUniform

对应的英文文档修复为:PaddlePaddle/Paddle#42942

@paddle-bot-old
Copy link

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-4850.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:[Beta]飞桨文档预览工具


该算子根据输入 `x` , `output_size` 等参数对一个输入Tensor计算1D的自适应平均池化。输入和输出都是3-D Tensor,
默认是以 `NCL` 格式表示的,其中 `N` 是 batch size, `C` 是通道数, `L` 是输入特征的长度.
根据 `output_size` 对一个输入 Tensor 计算 1D 的自适应平均汇聚。输入和输出都是以 NCL 格式表示的 3-D Tensor,其中 N 是批大小,C 是通道数而 L 是特征的长度。输出的形状是 :math:`[N, C, output\_size]`。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

池化是比较常见的说法,汇聚是哪里的解释呢?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“汇聚”来自李航博士等人的推荐翻译。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

经过内部讨论,建议还是使用通用的翻译吧,原因有两个:

  • 这套翻译术语目前暂未大规模推广开来,直接修改更容易增加理解成本,和文档「辅助开发者使用」的目的相悖;
  • 飞桨有制定深度学习常用术语表,在表中写明了pooling使用通用的说法池化,飞桨的大量文档也是使用了这样的说法,全量修改是一个大工程。

如果未来这套术语得到国内开发者的广泛认可或官方推广,我们会考虑全量更新,但就目前的情况来看,可能时机尚不成熟~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我先将“汇聚”改回为“池化”,但我不接受这个建议。如果连飞桨这样的平台都不去推广这样一个更合适的翻译,那它如何才能被国内开发者广泛知晓呢?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我们后续会做更多调研,来评估是否推广这一套翻译,感谢指出

@@ -6,45 +6,23 @@ adaptive_avg_pool1d

.. py:function:: paddle.nn.functional.adaptive_avg_pool1d(x, output_size, name=None)

该算子根据输入 `x` , `output_size` 等参数对一个输入Tensor计算1D的自适应平均池化。输入和输出都是3-D Tensor,
默认是以 `NCL` 格式表示的,其中 `N` 是 batch size, `C` 是通道数, `L` 是输入特征的长度.
根据 `output_size` 对 Tensor `x` 计算 1D 自适应平均汇聚。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rst解析中,灰色底块x的效果需要两个「``」,一个的效果是斜体

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完成,原先确实不知道这一点。

@@ -6,45 +6,23 @@ adaptive_avg_pool1d

.. py:function:: paddle.nn.functional.adaptive_avg_pool1d(x, output_size, name=None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议同步修改AdaptiveAvgPool2D & adaptive_avg_pool2d、AdaptiveAvgPool3D & adaptive_avg_pool3d,问题是一样的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还是留给接受“池化”这个翻译的同学去修改吧。

@@ -6,48 +6,26 @@ XavierNormal
.. py:class:: paddle.nn.initializer.XavierNormal(fan_in=None, fan_out=None, name=None)


该类实现Xavier权重初始化方法( Xavier weight initializer),Xavier权重初始化方法出自Xavier Glorot和Yoshua Bengio的论文 `Understanding the difficulty of training deep feedforward neural networks <http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf>`_
使用正态分布的泽维尔权重初始化方法。泽维尔权重初始化方法出自泽维尔·格洛特和约书亚·本吉奥的论文 `Understanding the difficulty of training deep feedforward neural networks <http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf>`_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

句尾标点符号

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完成。

\begin{cases}
x_i, & \text{if} \ condition_i \ \text{is} \ True \\
y_i, & \text{if} \ condition_i \ \text{is} \ False \\
\end{cases}

.. note::
``numpy.where(condition)`` 功能与 ``paddle.nonzero(condition, as_tuple=True)`` 相同。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paddle.nonzero 最好加上超链接,可参考文档

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完成。

@@ -8,50 +8,32 @@ where

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. py:function:: paddle.where(condition, x=None, y=None, name=None)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完成

Copy link
Collaborator

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants