Code Monkey home page Code Monkey logo

fastonn's Introduction


FastONN - Python-based open-source GPU implementation for Operational Neural Networks

Installation

Clone the repository and run the following command from inside the directory:

pip install .

Usage

A common workflow using 2D convolutions looks as follows:

torch.nn.Conv2d(in_channels, out_channels, kernel_size)

This can be converted into a Self-ONN simply by swapping the convolutional layer with a Self-ONN layer:

from fastonn import SelfONN2dLayer
SelfONN2dLayer(in_channels, out_channels, kernel_size, q=3)

where q controls the extent of non-linearity. q=1 is equivalent to a CNN

For using super neurons, the additional parameter of max_shift is required

from fastonn import SuperONN2dLayer
SuperONN2dLayer(in_channels, out_channels, kernel_size, max_shift=18, q=3)

Precautions

  • A SelfONN2dLayer expects input to be bounded between [-1,1]. To respect this, a Tanh or Sigmoid activation layer must preceed it.
  • For SuperONN2dLayer, the max_shift must respect the size of the input feature map. The layer does not raise a flag if the shift exceeds the boundaries of the image.

References

  • Kiranyaz, S, Ince, T, Iosifidis, A & Gabbouj, M 2020, 'Operational neural networks', Neural Computing and Applications, vol. 32, pp. 6645โ€“6668. https://doi.org/10.1007/s00521-020-04780-3
  • Serkan Kiranyaz, Junaid Malik, Habib Ben Abdallah, Turker Ince, Alexandros Iosifidis, Moncef Gabbouj, Self-organized Operational Neural Networks with Generative Neurons, Neural Networks, Volume 140, 2021, Pages 294-308, ISSN 0893-6080, https://doi.org/10.1016/j.neunet.2021.02.028.
  • Junaid Malik, Serkan Kiranyaz, Moncef Gabbouj, Self-organized operational neural networks for severe image restoration problems, Neural Networks, Volume 135, 2021, Pages 201-211, ISSN 0893-6080, https://doi.org/10.1016/j.neunet.2020.12.014.

fastonn's People

Contributors

junaidmalik09 avatar soulyma avatar ilia-chelak avatar aulrichsen avatar danyk98 avatar

Stargazers

 avatar Ahmad Bastati avatar  avatar

Watchers

Ahmad Bastati 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.