Skip to content

Commit

Permalink
Updated runManager.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyuon committed Jul 25, 2024
1 parent 27998ca commit 94e5dfa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/jimgw/single_event/runManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,27 +398,31 @@ def plot_diagnostic(self, path: str = "diagnostic.jpeg", **kwargs):
chains, log_prob, local_accs, global_accs, loss_vals = summary.values()
log_prob = np.array(log_prob)

plt.figure(figsize=(6, 6))
plt.figure(figsize=(10, 10))
axs = [plt.subplot(2, 2, i + 1) for i in range(4)]
plt.sca(axs[0])
plt.title("log probability")
plt.plot(log_prob.mean(0))
plt.xlabel("iteration")
plt.xlim(0, None)

plt.sca(axs[1])
plt.title("NF loss")
plt.plot(loss_vals.reshape(-1))
plt.xlabel("iteration")
plt.xlim(0, None)

plt.sca(axs[2])
plt.title("Local Acceptance")
plt.plot(local_accs.mean(0))
plt.xlabel("iteration")
plt.xlim(0, None)

plt.sca(axs[3])
plt.title("Global Acceptance")
plt.plot(global_accs.mean(0))
plt.xlabel("iteration")
plt.xlim(0, None)
plt.tight_layout()

plt.savefig(path)
Expand Down

0 comments on commit 94e5dfa

Please sign in to comment.