Keras model of a Self-Organizing Fuzzy Network
Project description
sofenn: Self-Organizing Fuzzy Neural Network
Welcome to sofenn (sounds like soften)!
This package is a Keras/TensorFlow implementation of a Self-Organizing Fuzzy Neural Network. The sofenn framework
consists of two models:
(1) Fuzzy Network - Underlying fuzzy network whose parameters are optimized during training
(2) Self-Organizer - Metamodel that optimizes the architecture of the Fuzzy Network
FuzzyNetwork
Underlying neural network model that contains parameters to be optimized during training
FuzzySelfOrganizer
Metamodel to optimize the architecture of underlying fuzzy network
Installation
You can install the package using pip:
pip install sofenn
Usage
Demo notebooks available on Github.
Importing the model and self-organizer:
from sofenn import FuzzyNetwork, FuzzySelfOrganizer
# initialize model separate, and attach to self-organizer
model = FuzzyNetwork(input_shape, **_init_params)
sofnn = FuzzySelfOrganizer(model=model)
sofnn.self_organize(x, y)
# initialize sofnn directly
sofnn = FuzzySelfOrganizer(input_shape, **_init_params)
sofnn.self_organize(x, y)
Model Description
The model is implemented per the description in:
'An on-line algorithm for creating self-organizing fuzzy neural networks'
Leng, Prasad, McGinnity (2004)
Fuzzy Neural Network Architecture
Credit: Leng, Prasad, McGinnity (2004)
Layers
Inputs Layer (0)
Input layer of network
Fuzzy Layer (1)
Radial (Ellipsoidal) Basis Function Layer
-
Each neuron represents "if-part" or premise of a fuzzy rule
-
Individual Membership Functions (MF) are applied to each feature for each neuron
-
Output is product of Membership Functions
-
Each MF is a Gaussian function:
-
output for Fuzzy Layer is:
-
- shape: (*, features)
-
- shape: (*, neurons)
Information flow of r features within neuron j
Credit: Leng, Prasad, McGinnity (2004)
Normalize Layer (2)
Normalization Layer
-
Output of each neuron is normalized by total output from the previous layer
-
Number of outputs equal to the previous layer (# of neurons)
-
Output for Normalize Layer is:
-
- shape : (*, neurons)
-
- shape : (*, neurons)
Weighted Layer (3)
Weighting of ith MF of each feature
-
Yields the "consequence" of the jth fuzzy rule of the fuzzy model
-
Each neuron has two inputs:
-
with:
-
- shape: [(*, 1+features), (*, neurons)]
-
- shape: (*, neurons)
Output Layer (4)
Final Output
-
Provide activation function to layer
-
Function choice determines output shape (e.g., linear vs. softmax)
-
Output for fuzzy layer is:
for u neurons
-
Provide activation function to layer (default: linear)
-
Activation function determines output dimensions
Examples
Regression output:
Softmax classification output:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sofenn-0.1.1.tar.gz.
File metadata
- Download URL: sofenn-0.1.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a660b50944512b84c1cd596e590fc660a9d8f1720294a722db16c988aa22335
|
|
| MD5 |
8a52ef4e0fcebf00c5b7537e64136175
|
|
| BLAKE2b-256 |
2de7ee07f3f706897f51c34a6f3bebb4062001ccf0eccfbb450ddbc32bd22875
|
File details
Details for the file sofenn-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sofenn-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d421b547b1a4066d6fe375d4f993cf2ab03e9345a083c086520cfe9272caa234
|
|
| MD5 |
32041fc8f988f5972b6d2f4d33bf9e38
|
|
| BLAKE2b-256 |
36f1fbd9686bb6c38a9df47864f493a8dbee729a2cd15f40daa3f3aed6be1102
|