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)