Using the TensorFlow RNN API
We will now examine how we can use the TensorFlow RNN API to make the code simpler. The TensorFlow RNN API contains a variety of RNN-related functions that help us to implement RNNs faster and easier. We will now see how the same example we discussed in the preceding sections can be implemented using the TensorFlow RNN API. However, to make things exciting, we will implement a deep LSTM network with three layers that we talked about in the comparisons. The full code for this is available in the lstm_word2vec_rnn_api.ipynb
file in the Ch8
folder.
First, we will define the placeholders for holding inputs, labels, and corresponding embedding vectors for the inputs. We ignore the validation data related computations as ...
Get Natural Language Processing with TensorFlow now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.