|
@@ -37,7 +37,7 @@ def normalize_adjacency_matrix(adj): |
|
|
|
|
|
|
|
|
def norm_adj_mat_one_node_type(adj):
|
|
|
def norm_adj_mat_one_node_type(adj):
|
|
|
adj = sp.coo_matrix(adj)
|
|
|
adj = sp.coo_matrix(adj)
|
|
|
assert adj.shape[0] == adj.shape[1]:
|
|
|
|
|
|
|
|
|
assert adj.shape[0] == adj.shape[1]
|
|
|
adj_ = adj + sp.eye(adj.shape[0])
|
|
|
adj_ = adj + sp.eye(adj.shape[0])
|
|
|
rowsum = np.array(adj_.sum(1))
|
|
|
rowsum = np.array(adj_.sum(1))
|
|
|
degree_mat_inv_sqrt = np.power(rowsum, -0.5).flatten()
|
|
|
degree_mat_inv_sqrt = np.power(rowsum, -0.5).flatten()
|
|
|