title: How to generate a sample sentence with LSTM model in Tensorflow?
body: <p>I'm working with the <a href="https://www.tensorflow.org/versions/r0.7/tutorials/recurrent/index.html#recurrent-neural-networks" rel="nofollow">LSTM model in Tensorflow</a>.<br>
  I already trained and saved the LSTM model. Now I'm coming up to the last task to generate the sentences. 
  Here is my pseudo code:</p>
  
  <pre><code># We have already the run_epoch(session, m, data, eval_op, verbose=False) function with fee_dict like this:
  feed_dict = {m.input_data: x,
               m.targets: y,
               m.initial_state: state}
  ...
  # train and save model
  ...
  # load saved model for generating task
  new_sentence = [START_TOKEN]
  # Here I want to generate a sentence until END_TOKEN is generated.
  while new_sentence[-1] != END_TOKEN:
      logits = get_logits(model, new_sentence)
      # get argmax(logits) or sample(logits)
      next_word = argmax(logits)
      new_sentence.append(next_word)
  print(new_sentence)
  </code></pre>
  
  <p><strong>My question is:</strong><br>
  When training, validating, or testing model I have to feed both of the <em>inputs</em> and their <em>labels</em> (by shifted inputs one) into model via <em>feed_dict</em> dictionary. But in the generating task, I have only one input which is the generating sentence <em>new_sentence</em>.  </p>
  
  <p><strong>How can I build the right <em>get_logits</em> function or full <em>generate</em> function also?</strong></p>