-
Notifications
You must be signed in to change notification settings - Fork 614
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
GeLU activation as a layer #424
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AakashKumarNain Hi, it's a great PR! Maybe my explanation makes you confused... what I mean is to both keep activations.gelu
and layers.GeLU
haha. But no worries, I think you could re-open the previous PR :-) I would like to take both of them into addons.
Besides, I think we could also to add a test method like this one:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/layers/advanced_activations_test.py#L94-L102
Thanks for the contribution again!
@WindQAQ no worries. I have a very simple query. When I run |
unit-test can be done by running
(please type use to auto-complete the rule, say for sanity check, I think you refer to linter check right? If so, |
I don't have |
In my case, I always attach to the container to run tests. So I will first lanuch a container docker run --rm -it -v ${PWD}:/addons -w /addons tensorflow/tensorflow:custom-op-ubuntu16 /bin/bash
pip install --upgrade pip # Pip must be upgraded to install manylinux2010 pkg
./configure.sh # Links project with TensorFlow dependency And run the commands I paste above. |
I was about to create a pull request for Gelu too, but rather as an op implemented as C++: Here are the main files I have added: I will wait for this pull request to be merged so that I can see how to rebase on top of it. |
@mostafaelhoushi looks like there is a PR #427 which implements the C++ op. Would you mind doing a review? @AakashKumarNain Thanks very much! This looks great. Waiting for the activation to be merged first then we can review this and merge |
@WindQAQ @seanpmorgan since #427 has been merged, should we close #420 and update this layer implementation to use #427 ? |
…yer_gelu merge new changes
@seanpmorgan all checks passed! Wooo!! 🎉 |
Great, Aakash! @WindQAQ Tzu-Wei, could you take a look again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Probably need only one test case (TestGeLU
) with two test methods, say test_gelu
and test_layer_as_activation
. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/layers/advanced_activations_test.py for more details. Thanks!
@WindQAQ @facaiy I wanted to put them in a single Test case but I found out that |
@AakashKumarNain Yep, then just follow Facai's suggestions :P |
…yer_gelu merge latest changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Thank you @WindQAQ @facaiy @seanpmorgan @Squadrick |
I closed the PR that I opened it yesterday which proposed
gelu
as an activation function. This one is a much better implementation as the activation function here is represented as a keras layer