rationalnets
JAX/Flax implementation of rational neural nets.
Original
- paper: Nicolas Boullé, Yuji Nakatsukasa, and Alex Townsend, Rational neural networks, arXiv preprint arXiv:2004.01902 (2020).
- github: https://github.com/NBoulle/RationalNets
Installation
rationalnets can be installed with pip with the following command:
python -m pip install rationalnets
Or you can install the latest version with the following command:
python -m pip install git+https://github.com/yonesuke/RationalNets.git
QuickStart
Rational activation function
import jax.numpy as jnp
from jax import random
from rationalnets import RationalMLP
xs = jnp.arange(-2.0, 2.0, 0.01)
act = Rational()
params = model.init(random.PRNGKey(0), xs)
ys = act.apply(params, xs) # values of rational activation function for -2.0 ~ 2.0
Rational MLP
import jax.numpy as jnp
from jax import random
from rationalnets import RationalMLP
model = RationalMLP([12, 8, 4])
batch = jnp.ones((32, 10))
variables = model.init(random.PRNGKey(0), batch)
output = model.apply(variables, batch)
Metadata
Release files for rationalnets 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rationalnets-0.1.0.tar.gz | 2.9 kB | Without provenance | Details for rationalnets-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rationalnets-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for rationalnets-0.1.0-py3-none-any.whl |
Total release size: 6.3 kB
Release files / rationalnets-0.1.0.tar.gz
| Download URL | rationalnets-0.1.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f3af6f0772b60825781c33aedd1eaee9cc76d05676b1943bbc2b54882adbafc
|
|
BLAKE2b-256 checksum How to use checksums |
52edf37a509e4657005ea3eb2800c4b3755f3e6ecdb3e322a871612fcd2149fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / rationalnets-0.1.0-py3-none-any.whl
| Download URL | rationalnets-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc6c2babd398698bc56bf45acc2a175da4cd09fff6da6e6739342f68cc222fdd
|
|
BLAKE2b-256 checksum How to use checksums |
81a2f76785a9bd86427e5e93bf35e21520b44b20eec8405c052fef7d9ca25921
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Security for rationalnets 0.1.0
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.