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

fix elu grad when alpha less then zero, test=develop #26543

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

qili93
Copy link
Contributor

@qili93 qili93 commented Aug 21, 2020

PR types

Bug fixes

PR changes

OPs

Describe

Fix the grad output of ELUGradFunctor when alpha is less then ZERO.

out=max(0,x)+min(0,α∗(e^x−1))

if alpha > 0 and x > 0, then out = x, then dx = dout
if alpha > 0 and x <=0, then out = α∗(e^x−1), then dx = dout ∗ α ∗ e^x
if alpha <= 0 and x > 0, then out = x + α∗(e^x−1), then dx = dout ∗ (1 + α ∗ e^x)
if alpha <= 0 and x <= 0, then out = 0, then dx = 0

@paddle-bot-old
Copy link

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

@qili93 qili93 changed the title fix elu grad whne alpha less then zero, test=develop fix elu grad when alpha less then zero, test=develop Aug 24, 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

@zhupengyang zhupengyang merged commit 6f69fbc into PaddlePaddle:develop Aug 25, 2020
@qili93 qili93 deleted the elu_fix branch August 25, 2020 01:41
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