CUQI-DTU / CUQIpy

https://cuqi-dtu.github.io/CUQIpy/
Apache License 2.0
48 stars 9 forks source link

None in _acc of NUTS #532

Closed chaozg closed 1 month ago

chaozg commented 2 months ago

Description

The _acc attribute of NUTS has some extra None values. Maybe @amal-ghamdi you know the reason behind it?

Example to reproduce

import cuqi
import matplotlib.pyplot as plt
import numpy as np

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.sample(10)
sampler._acc

sampler._acc has some None values as seen here:

[None, 0, None, 0, None, 0, None, 0, None, 1, None, 1, None, 0, None, 1, None, 0, None, 0, None]

Note: we're drawing 10 samples, but there are 21 elements in _acc, including 10 extra None.