class_docstr: Testing DNN model from tflearn/models/dnn.py
code: def test_sequencegenerator(self):
      with tf.Graph().as_default():
          text = "123456789101234567891012345678910123456789101234567891012345678910"
          maxlen = 5
  
          (
              X,
              Y,
              char_idx,
          ) = tflearn.data_utils.string_to_semi_redundant_sequences(
              text, seq_maxlen=maxlen, redun_step=3
          )
  
          g = tflearn.input_data(shape=[None, maxlen, len(char_idx)])
          g = tflearn.lstm(g, 32)
          g = tflearn.dropout(g, 0.5)
          g = tflearn.fully_connected(
              g, len(char_idx), activation="softmax"
          )
          g = tflearn.regression(
              g,
              optimizer="adam",
              loss="categorical_crossentropy",
              learning_rate=0.1,
          )
  
          m = tflearn.SequenceGenerator(
              g,
              dictionary=char_idx,
              seq_maxlen=maxlen,
              clip_gradients=5.0,
          )
          m.fit(
              X,
              Y,
              validation_set=0.1,
              n_epoch=100,
              snapshot_epoch=False,
          )
          res = m.generate(10, temperature=0.5, seq_seed="12345")
          # self.assertEqual(res, "123456789101234", "SequenceGenerator test failed! Generated sequence: " + res + " expected '123456789101234'")
  
          # Testing save method
          m.save("test_seqgen.tflearn")
          self.assertTrue(os.path.exists("test_seqgen.tflearn.index"))
  
          # Testing load method
          m.load("test_seqgen.tflearn")
          res = m.generate(10, temperature=0.5, seq_seed="12345")
  
file_path: tflearn/tests/test_models.py
imports: import tensorflow.compat.v1
  import numpy
  import tflearn
  import unittest
  import os
label_desc: Use image node_id 2 for calling the TestModels obj's underlying member method code with example usage: obj.test_sequencegenerator() without return types