Skip to content

use log-sum-exp in estimate_log_prob_resp to prevent overflow (Ref to #443) - #444

Merged
relf merged 2 commits into
rust-ml:masterfrom
schliffen:issues/refto_issue-442-log-sum-exp
May 30, 2026
Merged

use log-sum-exp in estimate_log_prob_resp to prevent overflow (Ref to #443)#444
relf merged 2 commits into
rust-ml:masterfrom
schliffen:issues/refto_issue-442-log-sum-exp

Conversation

@schliffen

Copy link
Copy Markdown
Contributor

This PR fixes #442
For more details, please refer to the PR #443

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.53%. Comparing base (60382a3) to head (238b776).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #444      +/-   ##
==========================================
- Coverage   77.56%   77.53%   -0.03%     
==========================================
  Files         106      106              
  Lines        7585     7585              
==========================================
- Hits         5883     5881       -2     
- Misses       1702     1704       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@relf
relf merged commit 7fe5c86 into rust-ml:master May 30, 2026
22 checks passed
@relf

relf commented May 30, 2026

Copy link
Copy Markdown
Member

Thanks!

@schliffen
schliffen deleted the issues/refto_issue-442-log-sum-exp branch May 30, 2026 11:40
jagan-nuvai added a commit to Nuvai/linfa that referenced this pull request Jul 14, 2026
Pulls in:
  - e69cd94 linting
  - 8167a62 fix docs action
  - 99d8afd Hamerly accelerated K-means (rust-ml#439)
  - 793a8a8 WASM feature support (rust-ml#438)
  - ad45826 remove debug trace
  - 60382a3 Wasserstein distance / Earth Mover's distance (rust-ml#440)
  - 7fe5c86 log-sum-exp overflow fix (rust-ml#444)

Adapted upstream's Hamerly code to work with our ndarray 0.17 / rand 0.9
upgrade. Key changes:
  - Added F: Weight bound where upstream used F: Float (rand 0.9 API)
  - Fixed Uniform::new() calls to .unwrap() (rand 0.9 returns Result)
  - Kept our upgraded dependency versions in Cargo.toml
  - Added upstream's KMeansAlgorithm enum and Hamerly structs
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.

Numerical overflow in linfa-clustering GMM E-step: estimate_log_prob_resp uses unstable exp-sum-ln normalization

2 participants