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

Add generic stat methods to Distribution #388

Merged
merged 1 commit into from
Oct 30, 2020
Merged

Conversation

eb8680
Copy link
Member

@eb8680 eb8680 commented Oct 29, 2020

Addresses #386

This PR adds generic methods mean, variance and entropy to funsor.distribution.Distribution that invoke the corresponding methods on the backend distributions. It also refactors a test utility to use these directly.

Tested:

  • Exercised by existing sampler tests in test_distributions.py thanks to the refactor of _get_stat_diff

@fritzo fritzo merged commit 94d4251 into master Oct 30, 2020
@fritzo fritzo deleted the distribution-stats branch October 30, 2020 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants