Quest 1 • Lesson 3
🧠 Neural Networks & Deep Learning
A neural network is a set of algorithms inspired by the human brain. It consists of layers of neurons that process information. Deep learning uses many layers to learn complex patterns.
🔬 A Single Neuron (Perceptron)
A neuron computes: output = activation( w₁·x₁ + w₂·x₂ + ... + b )
🚀 Live Demo: Neural Network Classifier
A small neural network with 1 hidden layer (4 neurons). It learns to separate blue and red points. Click on the canvas to add points (blue = class 0, red = class 1). Then press "Train" to see the network learn the decision boundary.
📘 Neural network architecture (TensorFlow.js)
const model = tf.sequential();
model.add(tf.layers.dense({units: 4, activation: 'relu', inputShape: [2]}));
model.add(tf.layers.dense({units: 2, activation: 'softmax'}));
model.compile({optimizer: 'adam', loss: 'categoricalCrossentropy'});
🏗️ From Shallow to Deep
- Shallow network: 1 hidden layer – learns simple patterns (like our demo).
- Deep network: many hidden layers – can learn hierarchical features (edges → shapes → objects).
- Deep learning powers image recognition, speech synthesis, and large language models (GPT, BERT).
✨ Challenge: Train a Non-linear Boundary
Add points forming a circle: blue inside, red outside (or vice versa). Train the network – can it learn a circular boundary? Add more hidden units or layers to improve.
❤️ Support Free Education
This course is 100% free. If it helps you, consider buying me a coffee.
☕ Buy Me a Coffee➡️ Ready for more?
Next lesson: Computer Vision – detect objects with pre‑trained models.
Continue to Lesson 1.4 →(Coming soon – check back or buy Pro Pack for instant access)