torch_geometric.nn.conv.SimpleConv

class SimpleConv(aggr: Optional[Union[str, List[str], Aggregation]] = 'sum', combine_root: Optional[str] = None, **kwargs)[source]

Bases: MessagePassing

一个简单的消息传递操作符,执行(不可训练的)传播。

\[\mathbf{x}^{\prime}_i = \bigoplus_{j \in \mathcal{N(i)}} e_{ji} \cdot \mathbf{x}_j\]

其中 \(\bigoplus\) 定义了一个自定义的聚合方案。

Parameters:
  • aggr (str[str] 或 Aggregation, 可选) – 使用的聚合方案,例如, "add", "sum" "mean", "min", "max""mul". 此外,可以是任何 Aggregation 模块(或任何自动解析为它的字符串)。(默认: "sum")

  • combine_root (str, optional) – 指定是否或如何组合中心节点表示(可以是 "sum", "cat", "self_loop", None 之一)。(默认值:None

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

Shapes:
  • 输入: 节点特征 \((|\mathcal{V}|, F)\)\(((|\mathcal{V_s}|, F), (|\mathcal{V_t}|, *))\) 如果是二分图, 边索引 \((2, |\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