torch_geometric.transforms.FeaturePropagation
- class FeaturePropagation(missing_mask: Tensor, num_iterations: int = 40)[source]
Bases:
BaseTransform来自“关于特征传播在缺失节点特征的图学习中的不合理有效性”论文的特征传播算子 (功能名称:
feature_propagation)。\[ \begin{align}\begin{aligned}\mathbf{X}^{(0)} &= (1 - \mathbf{M}) \cdot \mathbf{X}\\\mathbf{X}^{(\ell + 1)} &= \mathbf{X}^{(0)} + \mathbf{M} \cdot (\mathbf{D}^{-1/2} \mathbf{A} \mathbf{D}^{-1/2} \mathbf{X}^{(\ell)})\end{aligned}\end{align} \]其中缺失的节点特征通过已知特征通过传播推断。
from torch_geometric.transforms import FeaturePropagation transform = FeaturePropagation(missing_mask=torch.isnan(data.x)) data = transform(data)
- Parameters:
missing_mask (torch.Tensor) – 缺失矩阵 \(\mathbf{M} \in {\{ 0, 1 \}}^{N\times F}\) 表示缺失的节点特征。
num_iterations (int, optional) – 传播次数。 (默认值:
40)