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

An example where distribution is extended #5

Open
cranmer opened this issue Mar 4, 2016 · 1 comment
Open

An example where distribution is extended #5

cranmer opened this issue Mar 4, 2016 · 1 comment

Comments

@cranmer
Copy link
Member

cranmer commented Mar 4, 2016

I assume that we can add a distribution without modifying the carl package, but I haven't checked.
If so, an example notebook with that would be nice.

@glouppe
Copy link
Contributor

glouppe commented Mar 4, 2016

Yes this is possible and quite straightforward (i really need to write documentation... !).

For the likelihood-free part (approximating ratios), the only requirement is that the object that represents the generator exposes a rvs(n_samples) method that returns an array of samples.

For implementing an actual distribution, the requirement is to implement the carl.distributions.DistributionMixin interface. And for nice interactions with the theano world, one should inherit from carl.distributions.TheanoDistribution.

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