Skip to content

Skip unit normalization for near-zero vectors to avoid NaN - #74

Merged
aseyboldt merged 1 commit into
pymc-devs:mainfrom
jessegrabowski:mclmc-grad-floor
Aug 3, 2026
Merged

aseyboldt merged 1 commit into
pymc-devs:mainfrom
jessegrabowski:mclmc-grad-floor

Conversation

@jessegrabowski

Copy link
Copy Markdown
Member

Small safety guard for MCLMC I stole from the blackjax implementation. Near the mode, the unit normalization factor of the momentum vector can be close to zero. Blackjax adds a small epsilon and passes through degenerate values without normalization here and here; ultimately consumed by the integrator here.

@jessegrabowski jessegrabowski added the enhancement New feature or request label Jul 28, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.88%. Comparing base (394c629) to head (27c0e62).
⚠️ Report is 155 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (394c629) and HEAD (27c0e62). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (394c629) HEAD (27c0e62)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #74       +/-   ##
===========================================
- Coverage   83.77%   66.88%   -16.89%     
===========================================
  Files           8       34       +26     
  Lines        1923     9413     +7490     
===========================================
+ Hits         1611     6296     +4685     
- Misses        312     3117     +2805     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aseyboldt
aseyboldt merged commit d9d9644 into pymc-devs:main Aug 3, 2026
4 checks passed
@aseyboldt

Copy link
Copy Markdown
Member

Looks good, thanks!

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants