Hey!
Iβm working my way through this tutorial: An Introduction to Inference in Pyro
What I donβt understand is the following. In order to get (ππΎππππ|πππΎππ,ππΎπΊππππΎππΎππ=9.5)
we can use the pyro.condition
function with
def scale(guess):
weight = pyro.sample("weight", dist.Normal(guess, 1.0))
print(weight)
return pyro.sample("measurement", dist.Normal(weight, 0.75))
and conditioned_scale = pyro.condition(scale, data={"measurement": 9.5})
I wrote the following script:
pyro.set_rng_seed(101)
scale(0.3) # tensor(-1.0905)
pyro.set_rng_seed(101)
conditioned_scale(0.3) # tensor(-1.0905)
For both functions we get the same sample for the weight. Isnβt this tutorial saying that with conditioned_scale
weβre getting a sample from a weight distribution that is conditioned on measurement=9.5
? If so, shouldnβt the samples of the weight be different, because in the first call we donβt observe any data but in the second we condition on data?
Thanks!