src.tests.model_serialization_test

Classes

ModelSerializationTest()

class src.tests.model_serialization_test.ModelSerializationTest
Author:

Alberto M. Esmoris Pena

Serialization test that checks the serialization (and deserialization) of models.

__init__()

Basic configuration for any VL3D test.

Parameters:

name (str) – Test name

run()

Run model serialization test.

Returns:

True if model serialization works as expected for the test cases, False otherwise.

Rtype bool:

test_random_forest_classifier()

Test the serialization of the random forest classification model.

See RandomForestClassificationModel.

Returns:

True if model serialization works as expected, False otherwise.

test_point_net_pwise_classifier()

Test the serialization of the PointNet point-wise classification model.

See PointNetPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

test_rbf_net_pwise_classifier()

Test the serialization of the RBFNet point-wise classification model.

See RBFNetPwiseClassificationModel.

Returns:

True if model serialization works as expected, False otherwise.

test_point_netpp_pwise_classifier()

Test the serialization of the PointNet++ point-wise classification model.

See ConvAutoencPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

test_kpconv_pwise_classifier()

Test the serialization of the Kernel Point Convolutiona point-wise classification model.

See ConvAutoencPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

test_light_kpconv_pwise_classifier()

Test the serialization of the Light Kernel Point Convolutional point-wise classification model.

See ConvAutoencPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

test_sflnet_pwise_classifier()

Test the serialization of the Slight Filter Network point-wise classification model.

See ConvAutoencPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

test_pttransf_pwise_classifier()

Test the serialization of the PointTransformer point-wise classification model.

See ConvAutoencPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

test_gpttransf_pwise_classifier()

Test the serialization of the GroupedPointTransformer point-wise classification model.

See ConvAutoencPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

test_spconv_pwise_classifier()

Test the serialization of the Sparse Convolutional point-wise classification model.

See ConvAutoencPwiseClassifModel.

Returns:

True if model serialization works as expected, False otherwise.

validate_deserialized_model(original, deserial, original_y=None, deserial_y=None)

Check that the attributes of the deserialized model (deserial) match those of the model before the serialization.

Parameters:
  • original – The original model, i.e., before serialization.

  • deserial – The deserialized model.

Returns:

True if the deserialized model is valid, False otherwise.

static model_weights_validation(oriobj, desobj)

Recursively compare given objects in an attribute-wise way.

Parameters:
  • oriobj (object) – The original object.

  • desobj (object) – The deserialized object.

Returns:

True if the objects match (i.e., are equal), false otherwise.

static model_output_validation(original_y, deserial_y)

Determine whether the outputs are equal or not.

Parameters:
  • original_y (np.ndarray) – The output (predictions) of the original model.

  • deserial_y (np.ndarray) – The output (predictions) of the deserialized model.

Returns:

True if the outputs are valid (equal), False otherwise.

Return type:

bool