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

Implement Multivariate mixtures #106

Open
ricardoV94 opened this issue Jan 6, 2022 · 0 comments
Open

Implement Multivariate mixtures #106

ricardoV94 opened this issue Jan 6, 2022 · 0 comments
Labels
enhancement New feature or request graph rewriting Involves the implementation of rewrites to Aesara graphs help wanted Extra attention is needed important This label is used to indicate priority over things not given this label

Comments

@ricardoV94
Copy link
Contributor

Our mixture logprob graphs are tailored for univariate mixtures, by either relying on rv_pull_down rewrites that only work for univariate random variables or assuming there is a 1-1 mapping between the shape value variable and the shape of each random variable component, which is not the case for multivariate distributions.

rv_m = rv_pull_down(rv[m_indices])

aeppl/aeppl/mixture.py

Lines 344 to 347 in 3331081

logp_val += ifelse(
at.eq(indices[0], i),
comp_logp,
at.zeros_like(value),

aeppl/aeppl/mixture.py

Lines 317 to 320 in 3331081

original_shape = shape_tuple(comp_rvs[0])
bcast_indices = expand_indices(indices, original_shape)
logp_val = at.empty(bcast_indices[0].shape)

The meta information present in RandomVariable.[ndim_supp, ndims_params] and the logic in aesara.tensor.random.utils.broadcast_params`s should give us the tools to infer the right base log-probability shape.

This could also be aided by aesara-devs/aesara#695

@brandonwillard brandonwillard added enhancement New feature or request graph rewriting Involves the implementation of rewrites to Aesara graphs help wanted Extra attention is needed important This label is used to indicate priority over things not given this label labels Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request graph rewriting Involves the implementation of rewrites to Aesara graphs help wanted Extra attention is needed important This label is used to indicate priority over things not given this label
Projects
None yet
Development

No branches or pull requests

2 participants