class_docstr: A standard stacked Bidirectional LSTM where the LSTM layers
  are concatenated between each layer. The only difference between
  this and a regular bidirectional LSTM is the application of
  variational dropout to the hidden states and outputs of each layer apart
  from the last layer of the LSTM. Note that this will be slower, as it
  doesn't use CUDNN.
  
  [0]: https://arxiv.org/abs/1512.05287
  
  # Parameters
  
  input_size : `int`, required
      The dimension of the inputs to the LSTM.
  hidden_size : `int`, required
      The dimension of the outputs of the LSTM.
  num_layers : `int`, required
      The number of stacked Bidirectional LSTMs to use.
  recurrent_dropout_probability : `float`, optional (default = `0.0`)
      The recurrent dropout probability to be used in a dropout scheme as
      stated in [A Theoretically Grounded Application of Dropout in Recurrent
      Neural Networks][0].
  layer_dropout_probability : `float`, optional (default = `0.0`)
      The layer wise dropout probability to be used in a dropout scheme as
      stated in [A Theoretically Grounded Application of Dropout in Recurrent
      Neural Networks][0].
  use_highway : `bool`, optional (default = `True`)
      Whether or not to use highway connections between layers. This effectively involves
      reparameterising the normal output of an LSTM as::
  
          gate = sigmoid(W_x1 * x_t + W_h * h_t)
          output = gate * h_t  + (1 - gate) * (W_x2 * x_t)
code: def __init__(
      self,
      input_size: int,
      hidden_size: int,
      num_layers: int,
      recurrent_dropout_probability: float = 0.0,
      layer_dropout_probability: float = 0.0,
      use_highway: bool = True,
  ) -> None:
      super().__init__()
  
      # Required to be wrapped with a `PytorchSeq2SeqWrapper`.
      self.input_size = input_size
      self.hidden_size = hidden_size
      self.num_layers = num_layers
      self.bidirectional = True
  
      layers = []
      lstm_input_size = input_size
      for layer_index in range(num_layers):
          forward_layer = AugmentedLstm(
              lstm_input_size,
              hidden_size,
              go_forward=True,
              recurrent_dropout_probability=recurrent_dropout_probability,
              use_highway=use_highway,
              use_input_projection_bias=False,
          )
          backward_layer = AugmentedLstm(
              lstm_input_size,
              hidden_size,
              go_forward=False,
              recurrent_dropout_probability=recurrent_dropout_probability,
              use_highway=use_highway,
              use_input_projection_bias=False,
          )
  
          lstm_input_size = hidden_size * 2
          self.add_module(
              "forward_layer_{}".format(layer_index), forward_layer
          )
          self.add_module(
              "backward_layer_{}".format(layer_index), backward_layer
          )
          layers.append([forward_layer, backward_layer])
      self.lstm_layers = layers
      self.layer_dropout = InputVariationalDropout(
          layer_dropout_probability
      )
  
file_path: allennlp/allennlp/modules/stacked_bidirectional_lstm.py
imports: from typing import Optional, Tuple, List
  import torch
  from torch.nn.utils.rnn import PackedSequence, pack_padded_sequence, pad_packed_sequence
  from allennlp.modules.augmented_lstm import AugmentedLstm
  from allennlp.modules.input_variational_dropout import InputVariationalDropout
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 1 to create a new StackedBidirectionalLstm object from inherited base classes: torch.nn with example: obj = StackedBidirectionalLstm(input_size, hidden_size, num_layers, recurrent_dropout_probability, layer_dropout_probability, use_highway)