Skip to content

pointconv_blocks

PointConv message-passing convolutions and the set-abstraction blocks built on them.

Classes:

PointConv [source] ΒΆ

PointConv(
    local_nn: Module,
    weight_nn: Module,
    add_self_loops: bool = False,
    eps: float = 1e-06,
    **kwargs: Unpack[MessagePassingParams],
)

Bases: MessagePassing

PointConv message passing: a per-edge feature outer-producted with a learned continuous weight.

local_nn embeds the relative position concatenated with the neighbor feature, weight_nn turns the relative position alone into the convolution weights, and their outer product is summed over the neighbors of each point.

Parameters:

  • local_nn (Module) –

    Network embedding the relative positions and neighbor features.

  • weight_nn (Module) –

    Network mapping a relative position to the convolution weights.

  • add_self_loops (bool, default: False ) –

    Whether to add a self loop to every point before propagating.

  • eps (float, default: 1e-06 ) –

    Numerical stability constant.

  • **kwargs (Unpack[MessagePassingParams], default: {} ) –

    Extra arguments for MessagePassing.

PointConvDensity [source] ΒΆ

PointConvDensity(
    local_nn: Module,
    weight_nn: Module,
    density_nn: Module,
    add_self_loops: bool = False,
    eps: float = 1e-06,
    **kwargs: Unpack[MessagePassingParams],
)

Bases: MessagePassing

PointConv with inverse density reweighting.

Each neighbor's embedded feature is scaled by density_nn applied to its density relative to the densest neighbor, so that densely sampled regions do not dominate the sum.

Parameters:

  • local_nn (Module) –

    Network embedding the relative positions and neighbor features.

  • weight_nn (Module) –

    Network mapping a relative position to the convolution weights.

  • density_nn (Module) –

    Network mapping a relative density to a per-edge scale.

  • add_self_loops (bool, default: False ) –

    Whether to add a self loop to every point before propagating.

  • eps (float, default: 1e-06 ) –

    Numerical stability constant.

  • **kwargs (Unpack[MessagePassingParams], default: {} ) –

    Extra arguments for MessagePassing.

PointConvSetAbstraction [source] ΒΆ

PointConvSetAbstraction(
    in_channels: int,
    num_neighbors: int,
    channels: Sequence[int],
    weight_channels: Sequence[int] = (8, 8),
    expansion: int = 16,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = True,
    spatial_dim: int = 3,
    downsample: Optional[Module] = None,
)

Bases: Module

PointConv set-abstraction block: optional downsampling, \(k\)-NN grouping, and a weight-net continuous convolution.

Parameters:

  • in_channels (int) –

    Number of input feature channels.

  • num_neighbors (int) –

    Number of neighbors gathered per output point.

  • channels (Sequence[int]) –

    Per-layer channel sizes of the feature MLP.

  • weight_channels (Sequence[int], default: (8, 8) ) –

    Hidden channel sizes of the weight net applied to relative positions.

  • expansion (int, default: 16 ) –

    Channel expansion factor of the final matrix multiplication.

  • spatial_dim (int, default: 3 ) –

    Dimension of point coordinates.

  • downsample (Optional[Module], default: None ) –

    Optional module returning the sampled indices (e.g. FPS). If None, the resolution is unchanged.

PointConvDensitySetAbstraction [source] ΒΆ

PointConvDensitySetAbstraction(
    in_channels: int,
    num_neighbors: int,
    channels: Sequence[int],
    bandwidth: float = 1.0,
    weight_channels: Sequence[int] = (8, 8),
    density_channels: Sequence[int] = (16, 8),
    expansion: int = 16,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = True,
    spatial_dim: int = 3,
    downsample: Optional[Module] = None,
)

Bases: Module

PointConv set-abstraction block with inverse-density re-weighting.

Same layout as PointConvSetAbstraction, with a Gaussian kernel density estimated per point; the inverse density is transformed by a density net and re-weights the grouped features.

Parameters:

  • in_channels (int) –

    Number of input feature channels.

  • num_neighbors (int) –

    Number of neighbors gathered per output point.

  • channels (Sequence[int]) –

    Per-layer channel sizes of the feature MLP.

  • bandwidth (float, default: 1.0 ) –

    Bandwidth of the Gaussian kernel density estimate.

  • weight_channels (Sequence[int], default: (8, 8) ) –

    Hidden channel sizes of the weight net applied to relative positions.

  • density_channels (Sequence[int], default: (16, 8) ) –

    Hidden channel sizes of the density net.

  • expansion (int, default: 16 ) –

    Channel expansion factor of the final matrix multiplication.

  • spatial_dim (int, default: 3 ) –

    Dimension of point coordinates.

  • downsample (Optional[Module], default: None ) –

    Optional module returning the sampled indices (e.g. FPS). If None, the resolution is unchanged.

PointConvGlobalSetAbstraction [source] ΒΆ

PointConvGlobalSetAbstraction(
    in_channels: int,
    channels: Sequence[int],
    weight_channels: Sequence[int] = (8, 8),
    expansion: int = 16,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = True,
    aggr: PoolLike = "mean",
    spatial_dim: int = 3,
)

Bases: Module

Global PointConv set-abstraction block: one weight-net convolution over each whole sample.

Parameters:

  • in_channels (int) –

    Number of input feature channels.

  • channels (Sequence[int]) –

    Per-layer channel sizes of the feature MLP.

  • weight_channels (Sequence[int], default: (8, 8) ) –

    Hidden channel sizes of the weight net applied to relative positions.

  • expansion (int, default: 16 ) –

    Channel expansion factor of the final matrix multiplication.

  • aggr (PoolLike, default: 'mean' ) –

    Pooling used to place the single output position of each sample.

  • spatial_dim (int, default: 3 ) –

    Dimension of point coordinates.

PointConvDensityGlobalSetAbstraction [source] ΒΆ

PointConvDensityGlobalSetAbstraction(
    in_channels: int,
    channels: Sequence[int],
    bandwidth: float,
    weight_channels: Sequence[int] = (8, 8),
    density_channels: Sequence[int] = (16, 8),
    expansion: int = 16,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = True,
    pool: PoolLike = "mean",
    spatial_dim: int = 3,
)

Bases: Module

Global PointConv set-abstraction block with inverse-density re-weighting.

Parameters:

  • in_channels (int) –

    Number of input feature channels.

  • channels (Sequence[int]) –

    Per-layer channel sizes of the feature MLP.

  • bandwidth (float) –

    Bandwidth of the Gaussian kernel density estimate.

  • weight_channels (Sequence[int], default: (8, 8) ) –

    Hidden channel sizes of the weight net applied to relative positions.

  • density_channels (Sequence[int], default: (16, 8) ) –

    Hidden channel sizes of the density net.

  • expansion (int, default: 16 ) –

    Channel expansion factor of the final matrix multiplication.

  • pool (PoolLike, default: 'mean' ) –

    Pooling used to place the single output position of each sample.

  • spatial_dim (int, default: 3 ) –

    Dimension of point coordinates.