Unverified Commit bda6a816 authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files
parent fa5ff2fc
...@@ -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.Theta1 = nn.Linear(in_size, hidden_size) self.W1 = nn.Linear(in_size, hidden_size)
self.Theta2 = nn.Linear(hidden_size, out_size) self.W2 = 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.Theta1(X) X = A_norm @ self.W1(X)
X = F.relu(X) X = F.relu(X)
X = A_norm @ self.Theta2(X) X = A_norm @ self.W2(X)
return X return X
......
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