Testing code results in faster prototyping, more efficient debugging, and faster changing, and makes it easier to share code. There are a number of simple ways to implement unit tests in TensorFlow, and we will cover them in this recipe.
Implementing unit tests
Getting ready
When programming a TensorFlow model, it helps to have unit tests to check the functionality of the program. This helps us because when we want to make changes to a program unit, tests will make sure those changes do not break the model in unknown ways. In this recipe, we will create a simple CNN network that relies on the MNIST data. With it, we will implement three different types of unit test to illustrate how to write them in TensorFlow.
Note that Python...