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

initial gamma distribution #8

Merged
merged 10 commits into from Sep 13, 2021
Merged

Conversation

kashif
Copy link
Contributor

@kashif kashif commented Apr 18, 2021

No description provided.

@kashif
Copy link
Contributor Author

kashif commented May 26, 2021

Just wondering if these kind of PR are welcome here? If so I can also implement other distributions e.g. #21, else we can close this?

Copy link
Collaborator

@franrruiz franrruiz left a comment

Choose a reason for hiding this comment

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

Thank you! Highly appreciated contribution :)

distrax/__init__.py Show resolved Hide resolved
distrax/_src/distributions/gamma.py Show resolved Hide resolved
distrax/_src/distributions/gamma.py Outdated Show resolved Hide resolved
distrax/_src/distributions/gamma.py Show resolved Hide resolved
distrax/_src/distributions/gamma.py Outdated Show resolved Hide resolved
distrax/_src/distributions/gamma_test.py Outdated Show resolved Hide resolved
distrax/_src/distributions/gamma_test.py Outdated Show resolved Hide resolved
distrax/_src/distributions/gamma_test.py Outdated Show resolved Hide resolved
distrax/_src/distributions/gamma_test.py Show resolved Hide resolved
# pylint: disable=too-many-function-args
super().setUp(gamma.Gamma)
self.assertion_fn = lambda x, y: np.testing.assert_allclose(x, y, rtol=RTOL)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you also add tests for the properties concentration and rate? Just to check that the broadcasting is working as intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@franrruiz I am not sure what you mean here precisely?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just meant to add a test where concentration has shape (say) [4, 2] and rate is [2]. We would test that distribution.concentration coincides with the input value, and distribution.rate is [4, 2] and has been broadcasted properly. (And the same for the reverse, where the broadcasting happens on concentration). This might seem like a simple thing to test but it's helpful mainly for maintenance.

@kashif
Copy link
Contributor Author

kashif commented Jun 2, 2021

thanks @franrruiz i'll fix it up and ping you

@kashif
Copy link
Contributor Author

kashif commented Jul 20, 2021

@franrruiz I would be ready for another review... I think I have addressed all your issues... thank you so much!

Copy link
Collaborator

@franrruiz franrruiz left a comment

Choose a reason for hiding this comment

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

Thank you again! Just very minor comments.

Copy link
Collaborator

@franrruiz franrruiz left a comment

Choose a reason for hiding this comment

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

Thank you again for your contribution!

@hbq1 hbq1 added the cla: yes copybara label for automatic import label Sep 13, 2021
@kashif
Copy link
Contributor Author

kashif commented Sep 13, 2021

thanks @hbq1

@hbq1
Copy link
Collaborator

hbq1 commented Sep 13, 2021

Apologies for the delay with merging your PR, and thanks a lot for sending it in @kashif!

@copybara-service copybara-service bot merged commit e3c2f9b into google-deepmind:master Sep 13, 2021
@kashif kashif deleted the gamma branch September 13, 2021 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes copybara label for automatic import
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants