Hi,
There seems to be problem with get_edges_prob for the layered SBM. Here is a
minimal example:
import graph_tool.all as gt
import numpy as np
gr=gt.generate_sbm(b=np.array([0]*500+[1]*500),probs=np.array([[10000,200],[
200,10000]]))
etype=gr.new_edge_property('int')
gr.ep.etype=etype
t=0
for e in gr.edges():
gr.ep.etype[e]=t%4
t+=1
state = gt.minimize_nested_blockmodel_dl(gr,
deg_corr=True,layers=True,state_args=dict(ec=gr.ep.etype,layers=True))
print(state.get_edges_prob(missing=[[2,32,0]],spurious=[]))
print(state.get_edges_prob(missing=[[2,32,0],[3,4,2]],spurious=[]))
print(state.get_edges_prob(missing=[[2,32,0],[3,4,2],[36,7,0]],spurious=[]))
pr=state.get_edges_prob(missing=[[2,32,0],[3,4,2]],spurious=gr.get_edges([gr
.ep.etype])[:3])
Output:
0.0
-7.883180576649465
-7.883180576649465
attachment.html (8.74 KB)