torch_geometric.nn.conv.PointNetConv

class PointNetConv(local_nn: Optional[Callable] = None, global_nn: Optional[Callable] = None, add_self_loops: bool = True, **kwargs)[source]

Bases: MessagePassing

来自“PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation”“PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space”论文的PointNet集合层。

\[\mathbf{x}^{\prime}_i = \gamma_{\mathbf{\Theta}} \left( \max_{j \in \mathcal{N}(i) \cup \{ i \}} h_{\mathbf{\Theta}} ( \mathbf{x}_j, \mathbf{p}_j - \mathbf{p}_i) \right),\]

其中 \(\gamma_{\mathbf{\Theta}}\)\(h_{\mathbf{\Theta}}\) 表示神经网络, MLPs,并且 \(\mathbf{P} \in \mathbb{R}^{N \times D}\) 定义了每个点的位置。

Parameters:
  • local_nn (torch.nn.Module, optional) – 一个神经网络 \(h_{\mathbf{\Theta}}\),它将节点特征 x 和 相对空间坐标 pos_j - pos_i 从形状 [-1, in_channels + num_dimensions] 映射到形状 [-1, out_channels]例如,由 torch.nn.Sequential 定义。(默认值:None

  • global_nn (torch.nn.Module, optional) – 一个神经网络 \(\gamma_{\mathbf{\Theta}}\) 将形状为 [-1, out_channels] 的聚合节点特征映射到形状 [-1, final_out_channels]例如,由 torch.nn.Sequential 定义。(默认值:None

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

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

Shapes:
  • 输入: 节点特征 \((|\mathcal{V}|, F_{in})\)\(((|\mathcal{V_s}|, F_{s}), (|\mathcal{V_t}|, F_{t}))\) 如果是二分图, 位置 \((|\mathcal{V}|, 3)\)\(((|\mathcal{V_s}|, 3), (|\mathcal{V_t}|, 3))\) 如果是二分图, 边索引 \((2, |\mathcal{E}|)\)

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

forward(x: Union[Tensor, None, Tuple[Optional[Tensor], Optional[Tensor]]], pos: Union[Tensor, Tuple[Tensor, Tensor]], edge_index: Union[Tensor, SparseTensor]) Tensor[source]

运行模块的前向传播。

Return type:

Tensor

reset_parameters()[source]

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