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

Function normalize_undigraph

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

Source from the content-addressed store, hash-verified

154
155
156def normalize_undigraph(A):
157 Dl = np.sum(A, 0)
158 num_node = A.shape[0]
159 Dn = np.zeros((num_node, num_node))
160 for i in range(num_node):
161 if Dl[i] > 0:
162 Dn[i, i] = Dl[i]**(-0.5)
163 DAD = np.dot(np.dot(Dn, A), Dn)
164 return DAD
165
166
167

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected