Hi everyone!
When I use Minibatch together with Censored, I get a warning about the RNG having multiple clients. I think this is a result of the observed variable being a minibatched object. From reading other posts here, it sounds like this could cause some issues with sampling the prior and posterior predictives. But I don’t have a good enough grasp yet of what is going on internally here to know if this is ok to ignore.
Here is some minimal code that produces the warning:
y = X * 2
X_mb, y_mb = pm.Minibatch(X, y, batch_size=100)
with pm.Model() as model:
beta = pm.Normal('b', mu=0, sigma=1)
mu = beta * X_mb
y_uncensored = pm.Normal.dist(mu=mu, sigma=1)
y_obs = pm.Censored('y_obs', y_uncensored, lower=0, upper = None, observed=y_mb)
pm.fit()
And this is the warning:
UserWarning: RNG Variable RandomGeneratorSharedVariable(<Generator(PCG64) at 0x16114C9E0>) has multiple clients. This is likely an inconsistent random graph.
Here are is relevant version info from conda list:
pymc 5.15.1 hd8ed1ab_1 conda-forge
pymc-base 5.15.1 pyhd8ed1ab_1 conda-forge
pytensor 2.22.1 py312hb2f6674_0 conda-forge
pytensor-base 2.22.1 py312hf1ba2cd_0 conda-forge
python 3.12.4 h37a9e06_0_cpython conda-forge