Dicergence in SBM inference and what does verbose tells you in multilevel_mcmc in graph-tool

21 Views Asked by At

I'm using graph-tool to infer the block allocation in a multilayer network where the second layer is a bipartite network that connects node attributes with the nodes. For any reason, when I'm doing the inference process, it seems that it diverges and is trapped in an infinite loop. This is the code:

#Setting state_arg
# We need to impose constraints on vertices and edges to keep track which layer are they in.
state_args = {}
# Vertices with different label values will not be clustered in the same group
state_args["pclabel"] = g.vp["kind"]
# Split the network in discrete layers based on edgetype. 
state_args["ec"] = g.ep["layer"]
# Independent layers version of the model (instead of 'edge covariates')
state_args["layers"] = True
# Independent layers version of the model (instead of 'edge covariates')
state_args["deg_corr"] = True

#Finding the best model
state = gt.minimize_nested_blockmodel_dl(g,
                                     state_args=dict(base_type=gt.LayeredBlockState,
                                                                      **state_args),
                                     multilevel_mcmc_args={"B_min":3,
                                                           "B_max":3,
                                                           "verbose":True})

And this is the output that I receive:

0 (-inf, 11601, 11601) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 1
1 (-inf, 4, 4) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 2
2 (-inf, 2, 2) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 3
3 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 4
4 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 5
5 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 6
6 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 7
7 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 8
8 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 9
9 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 10
10 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>
level: 10
10 (-inf, 0, 0) <NestedBlockState object, with base <LayeredBlockState object with 795 blocks, 2 layers, degree-corrected, for graph <Graph object, directed, with 795 vertices and 16634 edges, 5 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x7f9ef8c22b20>, at 0x7f9ef8c1c220>, and 11 levels of sizes [(795, 3), (3, 3), (3, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2), (2, 2)] at 0x7f9ef8c1c670>```
0

There are 0 best solutions below