Skip to content

[Updated] Likelihood-informed processors#410

Merged
odunbar merged 36 commits into
mainfrom
orad/likelihood-informed-proc-v2
May 8, 2026
Merged

[Updated] Likelihood-informed processors#410
odunbar merged 36 commits into
mainfrom
orad/likelihood-informed-proc-v2

Conversation

@odunbar

@odunbar odunbar commented Apr 1, 2026

Copy link
Copy Markdown
Member

Co-authored by @ArneBouillon

Purpose

Content

  • Migration of the LIS from Add likelihood-informed data processors #376 under the following simplifications/changes:
    • [change] encoder_kwargs for structure vectors now keep samples_in and samples_out in their respective distributions, and also contain the algorithm time values dt corresponding to the distributions
    • [simplification] we no longer provide the dim_criterion, only a threshold for doing dimension reduction
    • [change] the user provides iters (Vector{Int}) not alphas (Vector{FT}) to indicate which dt values they would like to use for dimension reduction. A message reports the dt of the requested iterations
    • [change] if multiple iters are requested, by default we compute the LIS for each iter, then use a trapezoidal rule to create the final subspace.
    • [simplified] Reduced the complexity of the DimReduction example
    • [change] added a shift by the data mean
    • [change] Use a more robust information measure f(k) = log(1+k)^2 and truncate based on cumsum(f(k))/sum(f(k)) > eps. Leads to cutoff eps that is not "0.99999"
  • Extended encoder_kwargs_from(eki,prior; g_final=...) to obtain all kwargs for encoding a typical problem. Additionally, we provide a convenience where the user can provide the "g" ensemble for a final evaluation of "u" in from the eki
  • Recreated the DimensionReduction example for a linear problem to assess performance

MISC

  • Refactor the boundary between public/private encode/decode functions.
    • API (to Utilities): encode_data, encode_structure_matrix, encode_with_schedule applied to encoder_schedule. NOT applicable to processors.
    • Private: _encode_data _encode_structure_matrix only applicable to exact processors etc.
    • API (to Emulators): encode_data and encode_structure_matrix (and decode counterparts) allow application to emulator in place of encoder_schedule
  • add small check for error message
  • created Docs for DimensionReduction Example #418 as I have not included a docs page for the new example.
  • One concern I have: The noise_injector in the forward map wrapper can induce instability in the MCMC algorithm, so we might consider changing the default here. (this is not for inflating the posterior, but for evaluating the likelihood when providing reduced parameters to the forward map. This may really be a symptom from the need to resample with MC over several forward map evaluations when injecting the noise)
  • Closes Counterintuitive value i of get_training_points(ekp, i) #419 Small (breaking) bugfix spotted when resolving codecov

Example DimensionReduction

We just try the DR methods (using the forward map wrapper in place of an emulator) for a linear example in 100D->100D: The following is output

┌ Info: (reduced_dim, error) of posterior mean to whitened "reference" solution,
└  when using the truncation ({for PCA}, {for LI})
5×6 DataFrame
 Row │ reference        PCA-in-out      PCA(mat)-in-out  LI-in(1:1)-out(1:1)  LI-in(1:5)-out(1:1)  truncation       
     │ Tuple…           Tuple…          Tuple…           Tuple…               Tuple…               Tuple…           
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ (100, 0.277785)  (41, 0.713683)  (55, 0.306185)   (50, 0.303924)       (32, 0.29261)        (0.995, 0.99995)
   2 │ (100, 0.319642)  (32, 0.798957)  (38, 0.320583)   (34, 0.312999)       (23, 0.339262)       (0.99, 0.9995)
   3 │ (100, 0.29158)   (23, 0.825192)  (23, 0.344845)   (21, 0.323374)       (17, 0.354786)       (0.98, 0.995)
   4 │ (100, 0.309952)  (12, 0.815737)  (11, 0.484712)   (14, 0.390514)       (12, 0.433838)       (0.95, 0.97)
   5 │ (100, 0.301116)  (7, 0.781519)   (6, 0.542278)    (9, 0.520454)        (8, 0.459082)        (0.9, 0.9)

We see that as you increase truncation, our new LI methods reduce errors comparably, or more more slowly, than PCA alone. We also see that using only PCA from EKP samples (over using the prior and obs. matrices here) lead to poor errors

@odunbar odunbar changed the title Likelikehood-informed processors [Updated] Likelikehood-informed processors Apr 1, 2026
@odunbar odunbar changed the title [Updated] Likelikehood-informed processors [Updated] Likelihood-informed processors Apr 1, 2026
@codecov

codecov Bot commented Apr 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.94949% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.41%. Comparing base (6341ca2) to head (697e3bc).

Files with missing lines Patch % Lines
src/Utilities.jl 89.62% 11 Missing ⚠️
src/Utilities/likelihood_informed.jl 97.70% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #410      +/-   ##
==========================================
+ Coverage   94.18%   94.41%   +0.23%     
==========================================
  Files          10       11       +1     
  Lines        1977     2220     +243     
==========================================
+ Hits         1862     2096     +234     
- Misses        115      124       +9     

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

@odunbar
odunbar force-pushed the orad/likelihood-informed-proc-v2 branch 4 times, most recently from ae22812 to 8c3e37c Compare April 2, 2026 22:28
odunbar added 13 commits April 30, 2026 16:10
typos

add pkgs

encoder_kwargs in nice form

remove dim criterion for now

docstring

API refinement

add example

builds encoder, but mcmc bug

examples run, bugs for dimensionality and product order resolved

noise injection reduced

add some get_encoded_dim functions

add consistency for both in-and-out dimensions for li, when using multiple distributions

runs through with output reduction, logic simplified for now
@odunbar
odunbar force-pushed the orad/likelihood-informed-proc-v2 branch from 002a511 to b5525d6 Compare April 30, 2026 23:10
@odunbar
odunbar requested a review from ArneBouillon May 5, 2026 02:08

@ArneBouillon ArneBouillon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks good and I generally like the design, so let's get this merged!

When the paper is fully finalized, I might update the code with some things I improved while fine-tuning the experiments (e.g., performance improvements)

Comment thread docs/src/data_processing.md Outdated
Comment thread src/Utilities/likelihood_informed.jl Outdated
Comment thread src/Utilities/likelihood_informed.jl Outdated
@odunbar
odunbar merged commit 29beb8b into main May 8, 2026
10 checks passed
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.

Counterintuitive value i of get_training_points(ekp, i) Add new utilities for the likelihood-informed DataProcessor

2 participants