class_docstr: seq2seq recurrent neural network, implemented using TFLearn.
class_docstr_tok: ["seq2seq","recurrent","neural","network",",","implemented","using","TFLearn","."]
docstr: Train model, with specified number of epochs, and dataset size.
  
  Use specified model, or create one if not provided.  Load initial weights from file weights_input_fn, 
  if provided. validation_set specifies what to use for the validation.
  
  Returns logits for prediction, as an numpy array of shape [out_seq_len, n_output_symbols].
docstr_tok: ["Train","model",",","with","specified","number","of","epochs",",","and","dataset","size",".","Use","specified","model",",","or","create","one","if","not","provided",".","Load","initial","weights","from","file","weights_input_fn",",","if","provided",".","validation_set","specifies","what","to","use","for","the","validation",".","Returns","logits","for","prediction",",","as","an","numpy","array","of","shape","[","out_seq_len",",","n_output_symbols","]","."]
code: def train(
      self,
      num_epochs=20,
      num_points=100000,
      model=None,
      model_params=None,
      weights_input_fn=None,
      validation_set=0.1,
      snapshot_step=5000,
      batch_size=128,
      weights_output_fn=None,
  ):
      """
      Train model, with specified number of epochs, and dataset size.
  
      Use specified model, or create one if not provided.  Load initial weights from file weights_input_fn,
      if provided. validation_set specifies what to use for the validation.
  
      Returns logits for prediction, as an numpy array of shape [out_seq_len, n_output_symbols].
      """
      trainXY, trainY = self.generate_trainig_data(num_points)
      print(
          "[TFLearnSeq2Seq] Training on %d point dataset (pattern '%s'), with %d epochs"
          % (num_points, self.sequence_pattern.PATTERN_NAME, num_epochs)
      )
      if self.verbose > 1:
          print(
              "  model parameters: %s"
              % json.dumps(model_params, indent=4)
          )
      model_params = model_params or {}
      model = model or self.setup_model(
          "train", model_params, weights_input_fn
      )
  
      model.fit(
          trainXY,
          trainY,
          n_epoch=num_epochs,
          validation_set=validation_set,
          batch_size=batch_size,
          shuffle=True,
          show_metric=True,
          snapshot_step=snapshot_step,
          snapshot_epoch=False,
          run_id="TFLearnSeq2Seq",
      )
      print("Done!")
      if weights_output_fn is not None:
          weights_output_fn = self.canonical_weights_fn(
              weights_output_fn
          )
          model.save(weights_output_fn)
          print("Saved %s" % weights_output_fn)
          self.weights_output_fn = weights_output_fn
      return model
  
imports: from __future__ import division, print_function
  import os
  import sys
  import tflearn
  import argparse
  import json
  import numpy
  import tensorflow.compat.v1
  from tensorflow.contrib.legacy_seq2seq.python.ops import seq2seq
  from tensorflow.python.ops import rnn_cell
label_desc: Use image node_id 6 for calling the TFLearnSeq2Seq obj's underlying member method code with example usage: obj.train(num_epochs, num_points, model, model_params, weights_input_fn, validation_set, snapshot_step, batch_size, weights_output_fn) and returns: model