onmt.LSTM

Implementation of a single stacked-LSTM step as an nn unit.

  h^L_{t-1} --- h^L_t
  c^L_{t-1} --- c^L_t
             |


             .
             |
         [dropout]
             |
  h^1_{t-1} --- h^1_t
  c^1_{t-1} --- c^1_t
             |
             |
            x_t

Computes .

[src]

onmt.LSTM(layers, inputSize, hiddenSize, dropout, residual, dropout_input)

Parameters:

  • layers - Number of LSTM layers, L.
  • inputSize - Size of input layer
  • hiddenSize - Size of the hidden layers.
  • dropout - Dropout rate to use (in range).
  • residual - Residual connections between layers.
  • dropout_input - if true, add a dropout layer on the first layer (useful for instance in complex encoders)