src.tests.receptive_field_test
Classes
- class src.tests.receptive_field_test.ReceptiveFieldTest
- Author:
Alberto M. Esmoris Pena
Receptive field test that checks the indexing matrix, the centroids, and the propagation work as expected for some use cases.
- __init__()
Basic configuration for any VL3D test.
- Parameters:
name (str) – Test name
- run()
Run receptive field test.
- Returns:
True if ReceptiveField works as expected for the test cases, False otherwise.
- Return type:
bool
- test_grid_receptive_fields()
Run grid receptive field tests.
- Returns:
True if RepcetiveFieldGS works as expected for the test cases, False otherwise.
- Return type:
bool
- test_fps_receptive_fields()
Run FPS receptive field tests.
- Returns:
True if ReceptiveFieldFPS works as expected for the test cases, False otherwise.
- static test_grid_receptive_field(bounding_radii, cell_size, center_point, input_points, values_to_propagate, expected_num_cells, expected_centroid_nointerp, expected_centroid_interp, expected_propagated_values, eps=1e-06)
Build a grid receptive field with the input points and propagate the given values. Then, the results are compared with the expected outputs to validate the implementation.
- Parameters:
bounding_radii – The bounding radii to build the receptive field.
cell_size (
np.ndarray) – The cell size to build the receptive field.center_point (
np.ndarray) – The center point for the receptive field.input_points – The input points to build the receptive field.
values_to_propagate (
np.ndarray) – The values to propagate through the receptive field.expected_num_cells (int) – The expected number of cells composing the receptive field.
expected_centroid_nointerp (
np.ndarray) – The expected centroids (without interpolation).expected_centroid_interp (
np.ndarray) – The expected centroids (with interpolation).expected_propagated_values (
np.ndarray) – The expected propagated values.eps (float) – The decimal tolerance for numerical validation.
- Returns:
True if the receptive field behaves as expected, False otherwise.
- static test_fps_receptive_field(X, F, y, rfArgs, eps)
Build a FPS receptive field with the input points and check that the features and labels are encoded as expected.
- Parameters:
X (
np.ndarray) – The structure space for the test.F (
np.ndarray) – The feature space for the test.y (
np.ndarray) – The point-wise labels for the test.rfArgs (dict) – The key-word arguments to build the FPS receptive field. See
ReceptiveFieldFPS.eps (float) – The decimal tolerance threshold.