-
Notifications
You must be signed in to change notification settings - Fork 752
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
No.18 paddle.nn.GLU易用性提升 中文api文档 #6291
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.. _cn_api_paddle_nn_GLU: | ||
|
||
GLU | ||
------------------------------- | ||
.. py:class:: paddle.nn.GLU(axis=-1, name=None) | ||
|
||
GLU 激活层(GLU Activation Operator) | ||
|
||
门控线性单元。输入按照给定的维度二等分,其中第一部分被用作内容,第二部分经过一个 sigmoid 函数之后被用作门限。输出是内容和门限的逐元素乘积。更多细节请参考 `Language Modeling with Gated Convolutional Networks <https://arxiv.org/abs/1612.08083>`_ 。 | ||
|
||
.. math:: | ||
GLU(a, b) = a \otimes \sigma(b) | ||
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. 这里的数据格式是不是有问题。 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. Done |
||
|
||
参数 | ||
:::::::::: | ||
- **axis** (int,可选) - 沿着该轴将输入二等分。:math:`D` 为输入的维数,则 :attr:`axis` 应该在 :math:`[-D, D)` 的范围内。如 :attr:`axis` 为负数,则相当于 :math:`axis + D`,默认值为-1。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
形状 | ||
:::::::::: | ||
- input:shape[axis]为偶数的 Tensor。 | ||
- output: 数据类型与输入一致,在指定的轴上其尺寸减半的 Tensor。 | ||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.nn.GLU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
把输入也放进去
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.
这个nn.GLU是一个layer,定义这个layer的时候应该是不用放输入的吧,我看其他激活函数也没有放输入
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.
好的