Hi,
I am running a model using DiscreteHMCGibbs.
Here is a toy model with the same issue:
def test_model(args):
...
sigma = numpyro.sample('sigma', dist.HalfNormal(0.2))
with numpyro.plate("nodes", L, dim=-1):
alpha = numpyro.sample("alpha", dist.Poisson(sigma))
beta = numpyro.sample("beta", dist.HalfNormal(1))
N = numpyro.sample("N", dist.Poisson(a + b) , obs=Nobs)
return N
The issue is that the model does not recognise alpha
as a discrete latent variable and instead it outputs the following error
AssertionError: Cannot detect any discrete latent variables in the model.
If I try and run the model using only NUTS or HMC I get this error:
RuntimeError: This algorithm might only work for discrete sites with enumerate support.
But the Poisson distribution at site alpha does not have enumerate support.
So I assume it recognises the Poisson as a discrete latent variable in the model using NUTS/HMC.
I am relatively new to numpyro so apologies if the issue is something obvious, but does anyone know of any solutions?
Thanks