Skip to content

Conversation

@mhidalgoaraya
Copy link
Contributor

Add Jaakkola-Jordan Lower Bound Implementation for Sigmoid Node

This PR implements the Jaakkola-Jordan lower bound approximation for the sigmoid function as described in Bishop's "Pattern Recognition and Machine Learning" (PRML).

New Sigmoid Node Implementation:

  • Added a new Sigmoid node with three interfaces: out, in, and ζ (zeta)
  • Implemented the Jaakkola-Jordan lower bound using a variational parameter ζ
  • Added corresponding average energy computation for the sigmoid node

Updated Message Passing Rules:

  • ζ (zeta) rule: Computes the optimal variational parameter as ζ = √(μ² + σ²) where μ and σ are the mean and standard deviation of the input
  • in rule: Updated to handle both Categorical and PointMass output distributions, computing weighted mean and precision using the Jaakkola-Jordan approximation
  • out rule: Computes the output categorical distribution using the logistic function with the variational parameter

Mathematical Foundation:

  • The lower bound uses: σ(x) ≥ σ(ζ) * exp((x-ζ)/2 - λ(ζ)(x²-ζ²))
  • Where λ(ζ) = (σ(ζ) - 0.5)/(2ζ) and σ(ζ) is the logistic function
  • The optimal ζ is computed as ζ = √(μ² + σ²) for maximum bound tightness

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.22%. Comparing base (be9acdc) to head (39d3242).
⚠️ Report is 58 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #529      +/-   ##
==========================================
+ Coverage   75.99%   76.22%   +0.23%     
==========================================
  Files         205      210       +5     
  Lines        6077     6163      +86     
==========================================
+ Hits         4618     4698      +80     
- Misses       1459     1465       +6     

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

@bvdmitri
Copy link
Member

I like the addition! @ismailsenoz could you also look at it?

@wouterwln wouterwln requested a review from ismailsenoz October 23, 2025 08:54
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.

Add new node implementing Jaakkola & Jordan’s lower bound on sigmoid (log-sigmoid) in Bishop PRML

2 participants