Tests

The tests module contains a set of unit tests for the TF-MELT package. These are not intended to be exhaustive, but rather to provide a basic level of coverage for the package for development purposes.

Submodules

The tests module contains the following submodules:

Test Models

class tests.test_models.TestArtificialNeuralNetwork[source]

Bases: object

test_build(ann_model)[source]

Test the build method.

test_get_config(ann_model, model_config)[source]

Test the get_config method.

test_initialize_layers(ann_model)[source]

Test the initialize_layers method.

test_num_parameters(ann_model)[source]

Test the number of parameters in the model.

test_output_shape(ann_model)[source]

Test the output shape of the model.

test_serialization(ann_model)[source]

Test that the model can be serialized and deserialized.

test_sigmoid_output(ann_model)[source]

Test the output of the model with sigmoid activation.

test_softmax_output(ann_model)[source]

Test the output of the model with softmax activation.

test_unused_layers(ann_model)[source]

Test that there are no unused layers in the model.

class tests.test_models.TestBayesianNeuralNetwork[source]

Bases: object

test_build(bnn_model)[source]

Test the build method.

test_call(bnn_model)[source]

Test the call method.

test_initialize_layers(bnn_model)[source]

Test the initialize_layers method.

test_serialization(bnn_model)[source]

Test that the model can be serialized and deserialized.

class tests.test_models.TestMELTModel[source]

Bases: object

test_from_config(model_config)[source]

Test the from_config method.

test_get_config(melt_model, model_config)[source]

Test the get_config method.

test_initialize_layers(melt_model)[source]

Test the initialize_layers method.

class tests.test_models.TestResidualNeuralNetwork[source]

Bases: object

test_build(resnet_model)[source]

Test the build method.

test_call(resnet_model)[source]

Test the call method.

test_initialize_layers(resnet_model)[source]

Test the initialize_layers method.

tests.test_models.ann_model(model_config)[source]

Create an instance of the ArtificialNeuralNetwork class.

tests.test_models.bnn_model(model_config)[source]

Create an instance of the BayesianNeuralNetwork class.

tests.test_models.melt_model(model_config)[source]

Create an instance of the MELTModel class.

tests.test_models.model_config()[source]
tests.test_models.resnet_model(model_config)[source]

Create an instance of the ResidualNeuralNetwork class.