https://pytorch-geometric.readthedocs.io/en/latest/modules/nn.html#torch_geometric.nn.conv.SAGEConv
1.torch_geometric.utils
1.1
1.2 to_dense_batch
这里的to_dense_batch 不是把X变得更稀疏了吗?
X ∈ R B × N max × F \mathbf{X} \in \mathbb{R}^{B \times N_{\max} \times F} X∈RB×Nmax×F第一维度不是比 X ∈ R ( N 1 + … + N B ) × F \mathbf{X} \in \mathbb{R}^{(N_1 + \ldots + N_B) \times F} X∈R(N1+…+NB)×F更大了
2.torch_geometric.nn
2.1 DenseSAGEConv
只适用于二值权重(0、1)矩阵,如果带权重的话要使用 torch_geometric.nn.dense.DenseGraphConv
class DenseSAGEConv(in_channels, out_channels, normalize=False, bias=True)
The adjacency tensor is broadcastable in the batch dimension, resulting in a shared adjacency matrix for the complete batch.
forward(x, adj, mask=None)
forward中的Args:
-
x x x (Tensor) -节点特征tensor
X ∈ R B × N × F \mathbf{X} \in \mathbb{R}^{B \times N \times F} X∈RB×N×F
batch-size B B B,
(maximum) number of nodes N N Nfor each graph,
feature dimension F F F. -
a d j adj adj (Tensor): Adjacency tensor : A ∈ R B × N × N \mathbf{A} \in \mathbb{R}^{B \times N \times N} A∈RB×N×N. The adjacency tensor is broadcastable in
the batch dimension, resulting in a shared adjacency matrix for
the complete batch.
可以在整个batch中共享?? -
mask (BoolTensor, optional): Mask matrix