Skip to content

Conversation

@han-ol
Copy link
Collaborator

@han-ol han-ol commented May 9, 2025

I believe the Jacobian computation of standardize should have reversed sign.

y = (x - mu) / sigma
log p(y) = log p(x) - log(sigma)

Calling the adapter in forward direction should substract log(sigma), while inverse direction should add log(sigma).

Current implementation is switched. The PR fixes that.

BTW: It's really nice that Jacobian tracking adapter exists now in BF, thanks so much!

y = (x - mu) / sigma
log p(y) = log p(x) - log(sigma)
@han-ol han-ol added the fix Pull request that fixes a bug label May 9, 2025
@codecov
Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
bayesflow/adapters/transforms/standardize.py 97.67% <100.00%> (ø)

Copy link
Member

@Kucharssim Kucharssim left a comment

Choose a reason for hiding this comment

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

Oops, you are right. Thanks for the fix!

@paul-buerkner
Copy link
Contributor

paul-buerkner commented May 9, 2025 via email

@han-ol han-ol merged commit 0ed0e88 into bayesflow-org:dev May 9, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull request that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants