Skip to content

Blobs are not returned #2

Description

@mtagliazucchi

It seems that blobs are not stored in sampler.posterior().
MWE:

import numpy as np
import tempest as tp

n_dim = 10

def prior_transform(u):
    return 20 * u - 10

def log_likelihood(x):
    return -0.5 * np.sum(x**2), 10.

# Configure everything
sampler = tp.Sampler(
    prior_transform=prior_transform,
    log_likelihood=log_likelihood,
    n_dim = n_dim,
    n_particles=512,  # More particles for higher accuracy
)

# Run with checkpointing
sampler.run(n_total=2048, progress=False<)

res = sampler.posterior()
print(len(res))
samples, weights, logl, blobs = res

Output:

3
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[13], line 25
     23 res = sampler.posterior()
     24 print(len(res))
---> 25 samples, weights, logl, blobs = res
     26 logz, logz_err = sampler.evidence()

ValueError: not enough values to unpack (expected 4, got 3)

None of the elements of the tuple "res" is an array filled with 10. only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions