Skip to content
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

BFE is Infinity when data connects to deterministic nodes #317

Open
HoangMHNguyen opened this issue May 3, 2023 · 2 comments
Open

BFE is Infinity when data connects to deterministic nodes #317

HoangMHNguyen opened this issue May 3, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@HoangMHNguyen
Copy link
Contributor

When an observation connects to a deterministic node, ReactiveMP counts its entropy but doesn't subtract it, leading to infinity value for BFE since the entropy of a PointMass variable is infinity. This problem doesn't happen to stochastic nodes.

@HoangMHNguyen HoangMHNguyen added the bug Something isn't working label May 3, 2023
@bvdmitri
Copy link
Member

bvdmitri commented May 3, 2023

That happens because the BFE procedure is divided into three steps:

  • Count entropies of all edges (including the clamped ones), this step adds a couple of infinities (from clamped PointMass) to the final value (we store them in a separate field) with the assumption that those infinities will cancel out in the second step
  • Compute factor bound free energy which includes computing an average energy term minus entropies of associated cluster. At this step we assume that the "minus entropy" will cancel out all infinities.
  • Check that all infinities have been cancelled out and if not, return Inf

For deterministic nodes the second step in the procedure differs, however. Instead of computing an average energy term minus entropies of clusters we simply compute the minus entropy of the inbound edges. This is according to the theory paper. This, however, does not account for the case when observation is connected directly to the outbound edge of the deterministic node. If that happens, the minus entropy of the inbound edges cannot not cancel out the entropy of the outbound edge and that causes problems in the third step. The assumption that all "problematic" entropies will be cancelled out does not hold anymore.

@ThijsvdLaar @ismailsenoz please discuss

What should we do in case if an outbound edge of a deterministic node is connected directly to an observation? Should it be special-cased? As far as I can recall the theory paper does not include this case.

@albertpod
Copy link
Member

@ismailsenoz @ThijsvdLaar, any thoughts on this one?

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
Status: No status
Development

No branches or pull requests

3 participants