Defining placeholders

Now, we will define the TensorFlow placeholders:

  1. The placeholders for the input and output is defined as:
inputs = tf.placeholder(shape=[None, vocab_size],dtype=tf.float32, name="inputs")
targets = tf.placeholder(shape=[None, vocab_size], dtype=tf.float32, name="targets")
  1. Define the placeholder for the initial hidden state:
init_state = tf.placeholder(shape=[1, hidden_size], dtype=tf.float32, name="state")
  1. Define an initializer for initializing the weights of the RNN:
initializer = tf.random_normal_initializer(stddev=0.1)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset