Recurrent neural networks

This page documents two categories of recurrent objects:

  • Composable cells — raw recurrent units with no output projection, designed to be embedded inside larger architectures (TCN, Transformers, encoder-decoders). They expose only a forward method; calling train_on or predict raises NotImplementedError.

  • Complete models — cells wrapped with an output projection layer and the full BaseNeuralNet training API (set_optimizer, train_on, predict). Use these directly for walk-forward financial forecasting.

The three architectures follow a complexity ladder: vanilla Elman RecurrentNeuralNetwork → gated GatedRecurrentUnit (reset + update gates) → LongShortTermMemory (explicit cell state for long dependencies).

Composable cells

Raw GRU and LSTM cells without output projection. Pass them as sub-modules to build custom architectures.

gru.GRUCell(X[, y, drop, x_type, y_type, ...])

GRU cell — public composable building block.

lstm.LSTMCell(X[, y, drop, x_type, y_type, ...])

LSTM cell — public composable building block.

Complete models

Ready-to-train models with output projection and the full BaseNeuralNet API.

rnn.RecurrentNeuralNetwork(X, y[, drop, ...])

Neural network with vanilla Elman recurrent architecture.

gru.GatedRecurrentUnit(X, y[, drop, x_type, ...])

Gated Recurrent Unit neural network.

lstm.LongShortTermMemory(X, y[, drop, ...])

Long Short-Term Memory neural network.