Unverified Commit 236fac4f authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

[Misc] Small fix in sparse GCN example (#5006)


Co-authored-by: default avatarSteve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
parent e01580d3
...@@ -20,8 +20,8 @@ class GCN(nn.Module): ...@@ -20,8 +20,8 @@ class GCN(nn.Module):
self.Theta2 = nn.Linear(hidden_size, out_size) self.Theta2 = nn.Linear(hidden_size, out_size)
############################################################################ ############################################################################
# (HIGHLIGHT) Take the advantage of DGL sparse APIs to implement # (HIGHLIGHT) Take the advantage of DGL sparse APIs to implement the GCN
# the GCN forward process. # forward process.
############################################################################ ############################################################################
def forward(self, A_norm, X): def forward(self, A_norm, X):
X = A_norm @ self.Theta1(X) X = A_norm @ self.Theta1(X)
...@@ -90,8 +90,8 @@ if __name__ == "__main__": ...@@ -90,8 +90,8 @@ if __name__ == "__main__":
A = create_from_coo(dst, src, shape=(N, N)) A = create_from_coo(dst, src, shape=(N, N))
############################################################################ ############################################################################
# (HIGHLIGHT) Compute the symmetrically normalized adjacency matrix # (HIGHLIGHT) Compute the symmetrically normalized adjacency matrix with
# with Sparse Matrix API # Sparse Matrix API
############################################################################ ############################################################################
I = identity(A.shape, device=dev) I = identity(A.shape, device=dev)
A_hat = A + I A_hat = A + I
......
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