-
Notifications
You must be signed in to change notification settings - Fork 272
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hello,
I noticed that samples have value outside the support for DiscreteUniform distribution. Here is a simple reproducible example:
import jax.random
import numpyro
import numpyro.distributions as dist
from numpyro.infer import HMC, MCMC, MixedHMC
def model():
x = numpyro.sample("x", dist.DiscreteUniform(1, 2))
num_samples = 10
kernel = HMC(model, trajectory_length=1.2)
kernel = MixedHMC(kernel, num_discrete_updates=20)
mcmc = MCMC(kernel, num_warmup=1000, num_samples=num_samples, progress_bar=False)
key = jax.random.PRNGKey(0)
mcmc.run(key)
samples = mcmc.get_samples()
print(samples)Which outputs:
{'x': Array([1, 1, 0, 0, 0, 0, 0, 0, 0, 1], dtype=int32)}
I was expecting values of x to be in [1,2].
Am I using it wrongly or is it a real bug?
Thank you very much for your help.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working