class_docstr: Main class that defines training graph and defines training run method for language modeling
class_docstr_tok: ["Main","class","that","defines","training","graph","and","defines","training","run","method","for","language","modeling"]
docstr: Method for sampling a sequence (repeatedly one symbol at a time)
  Args:
      sess: tensorflow session
      num_samples: int, number of samples to generate
      sos: int, start of sequence symbol
      eos: int, end of sequence symbol
  
  Returns:
      List of sequences
docstr_tok: ["Method","for","sampling","a","sequence","(","repeatedly","one","symbol","at","a","time",")","Args",":","sess",":","tensorflow","session","num_samples",":","int",",","number","of","samples","to","generate","sos",":","int",",","start","of","sequence","symbol","eos",":","int",",","end","of","sequence","symbol","Returns",":","List","of","sequences"]
code: def sample_sequence(self, sess, num_samples=10, sos=0, eos=1):
      """
      Method for sampling a sequence (repeatedly one symbol at a time)
      Args:
          sess: tensorflow session
          num_samples: int, number of samples to generate
          sos: int, start of sequence symbol
          eos: int, end of sequence symbol
  
      Returns:
          List of sequences
      """
      all_sequences = []
      for _ in tqdm(range(num_samples)):
          sampled_sequence = []
          input_sequence = sos * np.ones((1, self.max_len))
          count = 0
          elem = sos
          while (elem != eos) and (count <= self.max_len * 10):
              feed_dict = {
                  self.input_placeholder_tokens: input_sequence,
                  self.training_mode: False,
              }
              gen_seq_prob_value = sess.run(
                  self.gen_seq_prob, feed_dict=feed_dict
              )
              prob = gen_seq_prob_value[0, -1, :].astype(np.float64)
              prob = prob / sum(prob)
              elem = np.where(np.random.multinomial(1, prob))[0][0]
              input_sequence = np.roll(input_sequence, -1, axis=-1)
              input_sequence[:, -1] = elem
              count += 1
              sampled_sequence.append(elem)
          all_sequences.append(sampled_sequence)
      return all_sequences
  
file_path: nlp-architect/examples/word_language_model_with_tcn/mle_language_model/lm_model.py
imports: import os
  import numpy
  import tensorflow
  from tqdm import tqdm
  from nlp_architect.models.temporal_convolutional_network import TCN, CommonLayers
label_desc: Use image node_id 5 for calling the TCNForLM obj's underlying member method code with example usage: obj.sample_sequence(sess, num_samples, sos, eos) and returns: all_sequences