torch_geometric.nn.conv.TAGConv
- class TAGConv(in_channels: int, out_channels: int, K: int = 3, bias: bool = True, normalize: bool = True, **kwargs)[source]
Bases:
MessagePassing拓扑自适应图卷积网络算子来自 “Topology Adaptive Graph Convolutional Networks” 论文。
\[\mathbf{X}^{\prime} = \sum_{k=0}^K \left( \mathbf{D}^{-1/2} \mathbf{A} \mathbf{D}^{-1/2} \right)^k \mathbf{X} \mathbf{W}_{k},\]其中 \(\mathbf{A}\) 表示邻接矩阵,\(D_{ii} = \sum_{j=0} A_{ij}\) 表示其对角度矩阵。邻接矩阵可以包含除
1以外的其他值,通过可选的edge_weight张量表示边的权重。- Parameters:
in_channels (int) – Size of each input sample, or
-1to derive the size from the first input(s) to the forward method.out_channels (int) – Size of each output sample.
K (int, optional) – 跳数 \(K\). (默认:
3)bias (bool, optional) – If set to
False, the layer will not learn an additive bias. (default:True)**kwargs (optional) – Additional arguments of
torch_geometric.nn.conv.MessagePassing.
- Shapes:
输入: 节点特征 \((|\mathcal{V}|, F_{in})\), 边索引 \((2, |\mathcal{E}|)\), 边权重 \((|\mathcal{E}|)\) (可选)
output: node features \((|\mathcal{V}|, F_{out})\)