Skip to content

Commit

Permalink
enhance codes
Browse files Browse the repository at this point in the history
  • Loading branch information
zeyunlu committed Jul 8, 2024
1 parent b05684b commit b7955f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sushie/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@ def infer_sushie(
)
elbo_last = elbo_tracker[o_iter]
elbo_tracker = jnp.append(elbo_tracker, elbo_cur)
elbo_increase = not (
elbo_cur < elbo_last and (not jnp.isclose(elbo_cur, elbo_last, atol=1e-8))
elbo_increase = elbo_cur >= elbo_last or jnp.isclose(
elbo_cur, elbo_last, atol=1e-8
)

if (not elbo_increase) or jnp.isnan(elbo_cur):
if not elbo_increase:
log.logger.warning(
f"Optimization concludes after {o_iter + 1} iterations."
+ f" ELBO decreases. Final ELBO score: {elbo_cur}. Return last iteration's results."
Expand Down

0 comments on commit b7955f0

Please sign in to comment.