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

Add the ReLU6, Tanhshrink, SELU, Softplus, Softshrink and Softsign for the api 2.0 #26376

Merged
merged 13 commits into from
Aug 20, 2020

Conversation

hong19860320
Copy link
Contributor

@hong19860320 hong19860320 commented Aug 17, 2020

PR types

Others

PR changes

APIs

Describe

新增/修改如下2.0 API:

ReLU6:

paddle.nn.ReLU6(name=None) - 新增
paddle.nn.functional.relu6(x, name=None) - 新增,去掉threshold参数(fluid.layers.relu6包含threshold参数)

Tanhshrink:

paddle.nn.Tanhshrink(name=None) - 新增
paddle.nn.functional.tanhshrink(x, name=None) - 新增,修改名称(fluid.layers.tanh_shrink)

SELU:
paddle.nn.SELU(scale=1.0507009873554804934193349852946, alpha=1.6732632423543772848170429916717, name=None) - 新增
paddle.nn.functional.selu(x, scale=1.0507009873554804934193349852946, alpha=1.6732632423543772848170429916717, name=None) - 新增,设置参数默认值(fluid.layers.selu(x, scale=None, alpha=None, name=None))

Softplus:
paddle.nn.Softplus(beta=1, threshold=20, name=None) - 新增
paddle.nn.functional.softplus(x, beta=1, threshold=20, name=None) - 新增,增加参数beta和threshold参数,并设置默认值(fluid.layers.softplus(x, name=None))

Softshrink:
paddle.nn.Softshrink(threshold=0.5, name=None) - 新增
paddle.nn.functional.softshrink(x, threshold=0.5, name=None) - 新增,alpha改为threshold并设置默认值(fluid.layers.softshrink(x, alpha=None, name=None))

Softsign:
paddle.nn.Softsign(name=None) - 新增
paddle.nn.functional.softsign(x, name=None) - 新增,(fluid.layers.softsign(x, name=None))

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Aug 17, 2020

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@hong19860320 hong19860320 changed the title Add the relu6/ReLU6 for the api 2.0 Add the ReLU6, Tanhshrink, SELU, Softplus, Softshrink and Softsign for the api 2.0 Aug 19, 2020
zhupengyang
zhupengyang previously approved these changes Aug 19, 2020
Copy link
Contributor

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

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

LGTM

test=develop
@hong19860320 hong19860320 merged commit 40d193e into PaddlePaddle:develop Aug 20, 2020
@hong19860320 hong19860320 deleted the hongming/fix_api_2 branch August 20, 2020 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants