torch_geometric.nn.conv.PDNConv

class PDNConv(in_channels: int, out_channels: int, edge_dim: int, hidden_channels: int, add_self_loops: bool = True, normalize: bool = True, bias: bool = True, **kwargs)[source]

Bases: MessagePassing

来自“Pathfinder Discovery Networks for Neural Message Passing”论文的路径发现网络卷积算子。

\[\mathbf{x}^{\prime}_i = \sum_{j \in \mathcal{N}(i) \cup \{i\}}f_{\Theta}(\textbf{e}_{(j,i)}) \cdot f_{\Omega}(\mathbf{x}_{j})\]

其中 \(z_{i,j}\) 表示从源节点 \(j\) 到目标节点 \(i\) 的边特征向量,\(\mathbf{x}_{j}\) 表示节点 \(j\) 的节点特征向量。

Parameters:
  • in_channels (int) – Size of each input sample.

  • out_channels (int) – Size of each output sample.

  • edge_dim (int) – Edge feature dimensionality.

  • hidden_channels (int) – 隐藏的边缘特征维度。

  • add_self_loops (bool, optional) – If set to False, will not add self-loops to the input graph. (default: True)

  • normalize (bool, 可选) – 是否添加自环并动态计算对称归一化系数。 (默认: True)

  • 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}|, D)\) (可选)

  • output: node features \((|\mathcal{V}|, F_{out})\)

forward(x: Tensor, edge_index: Union[Tensor, SparseTensor], edge_attr: Optional[Tensor] = None) Tensor[source]

运行模块的前向传播。

Return type:

Tensor

reset_parameters()[source]

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