Skip to content

Commit

Permalink
change to isfinite
Browse files Browse the repository at this point in the history
  • Loading branch information
zihaoxu98 committed May 27, 2024
1 parent 5e17a50 commit 957c81d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions appletree/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, backend_file_name, discard=0, thin=1):
self.posterior = backend.get_log_prob(discard=discard, thin=thin)
self.prior = backend.get_blobs(discard=discard, thin=thin)
# We drop iterations with inf and nan posterior
mask = ~np.isinf(self.posterior) & ~np.isnan(self.posterior)
mask = ~np.isfinite(self.posterior)
mask = np.all(mask, axis=1)
self.chain = self.chain[mask]
self.posterior = self.posterior[mask]
Expand All @@ -40,7 +40,7 @@ def __init__(self, backend_file_name, discard=0, thin=1):
self.flat_posterior = backend.get_log_prob(discard=discard, thin=thin, flat=True)
self.flat_prior = backend.get_blobs(discard=discard, thin=thin, flat=True)
# We drop samples with inf and nan posterior
mask = ~np.isinf(self.flat_posterior) & ~np.isnan(self.flat_posterior)
mask = ~np.isfinite(self.flat_posterior)
self.flat_chain = self.flat_chain[mask]
self.flat_posterior = self.flat_posterior[mask]
self.flat_prior = self.flat_prior[mask]
Expand Down

0 comments on commit 957c81d

Please sign in to comment.