Skip to main content

Rational Activations

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

To install the rational_activations module, you can use pip, but:

:bangbang: You should be careful about the CUDA version running on your machine.

To get your CUDA version:

import torch
torch.version.cuda

For your corresponding version of CUDA, please use one of the following command blocks:

CUDA 10.2 (Pytorch >= 1.5.0)

 pip3 install -U pip wheel
 pip3 install torch rational-activations

CUDA 10.1 (Pytorch == 1.4.0)

Python3.6

   pip3 install -U pip wheel
   pip3 install torch==1.4.0
   pip3 install https://iron.aiml.informatik.tu-darmstadt.de/wheelhouse/cuda-10.1/rational_activations-0.0.19-cp36-cp36m-manylinux2014_x86_64.whl

Python3.7

   pip3 install -U pip wheel
   pip3 install torch==1.4.0
   pip3 install https://iron.aiml.informatik.tu-darmstadt.de/wheelhouse/cuda-10.1/rational_activations-0.0.19-cp37-cp37m-manylinux2014_x86_64.whl

Python3.8

     pip3 install -U pip wheel
     pip3 install torch==1.4.0
     pip3 install https://iron.aiml.informatik.tu-darmstadt.de/wheelhouse/cuda-10.1/rational_activations-0.0.19-cp38-cp38-manylinux2014_x86_64.whl

Other CUDA/Pytorch

For any other combinaison of python, please install from source:

 pip3 install airspeed
 git clone https://github.com/ml-research/rational_activations.git
 cd rational_activations
 python3 setup.py install --user

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. 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.19-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.19-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8bf909fa84dc75e3b37b1b63378609d02e146d6cd2cedcedb7c140da40756818
MD5 9be3e80c0e796ec708ec7fab5ebf70ee
BLAKE2b-256 37566094e8d6f615d5c6cd87704b765aac59d873c56222182bb50b198f16715e

See more details on using hashes here.

File details

Details for the file rational_activations-0.0.19-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.19-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f6246deb8d0b784943393476a79aeeaaf404ddab1934d57f3210d97f459df3e
MD5 38d140ffaa2470ebb734bdaa9ae83b30
BLAKE2b-256 eb781a0789c2af3d564c2949424457724d4321f1ac018183347f1dab7c064b79

See more details on using hashes here.

File details

Details for the file rational_activations-0.0.19-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rational_activations-0.0.19-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41f5cd572b2537b9e35155479b6773020ea0d2caf3c48532bb73b110bcaef864
MD5 ac119c401f8ba381dcd9c3e8f9300811
BLAKE2b-256 ec71ffbb090c31b079308b01002c1cb46af702a84975684f908444f650875d2e

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