Coder Social home page Coder Social logo

jaryp / kernel-activation-functions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ispamm/kernel-activation-functions

0.0 2.0 0.0 90 KB

Several implementations of the kernel-based activation functions

License: MIT License

Python 100.00%

kernel-activation-functions's Introduction

Kernel Activation Functions

This repository contains several implementations of the kernel activation functions (KAFs) described in the following paper (link to the preprint):

Scardapane, S., Van Vaerenbergh, S., Totaro, S. and Uncini, A., 2019. 
Kafnets: Kernel-based non-parametric activation functions for neural networks. 
Neural Networks, 110, pp.19-32.

Available implementations

We currently provide the following stable implementations:

  • PyTorch: feedforward and convolutional layers, three kernels (Gaussian/ReLU/Softplus), with random initialization or kernel ridge regression.
  • Keras: same functionalities as the PyTorch implementation.
  • TensorFlow: similar to the Keras implementation, but we use the internal tf.keras.Layer and the eager execution in the demos.
  • Autograd: only feedforward layers with a Gaussian kernel and random initialization.

More information for each implementation is given in the corresponding folder. The code should be relatively easy to plug-in in other architectures or projects.

What is a KAF?

Most neural networks work by interleaving linear projections and simple (fixed) activation functions, like the ReLU function:

A KAF is instead a non-parametric activation function defined as a one-dimensional kernel approximator:

where:

  • The dictionary of the kernel elements is fixed by sampling the x-axis with a uniform step around 0.
  • The user can select the kernel function (e.g., Gaussian, ReLU, Softplus) and the number of kernel elements D.
  • The linear coefficients are adapted independently at every neuron via standard back-propagation.

In addition, the linear coefficients can be initialized using kernel ridge regression to behave similarly to a known function in the beginning of the optimization process.

Contributing

If you have an implementation for a different framework, or an enhanced version of the current code, feel free to contribute to the repository. For any issues related to the code you can use the issue tracker from GitHub.

Citation

If you use this code or a derivative thereof in your research, we would appreciate a citation to the original paper:

@article{scardapane2019kafnets,
  title={Kafnets: Kernel-based non-parametric activation functions for neural networks},
  author={Scardapane, Simone and Van Vaerenbergh, Steven and Totaro, Simone and Uncini, Aurelio},
  journal={Neural Networks},
  volume={110},
  pages={19--32},
  year={2019},
  publisher={Elsevier}
}

License

The code is released under the MIT License. See the attached LICENSE file.

kernel-activation-functions's People

Contributors

d3sm0 avatar sscardapane avatar steven2358 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.