src.tests.dl_offline_sequencer_test
Classes
- class src.tests.dl_offline_sequencer_test.DLOfflineSequencerTest
- Author:
Alberto M. Esmoris Pena
Test to check that the
DLOfflineSequencerworks as expected.- class MockArchitecture(pre_runnable, fnames)
- __init__(pre_runnable, fnames)
- run_pre(inputs, **kwargs)
- pre_processor_to_temporary_file()
- pre_processor_from_temporary_file()
- __init__()
Basic configuration for any VL3D test.
- Parameters:
name (str) – Test name
- run()
Run DL offline sequencer test.
- Returns:
True if the DL offline sequencer works as expectec for the test cases, False otherwise.
- Return type:
bool
- run_test_case1(nc, X, F, y)
Run the test case 1.
- Parameters:
nc (int) – The number of classes in the dataset.
X (
np.ndarray`) – The input structure space matrix representing the original input point cloud.F (
np.ndarray) – The input feature space matrix representing the original input point cloud.y (
np.ndarray) – The vector of reference classes.
- Returns:
True if the test case ran successfully, False otherwise.
- Return type:
bool
- run_test_case2(nc, X, F, y)
Run the test case 2.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case3(nc, X, F, y)
Run the test case 3.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case4(nc, X, F, y)
Run the test case 4.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case5(nc, X, F, y)
Run the test case 5.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case6(nc, X, F, y)
Run the test case 6.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case7(nc, X, F, y)
Run the test case 7.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case8(nc, X, F, y)
Run the test case 8.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case9(nc, X, F, y)
Run the test case 9.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- run_test_case10(nc, X, F, y)
Run the test case 10.
See
DLOfflineSequencerTest.run_test_case1()for the documentation of the input arguments.
- binarize_labels(y_rf, nc, to_array=True)
Binarize the labels in the receptive field, i.e., apply one-hot-encoding to the labels of each receptive field.
- Parameters:
y_rf – The receptive field whose labels must be binarized.
nc (int) – The number of classes.
to_array (bool) – Whether to convert the labels of the receptive field to an array (True, default) or not (False).
- Returns:
The one-hot-encoded receptive field-wise labels.
- validate(offseq, osp)
Validate the given offline sequencer.
- Parameters:
offseq (
DLOfflineSequencer) – The offline sequencer to be validated.osp (str) – The path to the offline storage file.
- Returns:
True if the offline sequencer works as expected, False otherwise.
- Return type:
bool
- validate_many_point_clouds(offseq, osp, mh, offline_pcloud)
Alternative version of
DLOfflineSequencerTest.validate()for the case where theDLOfflineSequencerhas a list with extra point clouds (offline_pcloud).- Parameters:
mh (
MockModelHandler) – The mock model handler.offline_pcloud (list of
PointCloud) – List with point clouds.
- validate_outputs(off_batch_X, off_batch_y, bck_batch_X, bck_batch_y, osp)
Check whether the given outputs match. More concretely, the batches generated by the offline sequencer must match those generated by the backbone.
If the batches do not match, the offline storage file at the given offline storage path (path) will be removed from disk. Note it is a temporary file that only needs to exists in the context of the
DLOfflineSequencerTesttest.- Parameters:
off_batch_X – The batch of training data as generated by the offline sequencer.
off_batch_y – The batch of training references as generated by the offline sequencer.
bck_batch_X – The batch of training data as generated by the backbone.
bck_batch_y – The batch of training references as generated by the backbone.
osp – The path to the offline storage file.
- Returns:
True if the outputs of the offline sequencer and the backbone match, False otherwise.
- Return type:
bool