Skip to content

NUTS got stuck when sampling standard normal distribution #538

@chaozg

Description

@chaozg

Description

NUTS got stuck when sampling a standard normal distribution.

"this is very good diagnosis. I am not sure what is the issue, it seems stuck where we have high PDF (around zero)" -- from @amal-ghamdi

Example to reproduce

import cuqi
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(0)

gaussian = cuqi.distribution.Gaussian(np.array([0.0]), np.array([1.0]))
sampler = cuqi.experimental.mcmc.NUTS(gaussian, initial_point=np.array([0.1]))
sampler.warmup(10000)
sampler.sample(10000)
samples = sampler.get_samples()
samples.plot_trace()

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions