Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. """
  2. Placeholders
  3. """
  4.  
  5. x = tf.placeholder(tf.int32, [batch_size, num_steps], name='input_placeholder')
  6. y = tf.placeholder(tf.int32, [batch_size, num_steps], name='labels_placeholder')
  7. init_state = tf.zeros([batch_size, state_size])
  8.  
  9. """
  10. RNN Inputs
  11. """
  12.  
  13. # Turn our x placeholder into a list of one-hot tensors:
  14. # rnn_inputs is a list of num_steps tensors with shape [batch_size, num_classes]
  15. x_one_hot = tf.one_hot(x, num_classes)
  16. rnn_inputs = tf.unpack(x_one_hot, axis=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement