Building the model

Next up, we are going to use the following structure to build the computational graph:

Figure 15.11: Model architecture

So, as mentioned previously, we are going to use an embedding layer that will try to learn a special real-valued representation for these words. Thus, the words will be fed as one-hot vectors. The idea is to train this network to build up the weight matrix.

So, let's start off by creating the input to our model:

train_graph = tf.Graph()#defining the inputs placeholders of the modelwith train_graph.as_default():    inputs_values = tf.placeholder(tf.int32, [None], name='inputs_values') labels_values = tf.placeholder(tf.int32, ...

Get Deep Learning By Example 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.