Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Inference not finishing for bigger graph #13

Open
ferencbartok opened this issue Apr 12, 2024 · 0 comments
Open

Inference not finishing for bigger graph #13

ferencbartok opened this issue Apr 12, 2024 · 0 comments

Comments

@ferencbartok
Copy link

ferencbartok commented Apr 12, 2024

I find this library very easy to use, good documentation and code, I could set it up in 15 mins, compared to pomegranate, pgmpy, pymc - which took longer.

For my simple test Bayesian network, the test has passed, and everything is perfect. But when I test for a real-world network join_tree = InferenceController.apply(model) just runs "forever".
What are the limitations of this? The graph consists of 226 nodes and 344 edges. Most nodes have 2 states (0,1), but a few have 3-4 or max 5 states. Is this graph too big for this algorithm or am I doing something wrong?

My testcode:

def create_model(nodes: list[Node]):
    model = Bbn()
    for node in nodes:
        bbn_node = BbnNode(Variable(node.id, node.id, list(range(node.stateCount))), node.probabilities)
        model.add_node(bbn_node)
        if node.parentIds::
            for parent_id in node.parentIds:
                parent = model.get_node(parent_id)
                model.add_edge(Edge(parent, bbn_node, EdgeType.DIRECTED))

    join_tree = InferenceController.apply(model)
    return join_tree

(nodes are topological sorted)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant