I have a bayesian network. How do I sample from a conditioned model? I have conditioned_model=pyro.condition(…). How to sample from this conditioned_model and get marginal distribution. Are there any examples of this?
If all of the latent variables are discrete, you can use
pyro.infer.TraceEnum_ELBO.compute_marginals for computing marginal distributions exactly and
pyro.infer.infer_discrete for sampling from the joint posterior. See the discrete enumeration tutorial for more background; this toy mixture model example may also be helpful.
Also, this linear regression example might be helpful. You can use either SVI or MCMC to sample from a model.