Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Placeholders
- """
- x = tf.placeholder(tf.int32, [batch_size, num_steps], name='input_placeholder')
- y = tf.placeholder(tf.int32, [batch_size, num_steps], name='labels_placeholder')
- init_state = tf.zeros([batch_size, state_size])
- """
- RNN Inputs
- """
- # Turn our x placeholder into a list of one-hot tensors:
- # rnn_inputs is a list of num_steps tensors with shape [batch_size, num_classes]
- x_one_hot = tf.one_hot(x, num_classes)
- rnn_inputs = tf.unpack(x_one_hot, axis=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement