Skip to content

Fix: geometric default grad - #304

Open
docxology wants to merge 3 commits into
ReactiveBayes:mainfrom
docxology:fix/geometric-default-grad
Open

docxology wants to merge 3 commits into
ReactiveBayes:mainfrom
docxology:fix/geometric-default-grad

Conversation

@docxology

Copy link
Copy Markdown
Contributor

[Verified audit fix] — branch fix/geometric-default-grad.

Commit: fix(Geometric): correct default-space gradlogpartition to -1/p

Changes

src/distributions/geometric.jl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Verification

Confirmed against main in the ReactiveBayes audit (Julia 1.12.6); sources verified read-only. See the branch diff.

docxology and others added 2 commits August 1, 2026 17:31
…iveBayes#293)

Assert the default-space gradient equals d/dp[-log p] = -1/p and matches
ForwardDiff of the default-space log-partition. Fails against the previous
1/(p^2 - p) implementation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bvdmitri

bvdmitri commented Sep 2, 2026

Copy link
Copy Markdown
Member

Confirmed. The default-space log-partition is A(p) = -log(p), so dA/dp = -1/p; the old code returned 1/(p²-p) = -1/(p(1-p)). Fix is correct. Pushed a regression test comparing against ForwardDiff of the default-space log-partition.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.06%. Comparing base (a72e447) to head (743da31).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #304      +/-   ##
==========================================
+ Coverage   83.91%   84.06%   +0.14%     
==========================================
  Files          45       45              
  Lines        4078     4078              
==========================================
+ Hits         3422     3428       +6     
+ Misses        656      650       -6     

☔ View full report in Codecov by Harness.
📢 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.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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