Skip to content

Conversation

@arrjon
Copy link
Member

@arrjon arrjon commented Sep 30, 2025

This pull request introduces a new gradient-based sampler, the Metropolis-Adjusted Langevin Algorithm (MALA), to the pypesto.sample module, and refactors the covariance regularization in the adaptive Metropolis sampler. The changes also enhance the test suite and documentation to demonstrate and validate the new functionality.

I refactored the covariance regularization to return both the Cholesky decomposition and the regularized covariance matrix, improving numerical stability. The regularization function now supports multiple attempts and safe fallback strategies. Before it could happen that adaptive MCMC just fails at some point due to an ill-conditioned proposal covariance.

@arrjon arrjon self-assigned this Sep 30, 2025
@arrjon arrjon requested a review from dilpath as a code owner September 30, 2025 20:09
@arrjon arrjon added enhancement New feature or request sampling Related to sampling labels Sep 30, 2025
@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.13483% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.36%. Comparing base (bc7d89a) to head (7cad7fd).

Files with missing lines Patch % Lines
pypesto/sample/adaptive_metropolis.py 87.87% 4 Missing ⚠️
pypesto/sample/mala.py 93.18% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1617      +/-   ##
===========================================
- Coverage    84.37%   84.36%   -0.01%     
===========================================
  Files          164      165       +1     
  Lines        14320    14395      +75     
===========================================
+ Hits         12082    12145      +63     
- Misses        2238     2250      +12     

☔ 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.

Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

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

Awesome, looks good to me, thanks :)

@arrjon arrjon enabled auto-merge October 25, 2025 16:52
@arrjon
Copy link
Member Author

arrjon commented Dec 16, 2025

@dilpath, this is ready to merge I think

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

Labels

enhancement New feature or request sampling Related to sampling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants