Skip to main content

Spocu activation function in Pytorch and Tensorflow.

Project description

“SPOCU”: scaled polynomial constant unit activation function.

Non-official Pytorch/Tensorflow implementation of the SPOCU activation function [1], for the case when c=infinite.

Installation

You can install this package using pip:

python3 -m pip install spocu

Pytorch

It can be included in your network given an alpha, beta and gamma value:

from spocu.spocu_pytorch import SPOCU

alpha = 3.0937
beta = 0.6653
gamma = 4.437

spocu = SPOCU(alpha, beta, gamma)

x = torch.rand((10,10))
print(spocu(x))

Tensorflow

from spocu.spocu_tensorflow import SPOCU

alpha = 3.0937
beta = 0.6653
gamma = 4.437

spocu = SPOCU(alpha, beta, gamma)


X = tf.Variable(tf.random.normal([10, 10], stddev=5, mean=4) )
print(spocu(X))

Tests

See spocu_test for equivalance of pytorch and tensorflow implementation.

Citation

If you find this work useful, please cite:

@article{carrillo2021deep,
  title={Deep learning to classify ultra-high-energy cosmic rays by means of PMT signals},
  author={Carrillo-Perez, F and Herrera, LJ and Carceller, JM and Guill{\'e}n, A},
  journal={Neural Computing and Applications},
  pages={1--17},
  year={2021},
  publisher={Springer}
}

Acknowledgements

Thanks to the author of the Tensorflow version, Atilla Ozgur.

Bibliography

[1] Kiseľák, J., Lu, Y., Švihra, J. et al. “SPOCU”: scaled polynomial constant unit activation function. Neural Comput & Applic (2020). https://doi.org/10.1007/s00521-020-05182-1

Project details


Download files

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

Source Distribution

spocu-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

spocu-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file spocu-0.0.1.tar.gz.

File metadata

  • Download URL: spocu-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.5

File hashes

Hashes for spocu-0.0.1.tar.gz
Algorithm Hash digest
SHA256 872ace24b13fb1c9bee7de49f2a6fe56658b8682392ada873059b836ea4504ba
MD5 5ea8e74a324e0f2733942495b65ab6b4
BLAKE2b-256 4c86029ab89f0c225cfa2fcf5219a7049a53749e95b1aa07b9717c9d9f625f2d

See more details on using hashes here.

File details

Details for the file spocu-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: spocu-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.5

File hashes

Hashes for spocu-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 baa81f341a2e7c7fa98cd5b9da8214991bb47cd28b602ba558f714ce6395014f
MD5 0807097cd8cd46b7b274f202f529fd38
BLAKE2b-256 d0b13feae01775b4895dc491b471111f5c819e0b895f4adb16a9b1f448ae6178

See more details on using hashes here.

Supported by

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