topobench.transforms.liftings.pointcloud2hypergraph package#

PointCloud2Hypergraph liftings with automated exports.

class MoGMSTLifting(min_components=None, max_components=None, random_state=None, **kwargs)#

Bases: PointCloud2HypergraphLifting

Lift a point cloud to a hypergraph.

We find a Mixture of Gaussians and then create a Minimum Spanning Tree (MST) between the means of the Gaussians.

Parameters:
min_componentsint or None, optional

The minimum number of components for the Mixture of Gaussians model. It needs to be at least 1 (default: None).

max_componentsint or None, optional

The maximum number of components for the Mixture of Gaussians model. It needs to be greater or equal than min_components (default: None).

random_stateint, optional

The random state for the Mixture of Gaussians model (default: None).

**kwargsoptional

Additional arguments for the class.

__init__(min_components=None, max_components=None, random_state=None, **kwargs)#
find_mog(data)#

Find the best number of components for a Mixture of Gaussians model.

Parameters:
datanp.ndarray

The input data to be fitted.

Returns:
tuple[np.ndarray, int, np.ndarray]

The labels of the data, the number of components and the means of the components.

lift_topology(data)#

Lift the topology of a graph to a hypergraph.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

class PointCloud2HypergraphLifting(**kwargs)#

Bases: PointCloudLifting

Abstract class for lifting pointclouds to hypergraphs.

Parameters:
**kwargsoptional

Additional arguments for the class.

__init__(**kwargs)#
class PointNetLifting(sampling_ratio, cluster_radius, **kwargs)#

Bases: PointCloud2HypergraphLifting

Lift a point cloud to a hypergraph.

This is inspired by Qi et al. “PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space” (NeurIPS 2027). This means building approximately equidistantly-spaced clusters of points via farthest point sampling and radius queries. Each of these clusters constitutes a hyperedge which is used for set abstraction.

Parameters:
sampling_ratiofloat

The sub-sampling ratio for farthest point sampling.

cluster_radiusfloat

The radius of the clusters w.r.t. the sub-sampled points.

**kwargsoptional

Additional arguments for the class.

__init__(sampling_ratio, cluster_radius, **kwargs)#
lift_topology(data)#

Lift the topology of a graph to an expander hypergraph.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

class VoronoiLifting(support_ratio, **kwargs)#

Bases: PointCloud2HypergraphLifting

Lifts pointcloud to Farthest-point Voronoi graph.

Parameters:
support_ratiofloat

Ratio of points to sample with FPS to form voronoi support set.

**kwargsoptional

Additional arguments for the class.

__init__(support_ratio, **kwargs)#
lift_topology(data)#

Lift pointcloud to voronoi graph induced by Farthest Point Sampling (FPS) support set.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

Submodules#