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.
- outputSize : ℕ
Number of features produced at each time step.
Instances For
@[implicit_reducible]
Instances For
@[reducible, inline]
Input shape (seqLen × inputSize).
Instances For
@[reducible, inline]
Output shape (seqLen × outputSize).
Instances For
def
TorchLean.nn.models.rnnWithLinearHead
(cfg : RecurrentConfig)
:
M (Sequential (recurrentInShape cfg) (recurrentOutShape cfg))
Vanilla RNN core plus time-distributed linear head:
rnn(seqLen, inputSize, hiddenSize) → linear(hiddenSize, outputSize).
Instances For
def
TorchLean.nn.models.lstmWithLinearHead
(cfg : RecurrentConfig)
:
M (Sequential (recurrentInShape cfg) (recurrentOutShape cfg))
LSTM core plus time-distributed linear head:
lstm(seqLen, inputSize, hiddenSize) → linear(hiddenSize, outputSize).