Skip to content

Commit

Permalink
backend ereased before initializing new EMCEE object
Browse files Browse the repository at this point in the history
  • Loading branch information
sibirrer committed Sep 3, 2024
1 parent 3a5a45b commit f482350
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hierarc/Sampling/mcmc_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ def get_emcee_sampler(
"""

num_param = self.param.num_param
sampler = emcee.EnsembleSampler(
n_walkers, num_param, self.chain.likelihood, args=(), **kwargs_emcee
)
mean_start = self.param.kwargs2args(**kwargs_mean_start)
sigma_start = self.param.kwargs2args(**kwargs_sigma_start)
p0 = sampling_util.sample_ball(mean_start, sigma_start, n_walkers)
Expand All @@ -52,6 +49,9 @@ def get_emcee_sampler(
p0 = None
else:
backend.reset(n_walkers, num_param)
sampler = emcee.EnsembleSampler(
n_walkers, num_param, self.chain.likelihood, args=(), **kwargs_emcee
)
sampler.run_mcmc(p0, n_burn + n_run, progress=True)

return sampler
Expand Down

0 comments on commit f482350

Please sign in to comment.