On 22.03.2017 13:58, P-M wrote:
Hello,
I am experiencing some problems with minimize_blockmodel_dl. In particular if I run:
for deg_corr in [True, False]: for overlap in [True, False]: # Initialize the Markov chain from the "ground state" state = gt.minimize_blockmodel_dl(g, deg_corr=deg_corr,overlap=overlap)
I get the error message: Traceback (most recent call last): File "model_class_selection.py", line 23, in <module> state = gt.minimize_blockmodel_dl(g, deg_corr=deg_corr,overlap=overlap) File "/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/minimize.py", line 298, in minimize_blockmodel_dl mcmc_multilevel_args=mcmc_multilevel_args) File "/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/minimize.py", line 100, in get_states max_state = mcmc_multilevel(max_state, B=B_max, **mcmc_multilevel_args) File "/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/mcmc.py", line 364, in mcmc_multilevel state = state.shrink(B=B_next, **shrink_args) File "/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/overlap_blockmodel.py", line 652, in shrink (bstate.get_nonempty_B(), B, self.B)) ValueError: cannot shrink state to a smaller number of groups: 15643 -> 136997 (total: 178096)
I cannot reproduce this. As you should have learned by now, we can only make any progress understanding problems like this if you provide at least some _minimial_ information, such as the version of graph-tool that is being used, as well as a complete example that shows the problem (in this case, we need the actual network used.)
If I run:
for deg_corr in [True, False]: for overlap in [True, False]: for layers in [True, False]: # Initialize the Markov chain from the "ground state" state = gt.minimize_blockmodel_dl(g, deg_corr=deg_corr,overlap=overlap,layers=layers)
I get:
Traceback (most recent call last): File "model_class_selection.py", line 20, in <module> state = gt.minimize_blockmodel_dl(g, deg_corr=deg_corr,overlap=overlap,layers=layers) File "/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/minimize.py", line 298, in minimize_blockmodel_dl mcmc_multilevel_args=mcmc_multilevel_args) File "/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/minimize.py", line 94, in get_states **dmask(state_args, ["B", "b", "deg_corr", "clabel"])) TypeError: __init__() takes at least 3 arguments (6 given)
Does anybody know what this is being caused by?
Did you read the documentation? If you want to use the layered model, you have to supply the edge covariates, i.e. state = gt.minimize_blockmodel_dl(g, deg_corr=deg_corr, overlap=overlap, layers=True, state_args=dict(ec=eprop)) Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>