Recurrent neural network training in Python (RectiPy
) is a software package developed by Richard Gast
that allows for lightweight implementations of recurrent neural networks (RNNs) based on ordinary or delayed
differential equations.
RectiPy
provides an intuitive YAML
interface for model definition, and leverages PyRates
to translate these model definitions into PyTorch
functions.
This way, users can easily define their own neuron models, spike-based or rate-based, and use them to create a RNN model.
All model training, testing, as well as numerical integration of the differential equations is also performed in PyTorch
.
Thus, RectiPy
comes with all the gradient-based optimization and parallelization features that PyTorch
provides.
- RNN layers are defined via ordinary or delayed differential equations that govern the neuron dynamics
- neurons can either be rate neurons or spiking neurons
- RNN layers can either be defined via
YAML
templates (see documentation of PyRates for a detailed documentation of theYAML
-based model definition) or via customPyTorch
modules. - linear input and output layers can be added, thus connecting the RNN into a layered neural network
- input and output weights, as well as any parameters of the RNN layers can be trained
autograd
functions byPyTorch
are used for the parameter optimization- most loss functions and optimization algorithms implemented in
PyTorch
are available
- record any RNN state variable, loss, or model outputs via the
Observer
class - choose at which rate to sample your recordings
- visualize for recordings via lightweight plotting functions
- connect the
RectiPy
network to larger deep learning architectures
You can install the most recent stable version of RectiPy
via the pip
command.
To this end, execute the following command via the terminal within the Python environment you would like to install RectiPy
in:
pip install rectipy
This will also install the dependencies of the software listed below.
To install the most recent development version of RectiPy
as available on the master branch, clone this repository and run the
following line from the directory in which the repository was cloned:
python setup.py install
Again, this will also install the dependencies of the software listed below.
- torch
- pyrates
- numpy
- matplotlib
You can find a detailed documentation and various use examples at our readthedocs website.
If you use this framework, please cite:
If you have any questions, want to contribute to the software, or just get in touch, feel free to post an issue or contact Richard Gast.