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
bda6a816
Unverified
Commit
bda6a816
authored
Dec 28, 2022
by
Hongzhi (Steve), Chen
Committed by
GitHub
Dec 28, 2022
Browse files
rename (#5058)
Co-authored-by:
Steve
<
ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal
>
parent
fa5ff2fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
examples/sparse/gcn.py
examples/sparse/gcn.py
+4
-4
No files found.
examples/sparse/gcn.py
View file @
bda6a816
...
@@ -16,17 +16,17 @@ class GCN(nn.Module):
...
@@ -16,17 +16,17 @@ class GCN(nn.Module):
super
().
__init__
()
super
().
__init__
()
# Two-layer GCN.
# Two-layer GCN.
self
.
Theta
1
=
nn
.
Linear
(
in_size
,
hidden_size
)
self
.
W
1
=
nn
.
Linear
(
in_size
,
hidden_size
)
self
.
Theta
2
=
nn
.
Linear
(
hidden_size
,
out_size
)
self
.
W
2
=
nn
.
Linear
(
hidden_size
,
out_size
)
############################################################################
############################################################################
# (HIGHLIGHT) Take the advantage of DGL sparse APIs to implement the GCN
# (HIGHLIGHT) Take the advantage of DGL sparse APIs to implement the GCN
# forward process.
# forward process.
############################################################################
############################################################################
def
forward
(
self
,
A_norm
,
X
):
def
forward
(
self
,
A_norm
,
X
):
X
=
A_norm
@
self
.
Theta
1
(
X
)
X
=
A_norm
@
self
.
W
1
(
X
)
X
=
F
.
relu
(
X
)
X
=
F
.
relu
(
X
)
X
=
A_norm
@
self
.
Theta
2
(
X
)
X
=
A_norm
@
self
.
W
2
(
X
)
return
X
return
X
...
...
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