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

[feature request] Add the Hypergeometric distribution? #3315

Open
austinv11 opened this issue Jan 25, 2024 · 2 comments
Open

[feature request] Add the Hypergeometric distribution? #3315

austinv11 opened this issue Jan 25, 2024 · 2 comments

Comments

@austinv11
Copy link
Contributor

Issue Description

In my work I need to develop a generative model that makes use of the Hypergeometric distribution. I believe torch.multinomial without replacement is equivalent? But it is of course, incompatible with pyro.sample statements.

Suggestions for alternative distributions would also be appreciated.

Thanks for your consideration!

@martinjankowiak
Copy link
Collaborator

torch.multinomial provides a sampler. a full-fledged distribution also requires a log_prob. however afaik evaluating the hypergeometric function involves nasty special functions that aren't available in pytorch

possibly relevant links:
https://github.com/google-deepmind/torch-cephes
pytorch/pytorch#76324
pytorch/pytorch#3877
pytorch/pytorch#36036

@austinv11
Copy link
Contributor Author

Ah, that's unfortunate. Thanks for the info! Feel free to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants