microsoft / Graphormer

Graphormer is a general-purpose deep learning backbone for molecular modeling.
MIT License
2.08k stars 334 forks source link

Argument edge_type #136

Open paridhimaheshwari2708 opened 2 years ago

paridhimaheshwari2708 commented 2 years ago

What does the argument edge_type (which is set to "multi_hop" default) do? How is the model different?

mavisguan commented 2 years ago

The argument edge_type assigns the way to calculate attention bias between every two nodes. It defaults to multi_hop, which means using the edge in the shortest path to calculate attention bias (details could be found in Graphormer's paper Do Transformers Really Perform Badly for Graph Representation?) If edge_type was assigned with other values, attention bias would use other calculation methods. You can refer to graphormer/modules/graphormer_layers.py for more details.