serialized_pool
Pooling and upsampling driven by point cloud serialization codes.
Classes:
-
SerializedPool–Grid pooling driven by the serialization code: points sharing a coarser code are reduced to one.
-
SerializedUpsample–Undoes a
SerializedPoolstep: scatters the pooled features back and adds the projected skip.
SerializedPool
¶
SerializedPool(
in_channels: int,
out_channels: int,
stride: int = 2,
bias: bool = True,
act: Union[str, Callable, None] = None,
norm: Union[str, Callable, None] = None,
act_kwargs: Optional[Dict[str, Any]] = None,
norm_kwargs: Optional[Dict[str, Any]] = None,
reduce: Literal["sum", "mean", "min", "max"] = "max",
)
Bases: Module
Grid pooling driven by the serialization code: points sharing a coarser code are reduced to one.
Truncating the serialization code by \(3 \cdot \log_2(\text{stride})\) bits is exactly a grid subsampling, so no neighbor search is needed. Features are projected then reduced, positions are averaged, and the coarsened code is returned so the next stage can pool again.
Parameters:
-
in_channels(int) –Input channel count.
-
out_channels(int) –Output channel count.
-
stride(int, default:2) –Downsampling factor along each axis. Must be a power of \(2\).
-
bias(bool, default:True) –Whether the projection has a bias term.
-
act(Union[str, Callable, None], default:None) –Activation, name resolved by
create_act.Nonedisables. -
norm(Union[str, Callable, None], default:None) –Normalization, name resolved by
create_norm.Nonedisables. -
act_kwargs(Optional[Dict[str, Any]], default:None) –Extra kwargs for the activation.
-
norm_kwargs(Optional[Dict[str, Any]], default:None) –Extra kwargs for the normalization.
-
reduce(Literal['sum', 'mean', 'min', 'max'], default:'max') –Reduction applied within a cell:
"sum","mean","min", or"max".
SerializedUpsample
¶
SerializedUpsample(
in_channels: int,
skip_channels: int,
out_channels: int,
norm: Union[str, Callable, None] = None,
act: Union[str, Callable, None] = None,
act_kwargs: Optional[Dict[str, Any]] = None,
norm_kwargs: Optional[Dict[str, Any]] = None,
bias: bool = True,
)
Bases: Module
Undoes a SerializedPool step: scatters the pooled features back and adds the projected skip.
Both branches get their own projection, normalization and activation before being summed.
Parameters:
-
in_channels(int) –Channel count of the pooled features.
-
skip_channels(int) –Channel count of the skip connection.
-
out_channels(int) –Output channel count.
-
norm(Union[str, Callable, None], default:None) –Normalization, name resolved by
create_norm.Nonedisables. -
act(Union[str, Callable, None], default:None) –Activation, name resolved by
create_act.Nonedisables. -
act_kwargs(Optional[Dict[str, Any]], default:None) –Extra kwargs for the activation.
-
norm_kwargs(Optional[Dict[str, Any]], default:None) –Extra kwargs for the normalization.
-
bias(bool, default:True) –Whether the projections have a bias term.