Open snnpzz opened 1 year ago
Hi @snnpzz ,
For the code to be adapted to the task of node classification, no readout function need to be applied. Thus, the forward()
function in the model.py file needs to be modified as follows:
def forward(self, adj, features):
x = self.mp1(adj, features)
x = self.bn1(x)
x = self.relu(self.fc1(x))
x = self.dropout(x)
x = self.fc2(x)
return F.log_softmax(x, dim=1)
Note that in the case of node classification, there is only a single adjacency matrix and a single matrix of node features which are both given as input to the forward()
function. Furthermore, the main.py file needs to be modified since no batches of graphs are fed to the model, but as mentioned above, there is a single graph and this graph is fed to the model at each epoch.
How can the code be adapted to the task of node classification?