MachineLearning/rnn library

🔁 Recurrent Neural Network (RNN)

A minimal RNN cell and sequence model with a clear API for sequence classification/regression tasks. The class is designed to be generic and easily extended to LSTM/GRU variants, and includes explicit docstrings and input/output contracts expected in engineering code-bases.

Contract:

  • Input: sequence batch X (n x t x m) as nested lists; targets Y.
  • Output: final hidden states or per-timestep outputs; predict method.
  • Error modes: throws ArgumentError for invalid shapes.

Note: This implementation is intended as a reference, readable and testable; use optimized frameworks for large-scale training.

Classes

RNN
Minimal RNN wrapper using an MLP readout to keep implementation concise