实际上在gnn里,邻节点的聚合阶段也可以直接上torch.nn.transformer,比如说看官方的例子: fromTransformerEncoder - PyTorch 1.11.0 documentation encoder_layer = nn.TransformerEncoderLayer(d_model=512, nhead=8) transformer_encoder = nn.TransformerEncoder(encoder_layer, num_layers=6) src = torch.rand(10,...
PGExplainer:来自“Parameterized Explainer for Graph Neural Network (https://arxiv.org/abs/2011.04573) ”论文的 PGExplainer 模型。 AttentionExplainer:使用基于注意力的 GNN(例如 GATConv、GATv2Conv 或 TransformerConv)产生的注意力系数作为边解释的解释器 CaptumExplainer:基于 Captum (https://captum.ai/) 的...
PGExplainer:来自“Parameterized Explainer for Graph Neural Network (https://arxiv.org/abs/2011.04573) ”论文的 PGExplainer 模型。 AttentionExplainer:使用基于注意力的 GNN(例如 GATConv、GATv2Conv 或 TransformerConv)产生的注意力系数作为边解释的解释器 CaptumExplainer:基于 Captum (https://captum.ai/) 的...
FeaStConvfrom Vermaet al.:FeaStNet: Feature-Steered Graph Convolutions for 3D Shape Analysis(CVPR 2018) PointTransformerConvfrom Zhaoet al.:Point Transformer(2020) HypergraphConvfrom Baiet al.:Hypergraph Convolution and Hypergraph Attention(CoRR 2019) ...
🐛 Bug It seems that the torch_geometric.nn.TransformerConv layer will give an output which is of size out_channels * heads by default rather than just out_channels. Though this only happens when concat=True, it's a bit awkward to chain m...
🐛 Describe the bug I try to train a GNN network based on Transformer_Conv. It worked well on GPU RTX 3090 but failed on GPU RTX 4090. I also tested other GNN Convs like GCNConv or GATConv, GCNConv performed well but GATConv not. It seems...
Added anexampleofnn.pool.MemPooling(thanks to @wsad1) Added areturn_attention_weightsargument fornn.conv.TransformerConv(thanks to @wsad1) Batch support forutils.homophily(thanks to @wsad1) Added abatch_sizeargument toutils.to_dense_batch(thanks to @jimmiebtlr) ...
TransformerConvfrom Shiet al.:Masked Label Prediction: Unified Message Passing Model for Semi-Supervised Classification(CoRR 2020) [Example] SAGEConvfrom Hamiltonet al.:Inductive Representation Learning on Large Graphs(NIPS 2017) [Example1,Example2,Example3,Example4] ...
HGTConv from Hu et al.: Heterogeneous Graph Transformer (https://github.com/pyg-team/pytorch_geometric/blob/master/examples/hetero/hgt_dblp.pyxamples/hetero/hgt_dblp.py)] HEATConv from Mo et al.: Heterogeneous Edge-Enhanced Graph Attention Network For Multi-Agent Trajectory Prediction (CoRR 2021...
import torch.nn.functional as F class GCN(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = GCNConv(dataset.num_node_features, 16) self.conv2 = GCNConv(16, dataset.num_classes) def forward(self, data): ...