Smooth ReLU in TensorFlow
Unofficial TensorFlow reimplementation of the Smooth ReLU (SmeLU) activation function proposed in the paper Real World Large Scale Recommendation Systems Reproducibility and Smooth Activations by Gil I. Shamir and Dong Lin.
This repository includes an easy-to-use pure TensorFlow implementation of the Smooth ReLU.
Installation
The SmeLU can be installed by using pip.
pip install git+https://github.com/r3v1/tf-SmeLU
Example Usage
import tensorflow as tf
from tf_smelu import smelu
x = tf.range(-6, 6, 1, dtype=float) # <tf.Tensor: numpy=array([-6., -5., -4., -3., -2., -1., 0., 1., 2., 3., 4., 5.], dtype=float32)>
smelu(x, beta=0.1) # <tf.Tensor: numpy=array([0.,0.,0.,0.,0.,0.,0.025,1.,2.,3.,4.,5.], dtype=float32)>
smelu(x, beta=0.5) # <tf.Tensor: numpy=array([0.,0.,0.,0.,0.,0.,0.125,1.,2.,3.,4.,5.], dtype=float32)>
smelu(x, beta=1.) # <tf.Tensor: numpy=array([0.,0.,0.,0.,0.,0.,0.25 ,1.,2.,3.,4.,5.], dtype=float32)>
The SmeLU takes the following parameters.
beta: Half-width of a symmetric transition region around x = 0. Defaults to 1.
Reference
@article{Shamir2022,
title={{Real World Large Scale Recommendation Systems Reproducibility and Smooth Activations}},
author={Shamir, Gil I and Lin, Dong},
journal={{arXiv preprint arXiv:2202.06499}},
year={2022}
}
Metadata
Release files for tf-SmeLU 1.0.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 |
|---|---|---|---|---|
| tf-SmeLU-1.0.0.tar.gz | 37.3 kB | Without provenance | Details for tf-SmeLU-1.0.0.tar.gz |
Release files / tf-SmeLU-1.0.0.tar.gz
| Download URL | tf-SmeLU-1.0.0.tar.gz |
|---|---|
| Size | 37.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb15684288906052edf68a4434d147ca2a3bc28b771e9e9320b927d27b5e504b
|
|
BLAKE2b-256 checksum How to use checksums |
77ae5e97af20e6fd906a0192a8eeb36d21324ecee10b88a239f898e50f85fa46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for tf-SmeLU 1.0.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.