Skip to content

Interactive visualization of neural networks learning the XOR function, featuring both algorithmic implementation and web-based UI

Notifications You must be signed in to change notification settings

Karansehgal0611/NeuralXOR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XOR NN 🧠⚡

A Minimalist Neural Network Implementation for XOR Problem with Visualizations from SCRATCH

Python 3.8+ Flask License: MIT

📦 Project Structure

NeuralXOR/
├── app.py # Flask web interface
├── BasicNN.py # Core neural network class
├── generate.py # Visualization generator
├── UnderstandingNNs.pdf # Theoretical background
├── templates/ # Web UI templates
│ └── index.html
└── visualisations/ # Generated plots
  └── decision_boundary.png
  └──network_graph.png
  └── training_progress.png

🌟 Key Features

  • Pure Python Implementation
    No ML frameworks - understand backpropagation from scratch
  • Interactive Web Dashboard
    Train and predict via browser interface
  • Multiple Visualization Modes
    • Decision boundaries
    • Network architecture graphs
    • Training progress plots
  • Educational Focus
    Companion PDF explains mathematical foundations

🚀 Quick Start

Installation

git clone https://github.com/Karansehgal0611/NeuralXOR.git
cd NeuralXOR
python -m venv venv
source venv/bin/activate  # Linux/Mac
# {venv\Scripts\activate}     # Windows

🧠 Neural Network Details

Architecture

[Input(2)] → [Hidden(4), sigmoid] → [Output(1), sigmoid]
Training Parameters
Parameter    	   Value	     Description
Learning Rate	   0.5	       Controls weight update step size
Loss Function	   MSE	       Mean Squared Error
Batch Size	     4	         Full-batch training for XOR
Epochs	         5000	     Typical training iterations needed

🛠 Development

Dependencies

numpy>=1.21.0
matplotlib>=3.5.0
flask>=2.0.0
networkx>=2.6.0

Authored by - Karan Sehgal

About

Interactive visualization of neural networks learning the XOR function, featuring both algorithmic implementation and web-based UI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published