TorchLean API

NN.API.Models.Recurrent

Recurrent Models #

RNN and LSTM sequence models with a linear projection at every time step.

Configuration for an RNN or LSTM followed by a time-distributed linear head.

Shapes follow the convention used by the runnable examples:

  • input: (seqLen × inputSize)
  • output: (seqLen × outputSize)
  • seqLen :

    Number of time steps.

  • inputSize :

    Number of features presented at each time step.

  • hiddenSize :

    Width of the recurrent state.

  • outputSize :

    Number of features produced at each time step.

Instances For
    @[reducible, inline]

    Input shape (seqLen × inputSize).

    Instances For
      @[reducible, inline]

      Output shape (seqLen × outputSize).

      Instances For

        Vanilla RNN core plus time-distributed linear head:

        rnn(seqLen, inputSize, hiddenSize) → linear(hiddenSize, outputSize).

        Instances For

          LSTM core plus time-distributed linear head:

          lstm(seqLen, inputSize, hiddenSize) → linear(hiddenSize, outputSize).

          Instances For