Skip to content

Instantly share code, notes, and snippets.

@juliensimon
Last active December 20, 2019 23:37
Show Gist options
  • Save juliensimon/54be78df11515fe1cada9fd5cc912425 to your computer and use it in GitHub Desktop.
Save juliensimon/54be78df11515fe1cada9fd5cc912425 to your computer and use it in GitHub Desktop.
DGL Part2
class GCN(nn.Module):
def __init__(self, in_feats, hidden_size, num_classes):
super(GCN, self).__init__()
self.gcn1 = GCNLayer(in_feats, hidden_size)
self.gcn2 = GCNLayer(hidden_size, num_classes)
self.softmax = nn.Softmax()
def forward(self, g, inputs):
h = self.gcn1(g, inputs)
h = torch.relu(h)
h = self.gcn2(g, h)
h = self.softmax(h)
return h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment