Skip to main content

Pade Activation Unit

Project description

Rational Activations - Learnable Rational Activation Functions

First introduce as PAU in Padé Activation Units: End-to-end Learning of Activation Functions in Deep Neural Network

Arxiv link: https://arxiv.org/abs/1907.06732

1. About Padé Activation Units

Rational Activations are a novel learnable activation functions. Rationals encode activation functions as rational functions, trainable in an end-to-end fashion using backpropagation and can be seemingless integrated into any neural network in the same way as common activation functions (e.g. ReLU).

Rational matches or outperforms common activations in terms of predictive performance and training time. And, therefore relieves the network designer of having to commit to a potentially underperforming choice.

2. Dependencies

PyTorch>=1.4.0
CUDA>=10.1

3. Installation

Rational is implemented as a pytorch extension using CUDA 10.2. So all that is needed is to install the extension.

pip3 install --upgrade pip
pip3 install rational

If installation does not work, please run:

pip3 install wheel

For CUDA 10.1 (and thus 1.4.0>=torch>= 1.5.0), download the wheel corresponding to your python3 version in the wheelhouse repo and install it with:

pip3 install rational-0.0.16-101-cp{your_version}-manylinux2014_x86_64.whl

If you encounter any trouble installing rational, please contact this person.

4. Using Rational in Neural Networks

Rational can be integrated in the same way as any other common activation function.

import torch
from rational_torch import Rational

model = torch.nn.Sequential(
    torch.nn.Linear(D_in, H),
    Rational(), # e.g. instead of torch.nn.ReLU()
    torch.nn.Linear(H, D_out),
)

5. Reproducing Results

To reproduce the reported results of the paper execute:

$ export PYTHONPATH="./" $ python experiments/main.py --dataset mnist --arch conv --optimizer adam --lr 2e-3

# DATASET: Name of the dataset, for MNIST use mnist and for Fashion-MNIST use fmnist
# ARCH: selected neural network architecture: vgg, lenet or conv
# OPTIMIZER: either adam or sgd
# LR: learning rate

6. To be implemented

  • Make a documentation
  • Create tutorial in the doc
  • Tensorflow working version
  • Automatically find initial approx weights for function list
  • Repair + enhance Automatic manylinux production script.
  • Add python3.9 support
  • Make an CUDA 11.0 compatible version
  • Repair the tox test and have them checking before commit

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

File details

Details for the file rational_activations-0.0.17-102-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.17-102-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24d632f5d77e00744640a71db424a2fe44a4812d6c913f47826c6cf4f1d6b159
MD5 c4ac00b657b01b0d59ebc5d0fdc3307d
BLAKE2b-256 99eab87d354e7d6e5ebef2d6624d35da4e2ae4cfdeff6107c3be45122df97e97

See more details on using hashes here.

File details

Details for the file rational_activations-0.0.17-102-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.17-102-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26cc46a34d16a3d34777a14cb2e5d0b7c72d1c3df07334dbb5de43610b4614f6
MD5 ace75f819d98c3b2cb7280a5e87b9f28
BLAKE2b-256 628e5295a1126a019cade39e5e43ec559022d32e0b8470d0eae7b1c7f26ae527

See more details on using hashes here.

File details

Details for the file rational_activations-0.0.17-102-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.17-102-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0079b9e90cf4c1e470ba054474c914541e181f1b42eec785ced66777fbfd5ad
MD5 952efc8c71ba856f7b8caea82407ce80
BLAKE2b-256 68bdccc71f64698931a8634a5ef566e3258203f44b3e5dc1b08871488b53f836

See more details on using hashes here.

File details

Details for the file rational_activations-0.0.17-101-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.17-101-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b18d87a2ef1da62d746662e088dab834b4adefe1ca48910079227ba5792046f
MD5 b75706cdc2f88870f599b755048d39ec
BLAKE2b-256 15b591adb0573c623570a660618bf791624ab8547bc28ceddf878e20405fe499

See more details on using hashes here.

File details

Details for the file rational_activations-0.0.17-101-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.17-101-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a23fb4ef8ef8083d77a8e1912adeffd81c500f2d97c067983f63c06fac53548
MD5 55d4cb1e9bcff92b6d7532e5f6c9d294
BLAKE2b-256 c92d14bf76cd035f377ed33f2eba86d5478deacaddcdb03485f5ea1f17acf2bf

See more details on using hashes here.

File details

Details for the file rational_activations-0.0.17-101-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.17-101-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8dd21486576c8631e7ab6c07c8bf9da87830c3877c15531fb3d7573aecf9e756
MD5 04d0f79396e38e94fc2dcbacf288f6ec
BLAKE2b-256 bb55a36922ee34ea198c7b74b8e1bf97fc9671c5fa55dc021a7d25b4922ec776

See more details on using hashes here.

Supported by

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