On 12.05.2016 10:56, Andrea Briega wrote:
> vprop_double = g.new_vertex_property("int") # g is my network
> for i in range(0, 11772):
> vprop_double[g.vertex(i)] = 1
> for i in range(11773, 214221):
> vprop_double[g.vertex(i)] = 2
>
> state = gt.minimize_blockmodel_dl(g, pclabel=True)You should not pass "pclabel=True" here... the pclabel parameter expects the property map itself, not a Boolean value. Furthermore, you should not pass it the minimize_blockmodel_dl() function directly. Instead, you should do state = gt.minimize_blockmodel_dl(g, state_args=dict(pclabel=vprop_double)) > state.entropy(dl=True) # I am not sure this is the right way to get the > description length. It is, but if you look at the documentation, you will see that the default is "dl = True", hence calling only state.entropy() is sufficient. > But now I have some problems. First of all, minimize_blockmodel_dl > doesn't have a pclabel argument so I don't know how indicate it in the > inference algorithm. I have tried this: > > state.pclabel = vprop_double This is incorrect. Never try to modify the states directly like this. You have to do it like I described above. > And finally, in NestedBlockState objects I don't know to get > description length because entropy hasn't a "dl" argument. In these > objects entropy and dl are the same? Yes. Since the NestedBlockState corresponds to the regular BlockState plus an hierarchical prior, its full entropy corresponds always to the description length. Best, Tiago -- Tiago de Paula Peixoto <[email protected]>
signature.asc
Description: OpenPGP digital signature
_______________________________________________ graph-tool mailing list [email protected] https://lists.skewed.de/mailman/listinfo/graph-tool
