None in factor_to_maxclique
jluttine opened this issue · comments
Here's a simple example of a bug:
>>> import junctiontree as jt
>>> jt.create_junction_tree([ ["x"], ["x", "y"], ["x", "y"] ], {"x":2, "y":3})
JunctionTree(tree=[0], separators=[], clique_tree=CliqueGraph(maxcliques=[['x', 'y']], factor_to_maxclique=[None, None, 0], factor_graph=FactorGraph(factors=[['x'], ['x', 'y'], ['x', 'y']], sizes={'x': 2, 'y': 3})))
The problem is None
s in factor_to_maxclique
.
@dar326 Any ideas?
The issue happens during triangulation:
>>> fg = jt.FactorGraph([ ["x", "y"], ["x", "y"] ], {"x":2, "y":3})
>>> fg
FactorGraph(factors=[['x', 'y'], ['x', 'y']], sizes={'x': 2, 'y': 3})
>>> fg.triangulate()
CliqueGraph(maxcliques=[['x', 'y']], factor_to_maxclique=[None, 0], factor_graph=FactorGraph(factors=[['x', 'y'], ['x', 'y']], sizes={'x': 2, 'y': 3}))
Or in lower level:
>>> from junctiontree import beliefpropagation as bp
>>> bp.find_triangulation([ ["x", "y"], ["x", "y"] ], {"x":2, "y":3})
([], [['y', 'x'], ['y']], [['x', 'y']], [None, 0])
I have some time today so I’ll look into this and try to fix it quickly
…On Fri, Sep 14, 2018 at 1:58 PM Jaakko Luttinen ***@***.***> wrote:
Or in lower level:
>>> from junctiontree import beliefpropagation as bp
>>> bp.find_triangulation([ ["x", "y"], ["x", "y"] ], {"x":2, "y":3})
([], [['y', 'x'], ['y']], [['x', 'y']], [None, 0])
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AR0ogH67nXxA-2vKHZbGUP53pu65GYfxks5ua-5igaJpZM4WpsVW>
.
The code did not support duplicate factors in the factor graph used to construct the junction tree. The changes implemented in #3 fixed this issue so that this library supports factor graphs with duplicate factors.
Closing this ticket.
Nice, thanks!