Skip to main content

Recurrent neural network training in Python

Project description

RectiPy

License Python PyPI version CircleCI Documentation Status DOI

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.

Basic Features

1. Model definition

  • 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 the YAML-based model definition) or via custom PyTorch modules.
  • linear input and output layers can be added, thus connecting the RNN into a layered neural network

2. Model training and testing

  • input and output weights, as well as any parameters of the RNN layers can be trained
  • autograd functions by PyTorch are used for the parameter optimization
  • most loss functions and optimization algorithms implemented in PyTorch are available

3. Model outputs

  • 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

Installation

Stable release (PyPi)

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.

Development version (github)

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.

Dependencies

  • torch
  • pyrates
  • numpy
  • matplotlib

Documentation

You can find a detailed documentation and various use examples at our readthedocs website.

References

If you use this framework, please cite:

Gast, R., Knösche, T. R. & Kennedy, A. (2023). PyRates - A Code-Generation Tool for Dynamical Systems Modeling. arXiv:2302.03763.

Contact

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rectipy-0.12.1.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

rectipy-0.12.1-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file rectipy-0.12.1.tar.gz.

File metadata

  • Download URL: rectipy-0.12.1.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for rectipy-0.12.1.tar.gz
Algorithm Hash digest
SHA256 9e9a2ddc2ffd8d7d27ab75afb8a675e38b2f359cab30c37739799b896a3d2263
MD5 e3430096b296420ac737b30766e35bbd
BLAKE2b-256 71c31caf30725fa8d564ce43981197a3359d892513f9c1fecba318c28489053b

See more details on using hashes here.

File details

Details for the file rectipy-0.12.1-py3-none-any.whl.

File metadata

  • Download URL: rectipy-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for rectipy-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3cdceb3a1ae2a9c75a35d55d6e3dcd8e98bdbbb6d4fa3f88cf44d4c96fd5447
MD5 70ab197b267f1497d2528e1b4468f80d
BLAKE2b-256 64cc6cafb510496550f9d7ba150598aa6d40e548f60b0e5ca75a3a7af453742f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page