You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Number of samples in sample_batched does not match actual number of samples drawn #1388
The posterior object provides a sample_batched((n,), x) function in order to draw n samples for each conditional in x. The progress bar for drawing these samples states the number of samples n to draw per conditional but the actual number of samples is n * x.shape[0].
To Reproduce
Please add a minimal code example that reproduces the problem:
Name Python version and SBI version: Python 3.12 and 0.23.3
Minimal code example
The example is based on the code run in notebook 1 after the posterior was fit.
Using the example from notebook 01 to obtain a posterior on a Gaussian mixture, x.shape is [2000, 3]. Therefore, running posterior.sample_batched((10,), x) draws 20k samples but the progress bar states 10.
Thanks for raising this. I agree, it would be good to adapt the pbar to state that it is drawing N samples for each of the M x. I would disagree that it should display N*M samples because we are drawing a separate set of samples for each x.
Activity
janfb commentedon Feb 20, 2025
Thanks for raising this. I agree, it would be good to adapt the pbar to state that it is drawing
N samples for each of the M x. I would disagree that it should displayN*Msamples because we are drawing a separate set of samples for each x.janfb commentedon Mar 25, 2025
fixed with #1493