Simple Sequence Model Helpers (API) #
Small, reusable constructors for “sequence core + time-distributed linear head” models used by the
rnn and lstm runnable examples.
These helpers live in the API layer so examples can stay focused on: corpus loading, sample construction, and training loops.
Configuration for an RNN/LSTM sequence model with a time-distributed linear head.
Shapes follow the convention used by the runnable examples:
- input:
(seqLen × inputSize) - output logits/targets:
(seqLen × inputSize)
Instances For
Instances For
@[implicit_reducible]
def
NN.API.nn.models.rnnWithLinearHead
(cfg : SeqRnnHeadConfig)
:
M (Sequential (seqRnnHeadInShape cfg) (seqRnnHeadOutShape cfg))
Vanilla RNN core plus time-distributed linear head:
rnn(seqLen,inputSize,hiddenSize) → linear(hiddenSize → inputSize).
Instances For
def
NN.API.nn.models.lstmWithLinearHead
(cfg : SeqRnnHeadConfig)
:
M (Sequential (seqRnnHeadInShape cfg) (seqRnnHeadOutShape cfg))
LSTM core plus time-distributed linear head:
lstm(seqLen,inputSize,hiddenSize) → linear(hiddenSize → inputSize).