Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
2accfc5d
Unverified
Commit
2accfc5d
authored
Sep 29, 2022
by
Israt Nisa
Committed by
GitHub
Sep 29, 2022
Browse files
replace with pow (#4662)
parent
26dc54ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
examples/pytorch/mock_sparse/gcn/train.py
examples/pytorch/mock_sparse/gcn/train.py
+1
-2
No files found.
examples/pytorch/mock_sparse/gcn/train.py
View file @
2accfc5d
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment