Admin message

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

Please check if the current git version also has the same problem. An easy way to do this is to use google colab!

For questions about how to compile, install or use the library, please use instead the web forum at https://forum.skewed.de/c/graph-tool.


(If unsure, use the forum first.)


IMPORTANT: When opening new issues, please fill out the required information listed in the issue template!

"learn()" takes the "state" parameter twice

The "learn()" function in "graph_tool.inference.blockmodel_em" takes the state parameter both implicitly and explicitly. This makes it impossible to run "em_infer()" with "learn_first = True".

Example:

g = collection.data["polbooks"]
state = EMBlockState(g, B=3)
delta, niter = em_infer(state, learn_first = True)

Output:

TypeError                                 Traceback (most recent call last)
<ipython-input-393-b787977162fc> in <module>()
      1 g = collection.data["polbooks"]
      2 state = EMBlockState(g, B=3)
----> 3 delta, niter = em_infer(state, learn_first = True)

/usr/lib/python3.6/site-packages/graph_tool/inference/blockmodel_em.py in em_infer(state, max_iter, max_e_iter, epsilon, learn_first, verbose)
    282 
    283     if learn_first:
--> 284         state.learn(state, epsilon)
    285 
    286     niter = 0

TypeError: learn() takes from 1 to 2 positional arguments but 3 were given
Assignee Loading
Time tracking Loading