torch_geometric.nn.conv.AGNNConv
- class AGNNConv(requires_grad: bool = True, add_self_loops: bool = True, **kwargs)[source]
Bases:
MessagePassing来自“基于注意力的图神经网络用于半监督学习”论文的图注意力传播层。
\[\mathbf{X}^{\prime} = \mathbf{P} \mathbf{X},\]其中传播矩阵 \(\mathbf{P}\) 的计算方式为
\[P_{i,j} = \frac{\exp( \beta \cdot \cos(\mathbf{x}_i, \mathbf{x}_j))} {\sum_{k \in \mathcal{N}(i)\cup \{ i \}} \exp( \beta \cdot \cos(\mathbf{x}_i, \mathbf{x}_k))}\]带有可训练参数 \(\beta\)。
- Parameters:
- Shapes:
输入: 节点特征 \((|\mathcal{V}|, F)\), 边索引 \((2, |\mathcal{E}|)\)
output: node features \((|\mathcal{V}|, F)\)