Nested Perceptron is an extended version of the basic Perceptron, where multiple Perceptrons are connected together to form a simple layered structure.
It represents one of the early steps toward understanding how neural networks are built from smaller computational units.
The goal of this project is to make that transition visible by building the mechanism from scratch.
A single Perceptron can learn a simple decision.
But what happens when we connect multiple Perceptrons together?
We can create a small network where the output of one Perceptron becomes the input of another.
In simplified form:
Inputs
↓
┌───────────────┐
│ Perceptrons │
│ Perceptrons │
└───────────────┘
↓
Output Perceptron
↓
Output
Instead of one computational unit making the entire decision, multiple units can work together.
Connecting Perceptrons introduces several ideas that become important in neural networks:
- Multiple computational units
- Layers
- Hidden representations
- Information flowing between units
- Combining simple decisions into a more complex decision
This is one of the steps from understanding a single artificial neuron to understanding a neural network.
This implementation keeps the mechanism visible rather than hiding it behind a machine-learning framework.
You can experiment with:
- Multiple Perceptrons
- Input and output layers
- Weights and biases
- Activation functions
- Information flowing between layers
- Simple classification problems
The intention is to let you see how multiple simple units can work together.
In the previous project, we used a single Perceptron:
Input
↓
Perceptron
↓
Output
Now we connect multiple Perceptrons:
┌──────────────┐
Input ───>│ Perceptrons │
└──────────────┘
↓
┌──────────────┐
│ Perceptron │
└──────────────┘
↓
Output
This gives us a simple path toward neural networks:
Single Perceptron
↓
Nested Perceptrons
↓
Layers
↓
Neural Network
↓
Backpropagation
↓
More complex AI models
The XOR problem is a useful example for understanding why connecting multiple Perceptrons can matter.
A single Perceptron cannot correctly represent the XOR decision boundary.
By combining multiple Perceptrons, we can build a structure capable of representing this more complex relationship.
This makes XOR a useful bridge between the simple Perceptron and multi-layer neural networks.
This implementation focuses on three basic logic gates:
- AND — demonstrates a simple linearly separable problem.
- OR — another problem that a single Perceptron can solve.
- XOR — demonstrates a problem that requires multiple Perceptrons working together.
Other logic gates such as NOT, NAND, and NOR are also commonly used in neural-network and logic-gate implementations, but they are outside the scope of this project. They can be explored in other implementations without making this project unnecessarily long.
Modern frameworks make neural networks extremely convenient to use, but they can hide the underlying mechanics.
This project takes the opposite approach:
Build the small first. Understand the mechanism. Connect it. Then scale up.
The implementation uses NumPy rather than a large machine-learning framework, keeping the underlying operations visible.
No large model or specialized hardware is required.
This project is part of my 10 Days of Modeling AI for Beginners series, where I build different AI mechanisms from simple foundations and gradually move toward more complex ideas.
The goal is not to build state-of-the-art models.
The goal is to make AI visible, understandable, and experimentable.