class_docstr: RNN Encoder.
  
  Modified to encode history vector in context lstm.
class_docstr_tok: ["RNN","Encoder",".","Modified","to","encode","history","vector","in","context","lstm","."]
docstr: Initialize recurrent encoder and context lstm.
docstr_tok: ["Initialize","recurrent","encoder","and","context","lstm","."]
code: def __init__(
      self,
      num_features,
      embeddingsize,
      hiddensize,
      device,
      padding_idx=0,
      rnn_class="lstm",
      numlayers=2,
      dropout=0.1,
      bidirectional=False,
      shared_lt=None,
      shared_rnn=None,
      input_dropout=0,
      unknown_idx=None,
      sparse=False,
  ):
      """
      Initialize recurrent encoder and context lstm.
      """
      super().__init__(
          num_features,
          embeddingsize,
          hiddensize,
          padding_idx,
          rnn_class,
          numlayers,
          dropout,
          bidirectional,
          shared_lt,
          shared_rnn,
          input_dropout,
          unknown_idx,
          sparse,
      )
      self.padding_idx = padding_idx
      self.context_lstm = nn.LSTM(
          hiddensize, hiddensize, numlayers, batch_first=True
      ).to(device)
  
file_path: ParlAI/parlai/agents/hred/modules.py
imports: import torch
  import torch.nn
  from parlai.agents.seq2seq.modules import OutputLayer, RNNEncoder, _transpose_hidden_state
  from parlai.core.torch_generator_agent import TorchGeneratorModel
label_desc: Use image node_id 1 to create a new HredEncoder object from inherited base classes: RNNEncoder with example: obj = HredEncoder(num_features, embeddingsize, hiddensize, device, padding_idx, rnn_class, numlayers, dropout, bidirectional, shared_lt, shared_rnn, input_dropout, unknown_idx, sparse)