Skip to content
Snippets Groups Projects
Commit 0f3317b7 authored by Fize Jacques's avatar Fize Jacques
Browse files

debug

parent 3f215891
No related branches found
No related tags found
No related merge requests found
......@@ -459,7 +459,7 @@ def mixed_model_spat_sbm(nb_nodes, nb_edges, nb_com, alpha, percentage_edge_betw
G = spatial_graph(nb_nodes, nb_edges, coords="random", dist_func=dist_func)
G = add_partitions_G(G, nb_com)
nb_edges = G.size()
float_epsilon = np.finfo(float).eps
def nb_of_pair(N):
return (N * (N - 1)) / 2
......@@ -484,9 +484,9 @@ def mixed_model_spat_sbm(nb_nodes, nb_edges, nb_com, alpha, percentage_edge_betw
all_probs_sbm = np.concatenate((probs_sbm_inter, probs_sbm_intra))
all_probs_sbm /= all_probs_sbm.sum()
all_probs_spa = np.asarray([1 / dist_func(edge[0], edge[1]) for edge in all_edges])
pos = nx.get_node_attributes(G,"pos")
all_probs_spa = np.asarray([1 / (float_epsilon +dist_func(pos[edge[0]], pos[edge[1]])) for edge in all_edges])
all_probs_spa /= all_probs_spa.sum()
all_probs = alpha * (all_probs_sbm) + (1 - alpha) * all_probs_spa
final_edges = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment