Skip to main content

RNN-Jax

Implementation of various flavours of recurrent neural networks in Jax and Equinox

Usage

To start using the library, clone the repository, installing the dependencies in the pyproject.toml.

Example usage

Defining and running a model can be done in few lines

import jax
import equinox as eqx
import jax.random as jr
from rnn_jax.cells import ElmanRNNCell
from rnn_jax.layers import RNN


key = jr.key(0)  # PRNGkey
model_key, data_key = jr.split(key, 2) # split the keys
cell_key, out_key = jr.split(model_key, 2)

rnn = RNN(cell=ElmanRNNCell(idim=1, hdim=16, key=cell_key), odim=1, key=out_key)

x = jr.normal(key=data_key, shape=(100, 1))  # (seq_len, hdim)

outs = rnn(x)

For batched inputs, the model should bevmaped over the batch as follows

x = jr.normal(key=data_key, shape=(64, 100, 1)) #(batch, seq_len, hdim)
outs = eqx.filter_vmap(rnn)(x)

Overview of the cell types (other types will likely be added)

State Space Models (SSM)

State space models are a class of recurrent network that use linear recurrence to perform forward and backward pass through time. In JAX this can be implemented efficiently using jax.lax.associative_scan.

Third-Party Attributions

This project includes dataset files sourced from: reservoirpy (https://github.com/reservoirpy/reservoirpy.git) Copyright (c) Xavier Hinaut (2018) xavier.hinaut@inria.fr

The dataset retains its original MIT License, found in rnn_jax/datasets/_reservoirpy/LICENSE.md.

To DOs (roughly in order of importance)

  • code to integrate reservoirpy sets
  • implement some out-of-the-box training methods
  • modular layers (would require models with additional inputs e.g. $\sigma(W_{in} x + W_{h} h + W_{m} m)$) where $m$ is the message from other modules)
  • message-passing nn with recurrent cells. Maybe the modular layer can be viewed as a MPNN.

Metadata

Release files for rnn-jax 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rnn-jax 0.0.2
File Size Uploaded Provenance Actions
rnn_jax-0.0.2.tar.gz 235.2 kB Without provenance Details for rnn_jax-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rnn-jax 0.0.2
File Interpreter ABI Platform Actions
rnn_jax-0.0.2-py3-none-any.whl Python 3 none any Details for rnn_jax-0.0.2-py3-none-any.whl

Total release size: 481.9 kB

Release files / rnn_jax-0.0.2.tar.gz

Download URL rnn_jax-0.0.2.tar.gz
Size 235.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7ad5c9c27ac62e8a1fdc5837cec4234092f2ec7c939722ac16c865954109310b
BLAKE2b-256 checksum
How to use checksums
fdaecae61d515d7d07704a728951a76d13819caa3828fa23f5991665ec221683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rnn_jax-0.0.2-py3-none-any.whl

Download URL rnn_jax-0.0.2-py3-none-any.whl
Size 246.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
629ff8526e92bb3ca1d5167420ec2fbf9aed679014283f9bdf6d39c54bfb7267
BLAKE2b-256 checksum
How to use checksums
d7781703c429cfbd6de54ebb76432b4d4608cf0a6de1cb3c7ea0b15d82f7da65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for rnn-jax 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page