tensorflow / tensorflow/probability
Is reparameterization not available for Mixture MultivariateNormalDiag using MixtureSameFamily?
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Trying to sample from a mixture multivariate normal distribution using reparameterization trick, however errors return.
import tensorflow_probability as tfp
tfd = tfp.distributions
gm = tfd.MixtureSameFamily(
mixture_distribution=tfd.Categorical(
probs=[0.3, 0.7]),
components_distribution=tfd.MultivariateNormalDiag(
loc=[[-1., 1], # component 1
[1, -1]], # component 2
scale_identity_multiplier=[.3, .6]), reparameterize=True )
sample = gm.sample()
Errors return after executing the code above:
InvalidArgumentError: `univariate_components` must have scalar event
Condition x == y did not hold.
First 1 elements of x:
[False]
First 1 elements of y:
[ True]
Is there any way to work around that?
Or is reparameterization just not available for such distribution? Thank you
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the MixtureSameFamily entry point and reproduce the reported Python example with reparameterize=True. Investigate why the MultivariateNormalDiag components trigger the univariate_components error. Done means the behavior is clarified with a supported workaround, or reparameterized sampling works for this distribution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100