Error In state.copy with layered nested block model
I'm having some trouble adapting the example on edge covariates with nested block models. The example code runs fine for my graph in the non-nested case and the initial minimization runs in the nested case:
>>> state = gt.minimize_nested_blockmodel_dl(g2, deg_corr=False, layers=True, state_args=dict(ec=g2.ep.e_weight2, layers=False)) >>> state <NestedBlockState object, with base \<LayeredBlockState object with 6 blocks, 164 edge covariates, for graph <Graph object, undirected, with 66 vertices and 2145 edges at 0x1114f8cd0>, at 0x12ae51a10>, and 2 levels of sizes [(66, 6), (6, 1)] at 0x129abcad0>
However the mcmc equilibration returns:
>>> gt.mcmc_equilibrate(state, wait=10000, nbreaks=4, mcmc_args=dict(niter=10),verbose=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/graph_tool/inference/mcmc.py", line 120, in mcmc_equilibrate delta, nmoves = state.mcmc_sweep(**mcmc_args) File "/usr/local/lib/python2.7/site-packages/graph_tool/inference/nested_blockmodel.py", line 538, in mcmc_sweep return self._h_sweep(lambda s, **a: s.mcmc_sweep(**a), c=c, **kwargs) File "/usr/local/lib/python2.7/site-packages/graph_tool/inference/nested_blockmodel.py", line 462, in _h_sweep get_entropy_args(eargs)) File "/usr/local/lib/python2.7/site-packages/graph_tool/inference/blockmodel.py", line 588, in _couple_state self._state.couple_state(state._state, entropy_args) AttributeError: 'graph_tool::Layers<graph_tool::BlockState<boost::U' object has no attribute 'couple_state'
I thought this may have to do with the
base_type = LayeredBlockState parameter specified in the docs, however
minimize_nested_blockmodel_dl doesn't accept it as a kwarg so I'm not sure if this is a bug or me just failing to understand how to properly specify that the nested block state should inherit from the layered block state. Thanks very much!