snap-stanford / ogb

Benchmark datasets, data loaders, and evaluators for graph machine learning
https://ogb.stanford.edu
MIT License
1.93k stars 397 forks source link

About the implementation of JK in code of ogbg-mol #173

Closed dongZheX closed 3 years ago

dongZheX commented 3 years ago

Hello, thanks for the code. In the code https://github.com/snap-stanford/ogb/blob/master/examples/graphproppred/mol/conv.py, the implementation of JK is trying to add the first five items in h_list:

elif self.JK == "sum":
      node_representation = 0  
            for layer in range(self.num_layer):  
                 node_representation += h_list[layer]

It seems that the output of last layer does not be added to the node_representation. So, should the output of the last layer also be added to node_represetation ?

weihua916 commented 3 years ago

Thanks, good point! self.num_layer should be self.num_layer + 1 I have fixed the example.

dongZheX commented 3 years ago

Thanks.