Instead of relisting all the same code, we will illustrate where our code in this section will differ from the previous section. For the full code, please see the GitHub repository at https://github.com/nfmcclure/tensorflow_cookbook or the Packt repository at https://github.com/PacktPublishing/TensorFlow-Machine-Learning-Cookbook-Second-Edition.
- We first need to set the number of layers for the model. We put this as a parameter at the beginning of our script, with the other model parameters:
num_layers = 3 min_word_freq = 5
rnn_size = 128 epochs = 10
- The first major change is that we will load, process, and feed the text by characters, not by words. In order to accomplish this, after cleaning the text, we can separate ...