RNNToolkit

RNNToolkit provides small, focused utilities for analyzing recurrent neural networks (RNNs) in PyTorch. It includes tools for local linearization, fixed point discovery, and flow-field visualization. Great for neuroscience modeling with RNNs! :brain:

Highlights

  • Linearization helpers to compute Jacobians and eigendecompositions around a state.

  • Fixed point finding utilities with filtering, saving, and analysis helpers.

  • Flow field construction in a reduced 2D subspace (PCA).

Requirements

  • Python 3.10+

  • torch

  • numpy

  • scikit-learn (for flow field PCA)

Install / use locally

Install from source in the project root directory using:

pip install -e .

Quickstart

Linearization

Linearization expects an RNN-like module.

Fixed point finder

FixedPointFinder works with standard PyTorch RNN/GRU/LSTM modules.

Flow fields

FlowFieldFinder also works with standard PyTorch RNNs.

Documentation

Note

This project is under active development. If something is unclear, open an issue.