MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / normalize_digraph

Function normalize_digraph

model/block/graph_frames.py:145–153  ·  view source on GitHub ↗
(A)

Source from the content-addressed store, hash-verified

143
144
145def normalize_digraph(A):
146 Dl = np.sum(A, 0)
147 num_node = A.shape[0]
148 Dn = np.zeros((num_node, num_node))
149 for i in range(num_node):
150 if Dl[i] > 0:
151 Dn[i, i] = Dl[i]**(-1)
152 AD = np.dot(A, Dn)
153 return AD
154
155
156def normalize_undigraph(A):

Callers 1

get_adjacencyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected