PPFConv
¶
PPFConv(
local_nn: Optional[Callable] = None,
global_nn: Optional[Callable] = None,
add_self_loops: bool = True,
**kwargs,
)
Bases: MessagePassing
The PPFNet operator from the "PPFNet: Global Context Aware Local Features for Robust 3D Point Matching" paper.
where \(\mathbf{d_{j,i}}\) is the distance vector between the positions of the points, and \(\mathbf{n}\) are their normals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
local_nn
|
Optional[Callable]
|
Network \(h_{\mathbf{\Theta}}\) applied to each edge, on
|
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 PPFConv
from mlx_graphs.utils import knn_graph
pos = mx.random.normal((100, 3))
normal = mx.random.normal((100, 3))
x = mx.random.normal((100, 16))
conv = PPFConv(nn.Sequential(nn.Linear(16 + 4, 32), nn.ReLU()))
>>> conv(knn_graph(pos, k=8), x, pos, normal).shape
(100, 32)
Methods:
| Name | Description |
|---|---|
__call__ |
Computes the forward pass of PPFConv. |
Source code in mlx_graphs/nn/conv/ppf_conv.py
__call__
¶
Computes the forward pass of PPFConv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge_index
|
array
|
Edges of shape |
required |
node_features
|
OptPair
|
Features of the points, a |
required |
pos
|
Pair
|
Positions of the points, of shape |
required |
normal
|
Pair
|
Normals of the points, of shape |
required |
Returns:
| Type | Description |
|---|---|
array
|
The features of the destination points. |
Source code in mlx_graphs/nn/conv/ppf_conv.py
from mlx_graphs.nn import PPFConv · mlx_graphs/nn/conv/ppf_conv.py