class_docstr: Sequence to sequence parent module.
docstr: Initialize seq2seq model.
  
  See cmdline args in Seq2seqAgent for description of arguments.
docstr_tok: ["Initialize","seq2seq","model",".","See","cmdline","args","in","Seq2seqAgent","for","description","of","arguments","."]
code: def __init__(
      self,
      num_features,
      embeddingsize,
      hiddensize,
      numlayers=2,
      dropout=0,
      bidirectional=False,
      rnn_class="lstm",
      lookuptable="unique",
      decoder="same",
      numsoftmax=1,
      attention="none",
      attention_length=48,
      attention_time="post",
      padding_idx=0,
      start_idx=1,
      end_idx=2,
      unknown_idx=3,
      input_dropout=0,
      longest_label=1,
  ):
      """
      Initialize seq2seq model.
  
      See cmdline args in Seq2seqAgent for description of arguments.
      """
      super().__init__(
          padding_idx=padding_idx,
          start_idx=start_idx,
          end_idx=end_idx,
          unknown_idx=unknown_idx,
          input_dropout=input_dropout,
          longest_label=longest_label,
      )
      self.attn_type = attention
  
      rnn_class = Seq2seq.RNN_OPTS[rnn_class]
      self.decoder = RNNDecoder(
          num_features,
          embeddingsize,
          hiddensize,
          padding_idx=padding_idx,
          rnn_class=rnn_class,
          numlayers=numlayers,
          dropout=dropout,
          attn_type=attention,
          attn_length=attention_length,
          attn_time=attention_time,
          bidir_input=bidirectional,
      )
  
      shared_lt = (
          self.decoder.lt  # share embeddings between rnns
          if lookuptable in ("enc_dec", "all")
          else None
      )
      shared_rnn = self.decoder.rnn if decoder == "shared" else None
      self.encoder = RNNEncoder(
          num_features,
          embeddingsize,
          hiddensize,
          padding_idx=padding_idx,
          rnn_class=rnn_class,
          numlayers=numlayers,
          dropout=dropout,
          bidirectional=bidirectional,
          shared_lt=shared_lt,
          shared_rnn=shared_rnn,
          unknown_idx=unknown_idx,
          input_dropout=input_dropout,
      )
  
      shared_weight = (
          self.decoder.lt  # use embeddings for projection
          if lookuptable in ("dec_out", "all")
          else None
      )
      self.output = OutputLayer(
          num_features,
          embeddingsize,
          hiddensize,
          dropout=dropout,
          numsoftmax=numsoftmax,
          shared_weight=shared_weight,
          padding_idx=padding_idx,
      )
  
imports: import math
  import torch
  import torch.nn
  from torch.nn.parameter import Parameter
  from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
  import torch.nn.functional
  from parlai.utils.torch import neginf
  from parlai.core.torch_generator_agent import TorchGeneratorModel
label_desc: Use image node_id 1 to create a new Seq2seq object from inherited base classes: TorchGeneratorModel with example: obj = Seq2seq(num_features, embeddingsize, hiddensize, numlayers, dropout, bidirectional, rnn_class, lookuptable, decoder, numsoftmax, attention, attention_length, attention_time, padding_idx, start_idx, end_idx, unknown_idx, input_dropout, longest_label)