Implementing an LSTM
Here we will discuss the details of the LSTM implementation. Though there are sublibraries in TensorFlow that have already implemented ready-to-go LSTMs, we will implement one from scratch. This will be very valuable, as in the real world there might be situations where you cannot use these off-the-shelf components directly. This code is available in the lstm_for_text_generation.ipynb
exercise located in the ch8
folder of the exercises. However, we will also include an exercise where we will show how to use the existing TensorFlow RNN API that will be available in lstm_word2vec_rnn_api.ipynb,
located in the same folder. Here we will discuss the code available in the lstm_for_text_generation.ipynb
file.
First, we will discuss the hyperparameters and their effects that are used for the LSTM. Thereafter, we will discuss the parameters (weights and biases) required to implement the LSTM. We will then discuss how these parameters are used to write the operations taking place...