PointNetConv
¶
PointNetConv(
local_nn: Optional[Callable] = None,
global_nn: Optional[Callable] = None,
add_self_loops: bool = True,
**kwargs,
)
Bases: MessagePassing
The PointNet set layer from the "PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation" and "PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space" papers.
where \(\gamma_{\mathbf{\Theta}}\) (global_nn) and
\(h_{\mathbf{\Theta}}\) (local_nn) are neural networks and
\(\mathbf{p}_j \in \mathbb{R}^3\) are the positions of the points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
local_nn
|
Optional[Callable]
|
Network \(h_{\mathbf{\Theta}}\) applied to each edge, on
the concatenation |
None
|
global_nn
|
Optional[Callable]
|
Network \(\gamma_{\mathbf{\Theta}}\) applied to the
aggregated features. Default: |
None
|
add_self_loops
|
bool
|
If |
True
|
**kwargs
|
Arguments of |
{}
|
Example:
import mlx.core as mx
import mlx.nn as nn
from mlx_graphs.nn import PointNetConv
from mlx_graphs.utils import knn_graph
pos = mx.random.normal((100, 3))
x = mx.random.normal((100, 16))
edge_index = knn_graph(pos, k=8)
local_nn = nn.Sequential(nn.Linear(16 + 3, 32), nn.ReLU(), nn.Linear(32, 32))
conv = PointNetConv(local_nn)
>>> conv(edge_index, x, pos).shape
(100, 32)
Methods:
| Name | Description |
|---|---|
__call__ |
Computes the forward pass of PointNetConv. |
Source code in mlx_graphs/nn/conv/point_conv.py
__call__
¶
Computes the forward pass of PointNetConv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge_index
|
array
|
Edges of shape |
required |
node_features
|
OptPair
|
Features of the points, of shape |
required |
pos
|
Pair
|
Positions of the points, of shape |
required |
Returns:
| Type | Description |
|---|---|
array
|
The features of the destination points. |
Source code in mlx_graphs/nn/conv/point_conv.py
from mlx_graphs.nn import PointNetConv · mlx_graphs/nn/conv/point_conv.py