PyTorch implementation of a fuzzy neural network for regression experiments.
The project explores a neural architecture that combines fuzzy membership functions, rule aggregation, and dense neural layers. The experiment notebook applies the model to a COVID-19 regression dataset and compares different numbers of membership function nodes.
layers.py: reusable PyTorch fuzzy layers and membership functions.FuzzyNet.ipynb: experiment notebook for training and comparison.images/: training curves for the baseline model and fuzzy-network variants.requirements.txt: Python dependencies used for the experiment.
The implementation contains three main parts:
- Fuzzification: maps each input feature into fuzzy membership degrees.
- Rule aggregation: combines fuzzy representations with AND/OR-style rule layers.
- Defuzzification and dense layers: converts fuzzy features back into regression outputs.
Supported membership functions in layers.py include:
- Gaussian
- Bell-shaped
- Linear
git clone https://github.com/novis10813/FuzzyTorch.git
cd FuzzyTorch
pip install -r requirements.txtOpen the notebook to reproduce or inspect the experiment:
jupyter notebook FuzzyNet.ipynbThe reusable layer definitions are available in layers.py:
from layers import FuzzyLayer
layer = FuzzyLayer(input_dim=8, k=4, output_dim=1)The experiment compares a baseline dense neural network against fuzzy-network variants with different numbers of membership function nodes.
- Baseline model: standard dense neural network.
- FuzzyNet G2: 2 membership function nodes per feature.
- FuzzyNet G4: 4 membership function nodes per feature.
- FuzzyNet G16: 16 membership function nodes per feature.
- FuzzyNet G32: 32 membership function nodes per feature.
- FuzzyNet G64: 64 membership function nodes per feature.
This is an experimental research repository. It is best used as a compact PyTorch reference for fuzzy-neural-network layers and a notebook-based regression study.





