"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "a1513f7c8fb5a73ead271a62773b16e64ee7c150"
Unverified Commit 2accfc5d authored by Israt Nisa's avatar Israt Nisa Committed by GitHub
Browse files

replace with pow (#4662)

parent 26dc54ec
...@@ -55,9 +55,8 @@ def gcn_norm(A): ...@@ -55,9 +55,8 @@ def gcn_norm(A):
I = identity(A.shape) # create an identity matrix I = identity(A.shape) # create an identity matrix
A_hat = A + I # add self-loop to A A_hat = A + I # add self-loop to A
D = diag(A_hat.sum(0)) # diagonal degree matrix of A_hat D = diag(A_hat.sum(0)) # diagonal degree matrix of A_hat
# FIXME DiagMatrix does not have power() method
D_hat = D D_hat = D
D_hat.val = D_hat.val**-0.5 D_hat = pow(D_hat, -0.5)
A_hat = D_hat @ A_hat @ D_hat A_hat = D_hat @ A_hat @ D_hat
return A_hat return A_hat
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment