Hi, I have a model that involves variables with projected normal and normal priors, e.g.,
def model():
q = pyro.sample("q", dist.ProjectedNormal(torch.zeros(4)))
t = pyro.sample("t", dist.Normal(torch.zeros(3), torch.ones(3)))
...
I parameterize the model using AutoReparam
and run MCMC - everything is fine!
reparam_model = AutoReparam()(model)
kernel = RandomWalkKernel(reparam_model)
mcmc = MCMC(kernel)
mcmc.run(*args, **kwargs)
samples = mcmc.get_samples()
In samples
, I only get the reparameterized variables, e.g. q_normal_decentered
and t_decenteted
, but I want to transform back to the original variables (as defined the model before reparameterization).
Is there a way to do so automatically?