Skip to content

Inference center correction#19

Merged
sfarrens merged 3 commits intoCosmoStat:mainfrom
VincentB03:inference-center-correction
May 6, 2026
Merged

Inference center correction#19
sfarrens merged 3 commits intoCosmoStat:mainfrom
VincentB03:inference-center-correction

Conversation

@VincentB03
Copy link
Copy Markdown
Contributor

@VincentB03 VincentB03 commented Apr 28, 2026

Changes:

  • Removed the offset from scene.py::build_batched_model on x and y (+0.5) which would result in a discrepancy between the inferred position of the galaxy's center and the observed position

  • Added a unit test (test_centers_match) to verify that the positions of the centers of the observed and inferred galaxies are the same in test_btached_inference::TestBuildBatchedModel. This test reuses the configuration used in lvl0 and runs a short inference to verify that the centers of the observations and the centers recorded during inference are the same

  • Test workflows have been restricted to Python 3.11 (3.12 and 3.13 have been removed) due to compatibility issues with the Arviz library : """ FAILED tests/test_validation/test_extraction.py::TestExtractConvergenceDiagnostics::test_rhat_near_one - TypeError: from_dict() got an unexpected keyword argument 'posterior'
    """ This new library version can only be installed on Python 3.12 or later
    Migration guide : https://python.arviz.org/en/latest/user_guide/migration_guide.html

@sfarrens sfarrens added the bug Something isn't working label Apr 29, 2026
…d) due to compatibility issues with the ArviZ library
@sfarrens
Copy link
Copy Markdown
Member

sfarrens commented May 5, 2026

Have you tested that everything works if you change the image sizes and, importantly, change from an even number to and odd number of pixels?

@VincentB03
Copy link
Copy Markdown
Contributor Author

Have you tested that everything works if you change the image sizes and, importantly, change from an even number to and odd number of pixels?

I tried 49x49, 48x48, 25x25 and 64x64, by selecting the x_min/x_max and y_min/y_max values that allow for accurate inference each time, the results are no longer biased.

@sfarrens sfarrens merged commit ca5bf29 into CosmoStat:main May 6, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants