Coder Social home page Coder Social logo

anfis-pytorch's Introduction

ANFIS in pyTorch

This is an implementation of the ANFIS system using pyTorch.

ANFIS

ANFIS is a way of presenting a fuzzy inference system (FIS) as a series of numeric layers so that it can be trained like a neural net.

The canonical reference is the original paper by Jyh-Shing Roger Jang:

  • Jang, J.-S.R. (1993). "ANFIS: adaptive-network-based fuzzy inference system". IEEE Transactions on Systems, Man and Cybernetics. 23 (3): 665โ€“685. doi:10.1109/21.256541

Note that it assumes a Takagi Sugeno Kang (TSK) style of defuzzification rather than the more usual Mamdani style.

Background: other implementations

The original C code from Jang that implements the ANFIS system, along with is test cases, is available from a repository at CMU.

The version most people seem to use is the ANFIS library for Matlab. Their documentation is quite helpful for understanding how ANFIS works, even if you don't use Matlab.

There's an implementation for the R language by Cristobal Fresno and Elmer A. Fernandez of the BioScience Data Mining Group in Argentina (that URL seems a bit unstable). Again, their documentation is very helpful, particularly the "ANFIS vignette" report that comes with the distribution (I've put a local copy here). It shows how to run the system using examples from Jang's paper, and gives some of the results.

I also found a re-implementation of this R code in Python anfis by Tim Meggs that was helpful in understanding the original R code.

Navigation

The ANFIS framework is mainly in three files:

  • anfis.py This is where the layers of the ANFIS system are defined as Torch modules.

  • membership.py At the moment I only have Bell and Gaussian membership functions, but any others will go in here too.

  • experimental.py The experimental infrastructure to train and test the FIS, and to plot some graphs etc.

There are then some runnable examples:

  • jang_examples.py these are four examples from Jang's paper (based partly on the details in the paper, and particle on the example folders in his source code distribution).

  • vignette_examples.py these are three examples from the Vignette paper. Two of these use Gaussians rather than Bell MFs.

Installation

You need to install Python and PyTorch, nothing special.

I'm using Python 3.6.5, the Anaconda 4.6.11 distribution and PyTorch version 1.0.1.

Author

anfis-pytorch's People

Contributors

jfpower avatar

Watchers

James Cloos 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.