Skip to content
Snippets Groups Projects
Commit a220e44c authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Fix more small bugs

parent e8622dba
No related branches found
No related tags found
1 merge request!842Add a mean-log-likelihood method to improve the ACT estimation
Pipeline #173047 passed
This commit is part of merge request !842. Comments created here will be created in the context of that merge request.
......@@ -369,7 +369,7 @@ class Ptemcee(MCMCSampler):
return pos0
def setup_sampler(self):
""" Either initialize the sampelr or read in the resume file """
""" Either initialize the sampler or read in the resume file """
import ptemcee
if os.path.isfile(self.resume_file) and self.resume is True:
......@@ -617,6 +617,7 @@ class Ptemcee(MCMCSampler):
self.search_parameter_keys,
self.resume_file,
self.log_likelihood_array,
self.log_posterior_array,
self.chain_array,
self.pos0,
self.beta_list,
......@@ -951,6 +952,7 @@ def checkpoint(
search_parameter_keys,
resume_file,
log_likelihood_array,
log_posterior_array,
chain_array,
pos0,
beta_list,
......@@ -984,6 +986,7 @@ def checkpoint(
Q_list=Q_list,
time_per_check=time_per_check,
log_likelihood_array=log_likelihood_array,
log_posterior_array=log_posterior_array,
chain_array=chain_array,
pos0=pos0,
)
......@@ -1070,7 +1073,7 @@ def plot_mean_log_posterior(mean_log_posterior, outdir, label):
fig, ax = plt.subplots()
idxs = np.arange(nsteps)
ax.plot(idxs, mean_log_posterior.T)
ax.set(xlabel="Iteration", ylabel=r"$\langle\log\mathcal{L}\rangle$",
ax.set(xlabel="Iteration", ylabel=r"$\langle\mathrm{log-posterior}\rangle$",
ylim=(ymin, ymax))
fig.tight_layout()
fig.savefig("{}/{}_checkpoint_meanlogposterior.png".format(outdir, label))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment