Now, we will define the TensorFlow placeholders:
- 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")
- Define the placeholder for the initial hidden state:
init_state = tf.placeholder(shape=[1, hidden_size], dtype=tf.float32, name="state")
- Define an initializer for initializing the weights of the RNN:
initializer = tf.random_normal_initializer(stddev=0.1)