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

No.18 paddle.nn.GLU易用性提升 中文api文档 #6291

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

YibinLiu666
Copy link
Contributor

PR types

Others

PR changes

Others

Description

新增paddle.nn.GLU中文api文档
PaddlePaddle/Paddle#58632
PaddlePaddle/Paddle#55883


GLU
-------------------------------
.. py:class:: paddle.nn.GLU(axis=-1, name=None)
Copy link
Contributor

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.

这个nn.GLU是一个layer,定义这个layer的时候应该是不用放输入的吧,我看其他激活函数也没有放输入

Copy link
Contributor

Choose a reason for hiding this comment

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

好的

门控线性单元。输入按照给定的维度二等分,其中第一部分被用作内容,第二部分经过一个 sigmoid 函数之后被用作门限。输出是内容和门限的逐元素乘积。更多细节请参考 `Language Modeling with Gated Convolutional Networks <https://arxiv.org/abs/1612.08083>`_ 。

.. math::
GLU(a, b) = a \otimes \sigma(b)
Copy link
Contributor

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.

Done

Copy link
Contributor

@zxcd zxcd left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 7e20c46 into PaddlePaddle:develop Nov 13, 2023
2 checks passed
@sunzhongkai588
Copy link
Collaborator

CI检查出一个错,应该是因为 paddle.nn.Overview 页面里有个API Label 废弃了(paddle.nn.functional.diag_embed),要不顺手修一下吧(狗头) @YibinLiu666
d5db927b02d6a7fceee45b2cd5d4167c
就是把

    " :ref:`paddle.nn.functional.diag_embed <cn_api_paddle_nn_functional_diag_embed>` ", "对角线 Embedding 方法"

改成

    " paddle.nn.functional.diag_embed ", "对角线 Embedding 方法,paddle.nn.functional.diag_embed 已废弃,请使用 :ref:`paddle.diag_embed <cn_api_paddle_diag_embed> "

@YibinLiu666 YibinLiu666 deleted the nnGLU branch November 13, 2023 09:46
@YibinLiu666
Copy link
Contributor Author

CI检查出一个错,应该是因为 paddle.nn.Overview 页面里有个API Label 废弃了(paddle.nn.functional.diag_embed),要不顺手修一下吧(狗头) @YibinLiu666 d5db927b02d6a7fceee45b2cd5d4167c 就是把

    " :ref:`paddle.nn.functional.diag_embed <cn_api_paddle_nn_functional_diag_embed>` ", "对角线 Embedding 方法"

改成

    " paddle.nn.functional.diag_embed ", "对角线 Embedding 方法,paddle.nn.functional.diag_embed 已废弃,请使用 :ref:`paddle.diag_embed <cn_api_paddle_diag_embed> "

这个pr已经merge了,我去我这个 #6305 PR里面改一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants