Skip to content

Fix behavior of logdiffexp(jnp.inf, jnp.inf), add test that would have caught it.#2007

Merged
fehiepsi merged 1 commit intopyro-ppl:masterfrom
dylanhmorris:dhm-fix-info-logdiffexp
Mar 13, 2025
Merged

Fix behavior of logdiffexp(jnp.inf, jnp.inf), add test that would have caught it.#2007
fehiepsi merged 1 commit intopyro-ppl:masterfrom
dylanhmorris:dhm-fix-info-logdiffexp

Conversation

@dylanhmorris
Copy link
Contributor

@dylanhmorris dylanhmorris commented Mar 12, 2025

Desired output for logdiffexp(jnp.inf, jnp.inf) is jnp.nan. We were getting -jnp.inf because logdiffexp(a, a) = -jnp.inf for any a != jnp.inf, including -jnp.inf. Added:

  1. conditional to fix the issue
  2. a test of logdiffexp behavior at jnp.inf, jnp.inf that fails without these changes and passes with them.

Also fixes typo in documentation caught be codespell and clarifies an explanatory comment.

@dylanhmorris dylanhmorris changed the title Fix behavior of logdiffexp(jnp.inf, jnp.inf), add test that would have caught it. Fix behavior of logdiffexp(jnp.inf, jnp.inf), add test that would have caught it. Mar 12, 2025
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dylanhmorris!

@fehiepsi fehiepsi merged commit 0e1bdba into pyro-ppl:master Mar 13, 2025
10 checks passed
@dylanhmorris dylanhmorris deleted the dhm-fix-info-logdiffexp branch March 13, 2025 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants