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

hardtanh prelu softmax, test=develop #26431

Merged
merged 12 commits into from
Aug 21, 2020
Merged

Conversation

qili93
Copy link
Contributor

@qili93 qili93 commented Aug 19, 2020

PR types

Others

PR changes

APIs

Describe

Softmax

  • paddle.nn.Softmax(axis=-1, name=None) - 添加此 class
  • paddle.nn.functional.softmax(x, axis=-1, dtype=None, name=None - 完善文档和demo;input->x;添加dtype参数;当axis=-1 的时候,如果cudnn可用,就use_cudnn=True,其他情况下 use_cudnn=False;忽略 _stacklevel

PRelu

  • paddle.nn.PReLU(num_parameters=1, init=0.25, weight_attr=None, name=None) - 添加此class, num_parameter决定是scalar还是channel模式,不再支持elementwise
  • paddle.nn.functional.prelu(x, weight, name=None) - mode 保留, 支持float64

Hardtanh

  • paddle.nn.Hardtanh(min=-1.0, max=1.0, name=None) - 添加此class
  • paddle.nn.functional.hardtanh(x, min=-1, max=1, name=None) - 新增此function

function_hardtanh
function_prelu
function_softmax

@paddle-bot-old
Copy link

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

python/paddle/fluid/tests/unittests/test_softmax_op.py Outdated Show resolved Hide resolved
python/paddle/nn/functional/activation.py Outdated Show resolved Hide resolved
python/paddle/nn/functional/activation.py Outdated Show resolved Hide resolved
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

@qili93 qili93 changed the title softmax and hardtanh, test=develop hardtanh prelu softmax, test=develop Aug 19, 2020
zhupengyang
zhupengyang previously approved these changes Aug 20, 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

Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM~

@qili93
Copy link
Contributor Author

qili93 commented Aug 21, 2020

Fluid Doc PR PaddlePaddle/docs#2425

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -55,14 +55,15 @@
from .layer.activation import ELU
from .layer.activation import GELU
from .layer.activation import Hardshrink
# from .layer.activation import PReLU #DEFINE_ALIAS
from .layer.activation import Hardtanh
Copy link
Contributor

Choose a reason for hiding this comment

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

加一下 #DEFINE_ALIAS

@zhupengyang zhupengyang merged commit 8d19452 into PaddlePaddle:develop Aug 21, 2020
@qili93 qili93 deleted the 20_new_api branch August 21, 2020 02:46
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.

4 participants