Why does it work like this? Or what am I doing wrong?
In general, to sample from the posterior distribution of a model’s sample
statements given data from pyro.condition
, you need to wrap your conditioned model in an inference algorithm like HMC or SVI.
In your particular case, note that Pyro doesn’t support conditioning on the value of a pyro.deterministic
statement, so the queries in your code will not produce meaningful results regardless of inference algorithm. See this old forum topic for previous discussion of conditioning on determinstic computations.