- What tutorial are you running? https://pyro.ai/examples/svi_part_i.html
- What version of Pyro are you using? 1.4.0
Going through the SVI tutorial, I wanted to turn the guide into a posterior sampler, so added sampling statements there. I realized that by adding a random pyro.sample statement in the guide can completely break inference (it doesn’t converge anymore).
def guide(data): alpha_q = pyro.param("alpha_q", torch.tensor(15.0), constraint=constraints.positive) beta_q = pyro.param("beta_q", torch.tensor(15.0), constraint=constraints.positive) pyro.sample("latent_fairness", dist.Beta(alpha_q, beta_q)) # Adding this statement breaks inference pyro.sample('foo', dist.Bernoulli(0.5))
Why is this?