From 4d4510e54b3e35cca1250a36e06ce4b1d77ea125 Mon Sep 17 00:00:00 2001 From: linlin Date: Mon, 19 Oct 2020 15:27:07 +0200 Subject: [PATCH] New translations accuracy_diff_entropy.py (French) --- .../experiments/papers/PRL_2020/accuracy_diff_entropy.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lang/fr/gklearn/experiments/papers/PRL_2020/accuracy_diff_entropy.py b/lang/fr/gklearn/experiments/papers/PRL_2020/accuracy_diff_entropy.py index c25c116..0ababc3 100644 --- a/lang/fr/gklearn/experiments/papers/PRL_2020/accuracy_diff_entropy.py +++ b/lang/fr/gklearn/experiments/papers/PRL_2020/accuracy_diff_entropy.py @@ -34,6 +34,11 @@ def generate_graphs(): graphs11 = [nx.configuration_model(degrees11, create_using=nx.Graph) for i in range(half_num_graphs)] graphs12 = [nx.configuration_model(degrees12, create_using=nx.Graph) for i in range(half_num_graphs)] + for g in graphs11: + g.remove_edges_from(nx.selfloop_edges(g)) + for g in graphs12: + g.remove_edges_from(nx.selfloop_edges(g)) + # method 2: can easily generate isomorphic graphs. # graphs11 = [nx.random_regular_graph(2, num_nodes, seed=None) for i in range(half_num_graphs)] # graphs12 = [nx.random_regular_graph(10, num_nodes, seed=None) for i in range(half_num_graphs)] @@ -51,6 +56,11 @@ def generate_graphs(): # method 1: the entorpy of the two classes is not the same. graphs21 = [nx.configuration_model(degrees21, create_using=nx.Graph) for i in range(half_num_graphs)] graphs22 = [nx.configuration_model(degrees22, create_using=nx.Graph) for i in range(half_num_graphs)] + + for g in graphs21: + g.remove_edges_from(nx.selfloop_edges(g)) + for g in graphs22: + g.remove_edges_from(nx.selfloop_edges(g)) # # method 2: tooo slow, and may fail. # graphs21 = [nx.random_degree_sequence_graph(degrees21, seed=None, tries=100) for i in range(half_num_graphs)]