- ott.geometry.segment.segment_point_cloud(x, a=None, num_segments=None, max_measure_size=None, segment_ids=None, indices_are_sorted=False, num_per_segment=None, padding_vector=None)[source]#
Segment and pad as needed the entries of a point cloud.
There are two interfaces:
segment_ids, and optionally
indices_are_sortedto describe for each data point in the matrix to which segment it belongs to.
num_per_segmentwhich describes contiguous segments.
If using the first interface,
num_segmentsis required for jitting. Assumes
range(0, num_segments)are the segment ids.
In both cases, jitting requires defining a
max_measure_size, the upper bound on the maximal size of measures, which will be used for padding.
Array) – Array of input points, of shape
[num_x, ndim]. Multiple segments are held in this single array.
Array]) – Array of shape
[num_x,]containing the weights (within each measure) of all the points.
int]) – Number of segments. Required for jitting. If None and using the second interface, it will be computed as
int]) – Overall size of padding. Required for jitting. If None and using the second interface, it will be computed as
Array]) – 1st interface The segment ids for which each row of
xbelongs. This is a similar interface to
bool) – 1st interface Whether
...]]) – 2nd interface Number of points in each segment. For example, [100, 20, 30] would imply that
xis segmented into 3 arrays of length , , and , respectively. Must be a tuple and not a
jax.numpy.ndarrayto allow jitting. This means changes in
num_per_segmentwill re-trigger compilation.
Array]) – vector to be used to pad point cloud matrices. Most likely to be zero, but can be adjusted to be other values to avoid errors or over/underflow in cost matrix that could be problematic (even these values are not supposed to be taken given their corresponding masses are 0). See also
None, vector of 0s of shape
[1, ndim]is used.
- Return type:
xas an array of shape
[num_measures, max_measure_size, ndim]and
aas an array of shape