Replies: 1 comment 2 replies
-
You are missing a graph-level readout function, since you want to predict a class per graph, not per node. This works for me: class EnzymeClassifier(nn.Module):
def __init__(self, input_dim, hidden_dim, num_classes):
super(EnzymeClassifier, self).__init__()
self.conv1 = GCNConv(input_dim, hidden_dim)
self.conv2 = GCNConv(hidden_dim, hidden_dim)
self.lin = torch.nn.Linear(hidden_dim, num_classes)
def forward(self, data):
x, edge_index = data.x, data.edge_index
x = self.conv1(x, edge_index)
x = self.conv2(x, edge_index)
x = global_mean_pool(x, data.batch)
x = self.lin(x)
return x |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello every one... Respected elders and my dear young people
I am very new to pytorch-geometry and I found this discussion page and i became very happy..Hope this page will help every one.
I am trying to train a model on enzyme dataset and getting the error.Olease help me in this
I am getting the following error:
Beta Was this translation helpful? Give feedback.
All reactions