I’m wanting to sample from a normal distribution with a mean value (loc) of 10 in my model definition. However, while debugging, I found that when I sample, it is different to instantiating the distribution and sampling from that. That is, running
numpyro.sample('mu', dist.Normal(10,0.1), sample_shape=(5,))
gives the output
DeviceArray([-0.0852356 , 1.6111875 , 0.04703999, 0.42531633, -0.08525848], dtype=float32), whereas running,
test = dist.Normal(10,0.1) test.sample(random.PRNGKey(0),sample_shape=(5,))
DeviceArray([10.0187845, 9.871666 , 9.972891 , 10.124906 , 10.024447 ], dtype=float32).
Is this the expected behaviour? Why do the values output when using
numpyro.sample not seem to be from the defined distribution?
Thank you in advance!