Skip to main content

rationalnets

JAX/Flax implementation of rational neural nets.

Original

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)

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)

Source distribution for rationalnets 0.1.0
File Size Uploaded
rationalnets-0.1.0.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rationalnets 0.1.0
File Interpreter ABI Platform
rationalnets-0.1.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

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