Skip to content

leffff/graphormer-pyg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphormer-pyg

Microsoft Graphormer rewritten in PyTorch-Geometric

Modifications made

Compared to the original implementation of graphormer-pyg (commit 231fcf0), this implementation has the following modifications to improve execution speed:

  1. The in_degree and out_degree, as used in the centrality encoding layer, are pre-computed and stored in the graph data structure.
  2. The length of the shortest path between each pair of nodes is pre-computed as a tensor and passed to the spatial encoding module, in which the original for loops are replaced by tensor operations.
  3. The path between each pair of edges and the length of the path are pre-computed as tensors and passed to the edge encoding module, in which the original for loops are replaced by tensor operations.

In my tests on MoleculeNet dataset with GPU, the training speed was improved by about 50 fold.

image

About

Microsoft Graphormer (https://arxiv.org/abs/2106.05234) rewritten in Pytorch-Geometric

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published