An example of productionalizing TensorFlow
A good practice for productionalizing machine learning models is to separate the training and evaluation programs. In this section, we will illustrate an evaluation script that has been expanded to include a unit test, model saving and loading, and evaluation.
Getting ready
In this recipe, we will show you how to implement an evaluation script using the afore-mentioned criteria. The code actually consists of a training script and an evaluation script, but for this recipe we will only show you the evaluation script. As a reminder, both scripts can been seen in the online GitHub repository at https://github.com/nfmcclure/tensorflow_cookbook/ and at the official Packt repository: https://github.com/PacktPublishing/TensorFlow-Machine-Learning-Cookbook-Second-Edition.
For the upcoming example, we will implement the first RNN example from Chapter 9, Recurrent Neural Networks, which attempts to predict whether a text message is spam or ham. We will assume...