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

Loopy Belief inference is only implemented for a single node. #48

Open
tawheeler opened this issue Jan 5, 2017 · 5 comments
Open

Loopy Belief inference is only implemented for a single node. #48

tawheeler opened this issue Jan 5, 2017 · 5 comments

Comments

@tawheeler
Copy link
Contributor

I introduced a new inference API:

abstract InferenceMethod

"""
Infer p(query|evidence)
 - inference on a DiscreteBayesNet will always return a DataFrame factor over the evidence variables
"""
infer(im::InferenceMethod, bn::BayesNet, query::Vector{NodeName}; evidence::Assignment=Assignment())

Likelihood and exact inference work perfectly under this.
Loopy belief, however, only takes a query::NodeName, when a Vector{NodeName} would be ideal.

@tawheeler
Copy link
Contributor Author

@hamzaelsaawy - if you could address this that'd be excellent.

@tawheeler tawheeler mentioned this issue Jan 5, 2017
8 tasks
@hamzaelsaawy
Copy link
Contributor

hamzaelsaawy commented Jan 5, 2017

With regards to this and #49, I have a new Factor type, and an inference type.
I'm still testing/integrating though

I've been struggling with this; I don't think LBP supports multiple queries, since it just returns the marginal of any one node (given the evidence) by message passing, not the joint of multiple nodes. I think ...

@mykelk
Copy link
Member

mykelk commented Jan 6, 2017

If you have multiple query variables, you can turn them into a vector variable, and then proceed with the LBP algorithm.

@hamzaelsaawy hamzaelsaawy mentioned this issue Jan 7, 2017
@henripal
Copy link

agreed that LBP won't return the joint but I think that one would expect a LBP call with multiple query nodes to return the marginals for each node, which you already have after the LBP loop terminates?

@tawheeler
Copy link
Contributor Author

We could just take the factor product over all resulting marginal factors that correspond to query variables.

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

No branches or pull requests

4 participants