Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnitz committed Aug 8, 2023
1 parent ae1138f commit 1525f95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pycbc/inference/sampler/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ def __init__(self, model, *args, nprocesses=1, use_mpi=False,

def draw_samples(self, size):
"""Draw new samples within the model priors"""
logging.info('getting from kde')
ksamples = self.kde.resample(size=size)
params = {k: ksamples[i, :] for i, k in enumerate(self.vparam)}
logging.info('checking prior')
keep = self.model.prior_distribution.contains(params)
return ksamples[:, keep]

Expand Down Expand Up @@ -228,7 +230,9 @@ def run(self):

logging.info('Drawing final samples')
ksamples = self.draw_samples(self.num_samples)
logging.info('Calculating final likelihoods')
ksamples, logp, logl, logw = self.run_samples(ksamples)
self._samples = {k: ksamples[j,:] for j, k in enumerate(self.vparam)}
self._samples['loglikelihood'] = logl
logging.info("Reweighting to equal samples")
self._samples = resample_equal(self._samples, logw)

0 comments on commit 1525f95

Please sign in to comment.