torch_geometric.nn.conv.XConv
- class XConv(in_channels: int, out_channels: int, dim: int, kernel_size: int, hidden_channels: Optional[int] = None, dilation: int = 1, bias: bool = True, num_workers: int = 1)[source]
Bases:
Module卷积操作应用于从“PointCNN: Convolution On X-Transformed Points”论文中的\(\mathcal{X}\)变换点。
\[\mathbf{x}^{\prime}_i = \mathrm{Conv}\left(\mathbf{K}, \gamma_{\mathbf{\Theta}}(\mathbf{P}_i - \mathbf{p}_i) \times \left( h_\mathbf{\Theta}(\mathbf{P}_i - \mathbf{p}_i) \, \Vert \, \mathbf{x}_i \right) \right),\]其中 \(\mathbf{K}\) 和 \(\mathbf{P}_i\) 分别表示可训练的滤波器和 \(\mathbf{x}_i\) 的邻近点位置。\(\gamma_{\mathbf{\Theta}}\) 和 \(h_{\mathbf{\Theta}}\) 描述了神经网络,即多层感知器(MLPs),其中 \(h_{\mathbf{\Theta}}\) 将每个点单独提升到高维空间,而 \(\gamma_{\mathbf{\Theta}}\) 基于邻域内的所有点计算 \(\mathcal{X}\)-变换矩阵。
- Parameters:
in_channels (int) – Size of each input sample.
out_channels (int) – Size of each output sample.
dim (int) – 点云的维度。
kernel_size (int) – 卷积核的大小,即包括自环在内的邻居数量。
hidden_channels (int, 可选) – 输出大小为 \(h_{\mathbf{\Theta}}\), 即 提升点的维度。如果设置为
None,将自动设置为in_channels / 4。 (默认:None)dilation (int, optional) – 扩展邻域的因子,从该因子中均匀采样
kernel_size个邻居。可以解释为经典卷积操作中的扩张率。(默认值:1)bias (bool, optional) – If set to
False, the layer will not learn an additive bias. (default:True)num_workers (int) – Number of workers to use for k-NN computation. Has no effect in case
batchis notNone, or the input lies on the GPU. (default:1)
- Shapes:
输入: 节点特征 \((|\mathcal{V}|, F_{in})\), 位置 \((|\mathcal{V}|, D)\), 批次向量 \((|\mathcal{V}|)\) (可选)
output: node features \((|\mathcal{V}|, F_{out})\)