Comments (6)
In the docstring for inference.sum_product it says that the algorithm only works for tree graphs. The algorithm for non-trees is different - try inference.loopy_belief_propagation
. However be warned that this algorithm is non-exact, all message-passing algorithms on a loopy graph are non exact!
from fglib.
Thanks for the response.
I tried inference.loopy_belief_propagation
. However, I've run into another error.
Is model
what I think it is? An arbitrary structured graph?
# Perform loopy-belief propagation on factor graph
# and request belief of variable node x3
belief = inference.loopy_belief_propagation(fg, 10, (x3,))
The terminal output is shown below.
Traceback (most recent call last):
File "fglib_example.py", line 39, in <module>
belief = inference.loopy_belief_propagation(fg, 10, (x3,))
File "/home/bradley/.local/lib/python3.6/site-packages/fglib/inference.py", line 165, in loopy_belief_propagation
return _schedule(model, 'spa', iterations, query_node, order)
File "/home/bradley/.local/lib/python3.6/site-packages/fglib/inference.py", line 205, in _schedule
b[n].append(n.belief(model))
File "/home/bradley/.local/lib/python3.6/site-packages/fglib/nodes.py", line 140, in belief
belief *= self.graph[n][self]['object'].get_message(n, self)
TypeError: unsupported operand type(s) for *=: 'NoneType' and 'NoneType'
from fglib.
@studentbrad did you ever resolve this? I have the same issue for loopy graph when trying to compute marginals
from fglib.
@goodyguts, for my loopy graph I tried:
score_node_list = [n for (n, attr) in M.nodes(data=True) if attr["type"] == "vn"]
belief = fg_lib.inference.loopy_belief_propagation(M,iterations=100, query_node = score_node_list)
and runs without error, but no marginals. Can you comment please thx!
from fglib.
@mercicle, I wasn't able to get this implementation of loopy belief propagation working.
Of course I appreciate the authors work, but there are other tools for doing the same loopy belief on a structured graph.
from fglib.
@mercicle, I wasn't able to get this implementation of loopy belief propagation working.
Of course I appreciate the authors work, but there are other tools for doing the same loopy belief on a structured graph
Could you please let us know what tool you finally used for the loopy BP? Thanks!
from fglib.
Related Issues (9)
- Abstract Base Class
- Error in max-product algorithm HOT 5
- Error in example of sum product HOT 1
- Gaussian Nodes returns TypeError: marginalize() got an unexpected keyword argument 'normalize' HOT 3
- Max-sum value assignment Error HOT 1
- The 'sphinx-build' command was not found. HOT 1
- does it support node potential?
- Sum-product algorithm with Gaussians in information form
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fglib.