ivy
ivy copied to clipboard
added selu function to jax frontend nn and its tests
selu #4919
hey @Auxia ,if you aren’t too busy could you please review my code, thank you :)
Hi @kundakinte, sorry for the late reply! Is this an ivy extension request or a frontend implementation? Afaik, we do not have a an implementation for selu
at the backend. For the frontend task it's required to use the ivy.<backend>
functions in the implementations. If you want to work on an extension task then you can look for one in extensions
label.
Thanks!
hello @Auxia, no worries. this is a Jax front end implementation, one of the 23 tasks in the “Add Non-Linear activation functions to JAX frontend” ToDo issue. I have made changes and used ivy.backend functions
This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days.
Hello I’m waiting for my pull request to be reviewed If you’re free @Auxia or anybody else could you please review it
Hi @kundakinte, There seem to be some conflicts that are yet to be resolved. Also no checks have been run on this PR, which is pretty peculiar. Can you resolve the conflicts and then I can quickly get it reviewed this weekend. I will also figure out why no checks have been run on your latest commit.
Hey @Auxia , sorry, saw this late, resolved the conflicts, ready for review
This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days.
hello, waiting for a code review from @Auxia
This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days.
hello, still waiting for feedback from @Auxia
hey @ogbanugot , waiting for feedback
Also, the tests are not passing, you might want to fix that if you do want to contribute the current implementation you have here.
So, I think following the implementation here this works;
@to_ivy_arrays_and_back
def selu(x):
alpha = 1.6732632423543772848170429916717
scale = 1.0507009873554804934193349852946
return scale * elu(x, alpha)
If you use the implementation above, plus the small change to the test, everything works just fine. Unless you have an explanation for the implementation you have currently, then feel free to go ahead and make the suggested changes and then request a review from me when done. Thanks!
hello @ogbanugot , thank you so much for the review. funnily enough seems like my initial implementation was correct, you can see it in my earlier commits, but i was made to believe there was another way. anyways i reverted back to my initial implementation and changed float to valid. thank you