On Mon, Feb 13, 2012 at 10:16:01AM -0800, young-jun wrote:
> I have a question regarding belief propagation on factor graphs that
> represent a tree Bayes net.
> I thought in that case two passes of messages up and down the tree
> should be yet libdai is iterating a (moderate) number of times.
That is because there's no automatic detection of trees built into the
BP code. Detecting the tree structure also takes time, so it's a tradeoff.
Currently the BP class does not have such functionality.
> I checked already if I accidentally introduced cycles, which doesnt
> seem to be the case, and compared to another implementation.
> But I was still wondering if this is due to generic algorithm design
> or if something might be wrong with the way I use the library?
No, this is simply because the code was designed that way and the
feature to do faster BP on trees hasn't been implemented (yet?).
> Also out of curiosity, if I wanted to run BP on a forest by removing
> the root node, can I just do that and get the same result as
> specifying separate factor graphs for each of the subtrees?
Yes, all algorithms in libDAI should support multiple components in
the factor graph.
Best, Joris