-
Notifications
You must be signed in to change notification settings - Fork 15
507 add new node implementing jaakkola jordans lower bound on sigmoid log sigmoid in bishop prml #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
I like the addition! @ismailsenoz could you also look at it? |
|
@ismailsenoz do you have time to look at it? Otherwise I ask someone else |
|
I will take a look! |
|
Thanks for the PR! Before we can merge this, we need to establish that it provides clear advantages over our existing MultinomialPolya node, which handles similar binomial/multinomial problems. Benchmarks: Please provide performance comparisons between this Jaakkola-Jordan implementation and our existing Pólya-Gamma approach Concerns about the Jaakkola-Jordan approach: Approximation vs. exactness: Pólya-Gamma augmentation provides exact posterior sampling, while the Jaakkola-Jordan bound is a variational approximation that may sacrifice accuracy Given these points, we'd need to see concrete evidence of improved performance or functionality to justify adding this alternative implementation. Looking forward to seeing the benchmarks! |
|
|
||
| struct Sigmoid end | ||
|
|
||
| @node Sigmoid Stochastic [out, in, ζ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is a logistic node then it needs to be deterministic. Currently it is stochastic but that is wrong.
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:
Sigmoidnode with three interfaces:out,in, andζ(zeta)ζUpdated Message Passing Rules:
ζ(zeta) rule: Computes the optimal variational parameter asζ = √(μ² + σ²)where μ and σ are the mean and standard deviation of the inputinrule: Updated to handle bothCategoricalandPointMassoutput distributions, computing weighted mean and precision using the Jaakkola-Jordan approximationoutrule: Computes the output categorical distribution using the logistic function with the variational parameterMathematical Foundation:
σ(x) ≥ σ(ζ) * exp((x-ζ)/2 - λ(ζ)(x²-ζ²))λ(ζ) = (σ(ζ) - 0.5)/(2ζ)andσ(ζ)is the logistic functionζis computed asζ = √(μ² + σ²)for maximum bound tightness