ivy icon indicating copy to clipboard operation
ivy copied to clipboard

added selu function to jax frontend nn and its tests

Open kundakinte opened this issue 2 years ago • 3 comments

selu #4919

kundakinte avatar Sep 26 '22 14:09 kundakinte

hey @Auxia ,if you aren’t too busy could you please review my code, thank you :)

kundakinte avatar Oct 08 '22 06:10 kundakinte

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!

Auxia avatar Oct 14 '22 14:10 Auxia

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

kundakinte avatar Oct 19 '22 20:10 kundakinte

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.

ivy-seed avatar Nov 07 '22 09:11 ivy-seed

Hello I’m waiting for my pull request to be reviewed If you’re free @Auxia or anybody else could you please review it

kundakinte avatar Nov 08 '22 13:11 kundakinte

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.

Auxia avatar Nov 10 '22 19:11 Auxia

Hey @Auxia , sorry, saw this late, resolved the conflicts, ready for review

kundakinte avatar Nov 13 '22 15:11 kundakinte

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.

ivy-seed avatar Nov 21 '22 06:11 ivy-seed

hello, waiting for a code review from @Auxia

kundakinte avatar Nov 21 '22 11:11 kundakinte

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.

ivy-seed avatar Nov 29 '22 06:11 ivy-seed

hello, still waiting for feedback from @Auxia

kundakinte avatar Dec 02 '22 05:12 kundakinte

hey @ogbanugot , waiting for feedback

kundakinte avatar Dec 09 '22 20:12 kundakinte

Also, the tests are not passing, you might want to fix that if you do want to contribute the current implementation you have here.

ogbanugot avatar Dec 13 '22 16:12 ogbanugot

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)

ogbanugot avatar Dec 13 '22 16:12 ogbanugot

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!

ogbanugot avatar Dec 13 '22 16:12 ogbanugot

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

kundakinte avatar Dec 13 '22 19:12 kundakinte