unit test

  1. unit test

use unittest.TestCase or pytest or nose.

For the tensorflow based test, there is a `tf.test`.

--> for tensorflow:

Data

  • Ensure that our data has the right format (yes I put it again here for completion)

  • Ensure that the training labels are correct

  • Test our complex processing steps such as image manipulation

  • Assert data completion, quality, and errors

  • Test the distribution of the features

Training

  • Run a training step and compare the weight before and after to ensure that they are updated

  • Check that our loss function can be actually used on our data

Evaluation:

  • Having tests to ensure that your metrics ( e.g accuracy, precision, and recall ) are above a threshold when iterating over different architectures

  • You can run speed/benchmark tests on training to catch possible overfitting

  • Of course, cross-validation can be in the form of a unit test

Model Architecture:

  • The model’s layers are actually stacking

  • The model’s output has the correct shape

2. mocking

Mocking makes it very easy to replace complex logic or heavy dependencies when testing code using dummy objects.

3. coverage

Last updated