- What tutorial are you running?
importance sampling (Example: importance sampling — Pyro Tutorials 1.8.4 documentation) - What version of Pyro are you using?
‘1.8.0’ - Please link or paste relevant code, and steps to reproduce.
in def observe_T(T_obs, obs_name) which is in def model(observed_data) (i.e. line 91-93):
def observe_T(T_obs, obs_name):
T_simulated = simulate(mu)
T_obs_dist = Normal(T_simulated, torch.tensor(time_measurement_sigma))
pyro.sample(obs_name, T_obs_dist, obs=T_obs)
I don’t understand what these few lines is doing.
- we already have observed_data obtained from running the simulator which is the ’ T_obs’ here, why would we want to use the ‘mu’ drawn from prior and run simulation again?
- why use ‘pyro.sample’ to sample from the newly obtained ‘T_simulated’ with ‘obs’ being the observed data from the previous run of simulation?
- the output of ‘def model’ is the ‘mu’ sampled from the prior which is totally not affected by whatever ‘def observe_T’ is doing. So why do it anyway?
- I don’t fully understand what is the purpose of ‘def model’. Its input is observations obtained from simulator but its output is the parameter sampled from prior. what is the point of it?