Skip to content

Conversation

velochy
Copy link
Contributor

@velochy velochy commented May 9, 2024

Description

Replace the complex logic for area computation in TruncateNormal with a single, more numerically stable function meant for exactly that computation.

Related Issue

This is mainly code cleanup, although I did run into a few cases where it actually improves convergence.

Checklist

Type of change

  • Maintenance

📚 Documentation preview 📚: https://pymc--7305.org.readthedocs.build/en/7305/

@ricardoV94
Copy link
Member

can you add a test that checks the improved stability (and would fail before the changes)?

@velochy
Copy link
Contributor Author

velochy commented May 9, 2024

I tried. Turns out to not be easy to condense down to a simple example.
Isn't the code cleanup aspect here enough?

@ricardoV94 ricardoV94 requested a review from aseyboldt May 16, 2024 12:46
@ricardoV94 ricardoV94 changed the title Use more numerically stable function in TruncateNormal area computation Use more numerically stable function in TruncatedNormal area computation May 16, 2024
@ricardoV94 ricardoV94 merged commit fd11cf0 into pymc-devs:main May 21, 2024
@ricardoV94
Copy link
Member

Thanks @velochy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants