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

Gaussian Nodes returns TypeError: marginalize() got an unexpected keyword argument 'normalize' #4

Closed
jdmartin86 opened this issue Nov 17, 2018 · 3 comments

Comments

@jdmartin86
Copy link

Hello,

When trying the test case (test.txt) with Gaussian variables, I receive the following error

Traceback (most recent call last):
File "npbp.py", line 31, in
belief = inference.sum_product(fg, x4)
File "/home/jdmartin86/.local/lib/python3.5/site-packages/fglib/inference.py", line 63, in sum_product
return belief_propagation(graph, query_node)
File "/home/jdmartin86/.local/lib/python3.5/site-packages/fglib/inference.py", line 42, in belief_propagation
msg = u.spa(v)
File "/home/jdmartin86/.local/lib/python3.5/site-packages/fglib/nodes.py", line 271, in spa
msg = msg.marginalize(n, normalize=False)
TypeError: marginalize() got an unexpected keyword argument 'normalize'

@jdmartin86
Copy link
Author

Suggested edit on line 577 rv.py:
def marginalize(self, *dims, normalize=None):

@danbar
Copy link
Owner

danbar commented Nov 18, 2018

Thx for the feedback!
Your suggested edit looks reasonable. I will try it out and keep you updated.

@danbar
Copy link
Owner

danbar commented Nov 18, 2018

I pushed f35cbac to master, which should solve the reported issue.

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

2 participants