Skip to content

[Docathon][Update Doc No.31] update activation #7297

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Echo-Nie
Copy link
Contributor

@Echo-Nie Echo-Nie commented Apr 29, 2025

Fix

activation.rst
activation_en.rst

Description

Repair the document according to Paddle 1.8 与 Paddle 2.0 API 映射表

Deprecated APIs New APIs
:ref:cn_api_fluid_layers_relu :ref:cn_api_nn_functional_relu
:ref:cn_api_fluid_layers_tanh :ref:cn_api_nn_functional_tanh
:ref:cn_api_fluid_layers_sigmoid :ref:cn_api_nn_functional_sigmoid
:ref:cn_api_fluid_layers_elu :ref:cn_api_nn_functional_elu
:ref:cn_api_fluid_layers_relu6 :ref:cn_api_nn_functional_relu6
:ref:cn_api_fluid_layers_pow :ref:cn_api_pow
:ref:cn_api_fluid_layers_stanh :ref:cn_api_stanh
:ref:cn_api_fluid_layers_hard_sigmoid :ref:cn_api_nn_functional_hard_sigmoid
:ref:cn_api_fluid_layers_swish :ref:cn_api_nn_functional_swish
:ref:cn_api_fluid_layers_prelu :ref:cn_api_nn_functional_prelu
:ref:cn_api_fluid_layers_leaky_relu :ref:cn_api_nn_functional_leaky_relu
:ref:cn_api_fluid_layers_thresholded_relu :ref:cn_api_nn_functional_thresholded_relu
:ref:cn_api_fluid_layers_maxout :ref:cn_api_nn_functional_maxout
:ref:cn_api_fluid_layers_logsigmoid :ref:cn_api_nn_functional_logsigmoid
:ref:cn_api_fluid_layers_hard_shrink :ref:cn_api_nn_functional_hard_shrink
:ref:cn_api_fluid_layers_softsign :ref:cn_api_nn_functional_softsign
:ref:cn_api_fluid_layers_softplus :ref:cn_api_nn_functional_softplus
:ref:cn_api_fluid_layers_tanh_shrink :ref:cn_api_nn_functional_tanh_shrink
:ref:cn_api_fluid_layers_softshrink :ref:cn_api_nn_functional_softshrink
:ref:cn_api_fluid_layers_exp :ref:cn_api_exp

The following APIs have been removed:

  • :ref:cn_api_fluid_layers_brelu
  • :ref:cn_api_fluid_layers_soft_relu

issue: #71203
@DrRyanHuang

Copy link

paddle-bot bot commented Apr 29, 2025

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

@Echo-Nie Echo-Nie changed the title [Docathon][Update Doc No.31] update the api path [Docathon][Update Doc No.31] update activation Apr 29, 2025
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Apr 30, 2025

.. code-block:: python

conv2d = fluid.layers.conv2d(input=data, num_filters=2, filter_size=3)
relu1 = fluid.layers.relu(conv2d)
conv2d = nn.functional.conv2d(input=data, num_filters=2, filter_size=3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nn.functional.conv2d 按照其签名修改一下参数:

paddle.nn.functional.conv2d(x, weight, bias=None, stride=1, padding=0, dilation=1, groups=1, data_format='NCHW', name=None)

英文版也改一下


- 如果一个层的接口提供了 :code:`act` 变量(默认值为 None),我们可以通过该变量指定该层的激活函数类型。该方式支持常见的激活函数: :code:`relu`, :code:`tanh`, :code:`sigmoid`, :code:`identity`。

.. code-block:: python

conv2d = fluid.layers.conv2d(input=data, num_filters=2, filter_size=3, act="relu")
conv2d = nn.functional.conv2d(input=data, num_filters=2, filter_size=3, act="relu")
Copy link
Collaborator

Choose a reason for hiding this comment

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

参数改一下

Comment on lines +11 to +29
- :ref:`cn_api_exp`
- :ref:`cn_api_pow`
- :ref:`cn_api_stanh`
- :ref:`cn_api_nn_functional_elu`
- :ref:`cn_api_nn_functional_hard_sigmoid`
- :ref:`cn_api_nn_functional_hard_shrink`
- :ref:`cn_api_nn_functional_leaky_relu`
- :ref:`cn_api_nn_functional_logsigmoid`
- :ref:`cn_api_nn_functional_maxout`
- :ref:`cn_api_nn_functional_prelu`
- :ref:`cn_api_static_nn_prelu`
- :ref:`cn_api_nn_functional_relu`
- :ref:`cn_api_nn_functional_relu6`
- :ref:`cn_api_nn_functional_sigmoid`
- :ref:`cn_api_nn_functional_softplus`
- :ref:`cn_api_nn_functional_softshrink`
- :ref:`cn_api_nn_functional_softsign`
- :ref:`cn_api_nn_functional_swish`
- :ref:`cn_api_nn_functional_thresholded_relu`
Copy link
Collaborator

Choose a reason for hiding this comment

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

preview 没有正确渲染,修改下 rst 引用格式语法,英文版也改一下

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.

3 participants