torch_geometric.nn.conv.WLConvContinuous

class WLConvContinuous(**kwargs)[source]

Bases: MessagePassing

来自“Wasserstein Weisfeiler-Lehman Graph Kernels”论文的Weisfeiler Lehman算子。

细化是通过度缩放的平均聚合完成的,并适用于具有连续属性的节点:

\[\mathbf{x}^{\prime}_i = \frac{1}{2}\big(\mathbf{x}_i + \frac{1}{\textrm{deg}(i)} \sum_{j \in \mathcal{N}(i)} e_{j,i} \cdot \mathbf{x}_j \big)\]

where \(e_{j,i}\) denotes the edge weight from source node j to target node i (default: 1)

Parameters:

**kwargs (optional) – Additional arguments of torch_geometric.nn.conv.MessagePassing.

Shapes:
  • 输入: 节点特征 \((|\mathcal{V}|, F)\)\(((|\mathcal{V_s}|, F), (|\mathcal{V_t}|, F))\) 如果是二分图, 边索引 \((2, |\mathcal{E}|)\), 边权重 \((|\mathcal{E}|)\) (可选)

  • 输出: 节点特征 \((|\mathcal{V}|, F)\)\((|\mathcal{V}_t|, F)\) 如果是二分图

forward(x: Union[Tensor, Tuple[Tensor, Optional[Tensor]]], edge_index: Union[Tensor, SparseTensor], edge_weight: Optional[Tensor] = None, size: Optional[Tuple[int, int]] = None) Tensor[source]

运行模块的前向传播。

Return type:

Tensor

reset_parameters() None

重置模块的所有可学习参数。

Return type:

None