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

Adding relu6 activation function #4607

Merged
merged 3 commits into from
Oct 9, 2017
Merged

Conversation

kavyasrinet
Copy link

Another activation, relu6:
relu6(x) = min(max(x, 0), 6)

wangkuiyi
wangkuiyi previously approved these changes Oct 6, 2017
Copy link
Collaborator

@wangkuiyi wangkuiyi 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

@dzhwinter dzhwinter left a comment

Choose a reason for hiding this comment

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

LGTM

float threshold;

// NOTE: Explicit hides the `BaseActivationFunctor<T>::GetAttrs`
// not polymorphism for speed.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that hiding the BaseActivationFunctor<T>::GetAttrs has an effect on speed. Because it will be expanded in compile time, so it's zero-cost.

@kavyasrinet kavyasrinet merged commit f30a1f4 into PaddlePaddle:develop Oct 9, 2017
@kavyasrinet kavyasrinet deleted the relu6 branch October 9, 2017 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants