pyg-team/pytorch_geometric

Local multi-headed self-attention

Open

#8,972 建立於 2024年2月26日

在 GitHub 查看
 (3 留言) (1 反應) (0 負責人)Python (3,514 fork)batch import
featurehelp wanted

倉庫指標

Star
 (19,985 star)
PR 合併指標
 (平均合併 35天 1小時) (30 天內合併 14 個 PR)

描述

🚀 The feature, motivation and pitch

I am unable to find the clean implementation of local multi-headed self-attention in pytorch geometric. I found three types of multi-head attention, one TransformerConv (https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.nn.conv.TransformerConv.html#torch_geometric.nn.conv.TransformerConv). But this one calculates a linear combination of all features with different attention weights as opposed to dividing features into multiple heads and taking their linear combination: another RGATConv in the similar direction (https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.nn.conv.RGATConv.html). And finally GPSConv (https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.nn.conv.GPSConv.html) that does multi-head attention but is global.

Alternatives

I think it is nice to have the implementation of local self-attention with multiple heads where each head looks into a part of the feature dimension.

Additional context

No response

貢獻者指南