Closed
Description
Description of your problem
When passing reparameterize=False
to a pm.Latent
prior, the resulting variable changes its shape.
with pm.Model() as pmodel:
ls = pm.LogNormal("ls")
scaling = pm.LogNormal("scaling")
mean_func = pm.gp.mean.Zero()
cov_func = scaling**2 * pm.gp.cov.ExpQuad(input_dim=1, ls=ls)
gp = pm.gp.Latent(mean_func=mean_func, cov_func=cov_func)
x = numpy.array([1,2,3])
predA = gp.prior(
"predA",
x[:, None],
size=3,
reparameterize=True,
)
print(predA.shape.eval())
# [3]
predB = gp.prior(
"predB",
x[:, None],
size=3,
reparameterize=False,
)
print(predB.shape.eval())
# [3 3]
Versions and main components
- PyMC/PyMC3 Version:
main