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

Igamma #15717

Merged
merged 22 commits into from
May 26, 2023
Merged

Igamma #15717

merged 22 commits into from
May 26, 2023

Conversation

selvaraj-sembulingam
Copy link
Contributor

@selvaraj-sembulingam selvaraj-sembulingam commented May 20, 2023

Closes #15712

@ivy-leaves ivy-leaves added Array API Conform to the Array API Standard, created by The Consortium for Python Data API Standards Ivy API Experimental Run CI for testing API experimental/New feature or request Ivy Functional API labels May 20, 2023
Copy link
Contributor

@sherry30 sherry30 left a comment

Choose a reason for hiding this comment

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

Hi,

Sorry for the late review. Your PR looks good but can you also add this function for numpy backend as well. And if its not too difficult, can you also add it to paddle backend.

Thanks

@selvaraj-sembulingam
Copy link
Contributor Author

@sherry30, I couldn't find direct implementations of igamma in numpy and paddle.

In the case of numpy, can I use scipy.special.gammainc ?

Can you provide some guidance on the paddle as well? Do I need to implement igamma using basic paddle functions?

Thanks,
Selvaraj

Copy link
Contributor

@sherry30 sherry30 left a comment

Choose a reason for hiding this comment

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

You cannot use scipy for numpy's implementation. You'll have to implement it through numpy functions. You could get help from scipy's implementation using numpy's functions if it is available on github.
You can leave the paddle backend for now.

ivy/functional/ivy/experimental/statistical.py Outdated Show resolved Hide resolved
Copy link
Contributor

@sherry30 sherry30 left a comment

Choose a reason for hiding this comment

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

Seems like the numpy backend is failing because there are some differences in the answer with the ground truth. If you think this is because of precision error then feel free to add rtol_ or atol_ in the test function. Bu to me it seems like the problem is with the implementation, I haven't dived too deep into it. In case this is a problem with the implementation, you should try to fix it and let me know if you need help with anything.

Thanks

@selvaraj-sembulingam
Copy link
Contributor Author

@sherry30 Thanks for pointing this out. There was indeed a minor mistake. Rectified it. The test cases are passing now.

Thanks

Copy link
Contributor

@sherry30 sherry30 left a comment

Choose a reason for hiding this comment

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

Hi,

Thanks for fixing the numpy implementation.
After thinking it through, we should also add paddle paddle implementation since the tests run for this backend as well 😅. Sorry for not deciding this sooner but can you add that implementation as well. should be similar to numpy.
and feel free to ask anything if you have any questions as always.

Thanks

@selvaraj-sembulingam
Copy link
Contributor Author

@sherry30 Sure. I have implemented it for the paddle as well. But couldn't able to test it as there are a few config issues in ivy tests.

ImportError while loading conftest 'E:\Ivy\ivy\ivy_tests\test_ivy\conftest.py'.
ivy_tests\test_ivy_init_.py:1: in
from .. import config
E ImportError: cannot import name 'config' from 'ivy_tests' (E:\Ivy\ivy\ivy_tests_init_.py)

Thanks

Copy link
Contributor

@sherry30 sherry30 left a comment

Choose a reason for hiding this comment

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

Im not sure why you're getting that error, probably some environment error.
It seems to be working fine on my end and all the tests are passing.

Thanks a lot for the contribution and your hard work 😄

@sherry30 sherry30 merged commit ace246a into ivy-llc:master May 26, 2023
@selvaraj-sembulingam
Copy link
Contributor Author

Thanks @sherry30 💯 😄

@selvaraj-sembulingam selvaraj-sembulingam deleted the igamma branch May 29, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Array API Conform to the Array API Standard, created by The Consortium for Python Data API Standards Ivy API Experimental Run CI for testing API experimental/New feature or request Ivy Functional API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

igamma
3 participants