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

Added default impls for filldist and arraydist #264

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

torfjelde
Copy link
Member

Currently we don't support something like filldist(Dirichlet(ones(2)), 3, 4) even though there is a distribution impl available in Distributions.jl through product_distribution.

This PR adds such default impls for high-dim calls to filldist and arraydist; AD might be worse performance-wise but we should still support it.

TuringLang/Turing.jl#2190

@torfjelde
Copy link
Member Author

@yebai @devmotion should be quick merge

src/arraydist.jl Outdated Show resolved Hide resolved
src/filldist.jl Outdated Show resolved Hide resolved
@devmotion
Copy link
Member

Maybe add (non-AD?) tests?

torfjelde added a commit to TuringLang/DynamicPPL.jl that referenced this pull request Apr 15, 2024
@torfjelde
Copy link
Member Author

Ah yes good point!

@torfjelde
Copy link
Member Author

You happy with it now @devmotion ?

@devmotion
Copy link
Member

Maybe add (non-AD?) tests?

Could add some checks of the return values but probably not too relevant in this case here.

@yebai
Copy link
Member

yebai commented Apr 17, 2024

Could add some checks of the return values but probably not too relevant in this case here.

It seems the new functions are simply an alias for product_distribution constructors so they should probably be already tested in Distributions.jl

@yebai yebai merged commit e3f8a67 into master Apr 17, 2024
15 checks passed
@delete-merged-branch delete-merged-branch bot deleted the torfjelde/default-impls-for-filldist-and-array-dist branch April 17, 2024 14:27
github-merge-queue bot pushed a commit to TuringLang/DynamicPPL.jl that referenced this pull request Apr 18, 2024
* fix for linking higher dimensional `Dirichlet`

* bump patch version

* bump Bijectors compat entry

* added tests for high-dim Dirichlet

* added `reconstruct` for `ArrayLikeVariate`

* don't test functionality that relies on
TuringLang/DistributionsAD.jl#264 yet

* Update test/linking.jl

* Update test/linking.jl

* Update test/linking.jl

---------

Co-authored-by: Hong Ge <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants