src.model.deeplearn.dlrun.furthest_point_subsampling_pre_processor

Classes

FurthestPointSubsamplingPreProcessor(**kwargs)

class src.model.deeplearn.dlrun.furthest_point_subsampling_pre_processor.FurthestPointSubsamplingPreProcessor(**kwargs)
Author:

Alberto M. Esmoris Pena

Preprocess the input dictionary of X (coordinates), F (features), and y (expected values) so it can be feed to some neural networks such as PointNet.

See ReceptiveFieldFPS. See ReceptiveFieldPreProcessor.

Variables:
  • num_points (int) – The number of points any point cloud must be reduced to through furthest point subsampling.

  • num_encoding_neighbors (int) – How many neighbors consider to propagate and also to reduce. See ReceptiveFieldFPS for further details.

  • fast (bool) – Flag to control whether to use random methods to speed up the computation of the furthest point subsampling.

__init__(**kwargs)

Initialization/instantiation of a Furthest Point Subsampling pre-processor.

Parameters:

kwargs – The key-word arguments for the FurthestPointSubsamplingPreProcessor.

__call__(inputs)

Executes the pre-processing logic. It also updates the cache-like variables of the preprocessor.

The pre-processing logic is similar to that of grid_subsampling_pre_processor.GridSubsamplingPreProcessor.__call__() but using a ReceptiveFieldFPS instead of ReceptiveFieldGS.

Parameters:

inputs – See grid_subsampling_pre_processor.GridSubsamplingPreProcessor.__call__() .

Returns:

See grid_subsampling_pre_processor.GridSubsamplingPreProcessor.__call__() .

get_num_input_points()

See point_net_pre_processor.PointNetPreProcessor.get_num_input_points() .

static clean_support_neighborhoods(sup_X, I, num_points, oversampling=None)

Compute the clean version of the given support neighborhoods, i.e., support points in sup_X and their neighborhoods as defined in I but considering only neighborhoods with more than num_points neighbors.

Parameters:
  • sup_X – The matrix of coordinates representing the support points.

  • I – The indices (in the original point domain) corresponding to each support point. In other words, I[i] gives the indices in X of support point i in X_sup.

  • num_points – The expected number of points.

  • oversampling – The oversampling specification, if any.

Returns:

The clean matrix of coordinates representing the support points and their neighborhoods.

Return type:

tuple

reduce_labels(X_rf, y, I=None)

Reduce the given labels \(\pmb{y} \in \mathbb{Z}_{\geq 0}^{m}\) to the receptive field labels \(\pmb{y}_{\mathrm{rf}} \in \mathbb{Z}_{\geq 0}^{R}\).

Parameters:
  • X_rf (np.ndarray) – The matrices of coordinates representing the receptive fields.

  • y (np.ndarray) – The labels of the original point cloud that must be reduced to the receptive fields.

  • I (list) – The list of neighborhoods. Each element of I is itself a list of indices that represents the neighborhood in the point cloud that corresponds to the point in the receptive field.

Returns:

The reduced labels for each receptive field.

Return type:

np.ndarray

find_neighborhood(X, y=None)

Find the requested neighborhoods in the given input point cloud represented by the matrix of coordinates \(\pmb{X}\).

Parameters:
  • X (np.ndarray) – The matrix of coordinates.

  • y (np.ndarray) – The vector of expected values (generally, class labels). It is an OPTIONAL argument that is only necessary when the neighborhoods must be found following a given class distribution.

Returns:

A tuple which first element are the support points representing the centers of the neighborhoods and which second element is a list of neighborhoods, where each neighborhood is represented by a list of indices corresponding to the rows (points) in \(\pmb{X}\) that compose the neighborhood.

Return type:

tuple

overwrite_pretrained_model(spec)

See point_net_pre_processor.PointNetPreProcessor.overwrite_pretrained_model() method and receptive_field_pre_processor.ReceptiveFieldPreProcessor.overwrite_pretrained_model().

from_temporary_file()

Realize the logic necessary for Architecture.pre_processor_from_temporary_file().