Skip to content

novis10813/FuzzyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FuzzyTorch

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.

What Is Included

  • 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.

Model Components

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

Installation

git clone https://github.com/novis10813/FuzzyTorch.git
cd FuzzyTorch
pip install -r requirements.txt

Usage

Open the notebook to reproduce or inspect the experiment:

jupyter notebook FuzzyNet.ipynb

The reusable layer definitions are available in layers.py:

from layers import FuzzyLayer

layer = FuzzyLayer(input_dim=8, k=4, output_dim=1)

Experiments

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.

Baseline Model

Baseline training curve

FuzzyNet G2

FuzzyNet G2 training curve

FuzzyNet G4

FuzzyNet G4 training curve

FuzzyNet G16

FuzzyNet G16 training curve

FuzzyNet G32

FuzzyNet G32 training curve

FuzzyNet G64

FuzzyNet G64 training curve

Status

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.

About

PyTorch implementation of a fuzzy neural network for regression experiments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors