Skip to content

Conversation

Kartik-Sama
Copy link
Collaborator

Addresses the issue #1450

Used Effective Sample Score (ESS) to evaluate the log_probs returned by estimated posterior. This way log_probs are being checked both for single observation and iid observations case through the test added via the parameter - iid_batch_size

Copy link

codecov bot commented Mar 20, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.73%. Comparing base (19364f0) to head (8296538).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
sbi/inference/potentials/vector_field_potential.py 70.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1508      +/-   ##
==========================================
- Coverage   86.70%   83.73%   -2.98%     
==========================================
  Files         134      134              
  Lines       11151    11168      +17     
==========================================
- Hits         9669     9352     -317     
- Misses       1482     1816     +334     
Flag Coverage Δ
unittests 83.73% <75.00%> (-2.98%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sbi/inference/posteriors/vector_field_posterior.py 71.53% <100.00%> (-7.58%) ⬇️
sbi/inference/potentials/vector_field_potential.py 74.10% <70.00%> (-13.65%) ⬇️

... and 30 files with indirect coverage changes

Copy link
Contributor

@manuelgloeckler manuelgloeckler left a comment

Choose a reason for hiding this comment

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

Thanks for implementing looks great.

Just a few changes i.e. moving the tests and using corresponding pytest fixture needs to be done.

Copy link
Contributor

@manuelgloeckler manuelgloeckler left a comment

Choose a reason for hiding this comment

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

Thanks, great effort. Looks good.

This is done, but I will block merging this for now as it will have conflicts with #1497.

@manuelgloeckler manuelgloeckler added the blocked Something is in the way of fixing this. Refer to it in the issue label Mar 21, 2025
@manuelgloeckler manuelgloeckler removed the blocked Something is in the way of fixing this. Refer to it in the issue label Sep 4, 2025
@manuelgloeckler
Copy link
Contributor

Alright this can finally be merged. Will update based on the current main and then see if everything still works.

Copilot

This comment was marked as outdated.

manuelgloeckler and others added 4 commits September 5, 2025 11:16
Multiline string

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements IID (Independent and Identically Distributed) potential evaluation for score estimators, addressing issue #1450. The implementation uses Effective Sample Score (ESS) to evaluate log_probs for both single observations and IID observations cases.

Key Changes

  • Added IID support to vector field potential evaluation by implementing multiple flows for batch processing
  • Introduced log probability computation for IID observations with proper mathematical adjustments
  • Added comprehensive test coverage for IID functionality with parameterized batch sizes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
sbi/inference/potentials/vector_field_potential.py Implements IID potential evaluation with flow rebuilding and log probability computation
sbi/inference/posteriors/vector_field_posterior.py Updates log_prob method to detect and handle IID observations
tests/linearGaussian_vector_field_test.py Adds parameterized test for IID log probability computation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@manuelgloeckler manuelgloeckler merged commit ccafca3 into sbi-dev:main Sep 5, 2025
9 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.

2 participants