LRNN
Base class for all LRNN (Linear Recurrent Neural Network) models. This abstract class provides the foundation for both LTI (Linear Time-Invariant) and LTV (Linear Time-Varying) LRNN implementations.Class Hierarchy
TheLRNN class serves as the parent class for:
LTI_LRNN- Linear Time-Invariant LRNN modelsLTV_LRNN- Linear Time-Varying LRNN models
Constructor
Discretization method to use for converting continuous-time systems to discrete-time:
"zoh"- Zero-Order Hold discretization"bilinear"- Bilinear transform method (used in S4)"dirac"- Dirac discretization method"async"- Asynchronous discretization for event-driven models"no_discretization"- Identity operation, no discretization appliedNone- For models that handle discretization internally
Abstract Methods
forward
Input tensor, ideally of shape
(B, L, H) where:Bis the batch sizeLis the sequence lengthHis the hidden dimension
Timesteps for async/event-driven discretization (see arxiv:2404.18508), ideally of shape
(B, L). Only applicable for LTV models; LTI models ignore this parameter.Lengths of sequences, ideally of shape
(B,). Required for bidirectional models to properly handle variable-length sequences.Output tensor with the same shape as input
x, ideally (B, L, H).Attributes
The discretization function selected based on the
discretization parameter. Set to None if no discretization method is specified.Example Usage
See Also
- Discretization Functions - Available discretization methods
- DISCRETIZE_FNS Dictionary - Mapping of discretization method names to functions
