CHAPTER COLLECTION

Build Neural Network From Scratch

Neuron arithmetic, weights as dials, and vectorized NumPy operations.

Mathematics visual
Lesson 01LESSON · 9 picturesCoding Neurons

How does a single artificial neuron convert an input vector into an activated scalar output?

Open lesson →
Mathematics visual
Lesson 02LESSON · 5 picturesWhat Are Weights

What actually is a weight, and why does changing it rotate a decision boundary in space?

Open lesson →
Mathematics visual
Lesson 03LESSON · 2 picturesCalculus Backprop

How does an error at the final output know which specific weight in the first layer caused the mistake?

Open lesson →
Mathematics visual
Lesson 04LESSON · 5 picturesNumpy Dot Product

Why is `np.dot` orders of magnitude faster than a Python `for` loop, and what hardware mechanics make it possible?

Open lesson →
Mathematics visual
Lesson 05LESSON · 1 picturesOptimizer Journey

Why did simple gradient descent fail on deep landscapes, and how did Adam solve it?

Open lesson →
Mathematics visual
Lesson 06LESSON · 12 picturesActivation Functions: Non-Linearity, ReLU & Space Bending

Why do stacks of pure linear layers collapse into a single trivial matrix multiplication, and how do non-linear activations warp vector space to solve non-linear problems?

Open lesson →
Mathematics visual
Lesson 07LESSON · 4 picturesForward Inference Engine: Tensor Propagation & Layer Stacking

How do input feature vectors propagate forward through multi-layer parameter matrices and non-linearities to produce calibrated output scores?

Open lesson →
Mathematics visual
Lesson 08LESSON · 10 picturesLoss Functions: Softmax, Cross-Entropy & Numerical Stability

How do unconstrained scalar outputs get converted into calibrated probability distributions, and why does categorical cross-entropy provide the optimal loss surface for classification?

Open lesson →
Mathematics visual
Lesson 09LESSON · 11 picturesOptimization Foundations: Gradients, Learning Rates & Ravines

How do partial derivatives combine into gradient vectors that navigate high-dimensional non-convex loss surfaces, and why is gradient descent infinitely superior to random search?

Open lesson →
Mathematics visual
Lesson 10LESSON · 6 picturesHigh-Dimensional Loss Landscapes & Morse Theory

Why do high-dimensional error surfaces dominate with saddle points and ill-conditioned ravines rather than isolated local minima?

Open lesson →
Mathematics visual
Lesson 11LESSON · 13 picturesBackpropagation Engine: Chain Rule, Transposes & Autograd

How does the multivariate chain rule reverse-propagate error gradients from a scalar loss back through hundreds of matrix multiplications and non-linearities?

Open lesson →
Mathematics visual
Lesson 12LESSON · 4 picturesGradients and Derivatives: The Chain Rule Engine

How does the chain rule decompose multi-layer neural network credit assignment into local gear ratios?

Open lesson →
Mathematics visual
Lesson 13LESSON · 9 picturesAdaptive Optimizers: Momentum, RMSProp, Adam & Decoupled AdamW

Why does standard gradient descent oscillate helplessly in high-curvature valleys, and how do physical momentum and adaptive coordinate scaling unite into Adam and AdamW?

Open lesson →
Mathematics visual
Lesson 14LESSON · 5 picturesConvolutional Foundations: Spatial Receptive Fields & Kernels

Why do fully-connected layers fail catastrophically on 2D images, and how do localized kernels, stride, and padding extract translation-invariant spatial features?

Open lesson →
Mathematics visual
Lesson 15LESSON · 6 picturesBatch Normalization: Internal Covariate Shift & Residual Scaling

Why do deep networks suffer from unstable gradient flow when layer input distributions shift during training, and how does normalization smooth the loss landscape?

Open lesson →
Mathematics visual
Lesson 16LESSON · 5 picturesDropout & Stochastic Regularization: Co-Adaptation Prevention

Why do deep neural networks overfit when individual neurons co-adapt to fix each other's mistakes, and how does randomly zeroing activations force robust, distributed representations?

Open lesson →
Mathematics visual
Lesson 17LESSON · 6 picturesWeight Regularization: L1 Sparsity, L2 Ridge & Weight Decay Calculus

How do mathematical penalties on weight magnitudes prevent overfitting, and why does L1 create exact zeros while L2 shrinks weights smoothly?

Open lesson →
Mathematics visual
Lesson 18LESSON · 6 picturesLearning Rate Schedulers: Step Decay vs Exponential Dynamics

Why is a static learning rate catastrophic for deep neural convergence, and how do step decay versus continuous exponential schedules dynamically balance fast exploration with asymptotic refinement?

Open lesson →
Mathematics visual
Lesson 19LESSON · 4 picturesBackpropagation Through Activations: ReLU, LeakyReLU & Sigmoid Derivatives

How do non-linear activation functions modulate backward error flow, and why does ReLU masking preserve gradient highway conductivity while Sigmoid triggers exponential vanishing?

Open lesson →
Mathematics visual
Lesson 20LESSON · 5 picturesLoss Function Backpropagation: Categorical Cross-Entropy Calculus

How do prediction errors transform into initial gradient vectors at the exit of a neural network during backpropagation?

Open lesson →
Mathematics visual
Lesson 21LESSON · 7 picturesBackpropagation Engine: Softmax Jacobian & The p - y Gradient Collapse

How does the miracle cancellation softmax cross entropy (coming in some time) solve the underlying computational bottleneck?

Open lesson →
Mathematics visual
Lesson 22LESSON · 4 picturesStochastic Gradient Descent (SGD): Hyperparameter Dynamics & Mini-Batching

Master mini-batch SGD optimization dynamics, gradient covariance noise, learning rate scaling laws, and high-dimensional parameter trajectories.

Open lesson →
Mathematics visual
Lesson 23LESSON · 5 picturesPolyak Momentum: Physical Inertia & Navigating Ill-Conditioned Ravines

Why does vanilla SGD oscillate wildly in ill-conditioned ravines, and how does physical momentum accumulate velocity along consistent gradient directions?

Open lesson →
Mathematics visual
Lesson 24LESSON · 3 picturesAdaGrad: Adaptive Coordinate Scaling & The Cumulative Gradient Trap

How does AdaGrad dynamically scale learning rates coordinate-by-coordinate, and why does monotonic sum-of-squares accumulation kill learning prematurely?

Open lesson →
Mathematics visual
Lesson 25LESSON · 3 picturesRMSProp: Exponential Moving Average Gradient Scaling & Leaky Memory

How does replacing AdaGrad's infinite sum with an Exponential Moving Average prevent learning rate suffocation, and how does leaky memory stabilize non-convex optimization?

Open lesson →
Mathematics visual
Lesson 26LESSON · 8 picturesAdam Optimizer

How does the 4 step rolling bowling ball journey (coming in some time) solve the underlying computational bottleneck?

Open lesson →
Mathematics visual
Lesson 27LESSON · 3 picturesGeneralization Theory: Train-Val-Test Splits & Overfitting Dynamics

Why does driving training loss to zero frequently ruin test set performance, and how do empirical risk minimization versus true risk diverge?

Open lesson →
Mathematics visual
Lesson 28LESSON · 3 picturesK-Fold Cross-Validation: Statistical Resampling & Variance Reduction

How does K-Fold Cross-Validation produce low-variance performance estimates on small datasets without data leakage?

Open lesson →
Mathematics visual
Lesson 29LESSON · 3 picturesRegularization Geometry: L1 Diamond vs L2 Circle Constrained Optimization

Why does the geometric intersection of loss contours with constraint norms force weights to exact zero under L1 while shrinking them smoothly under L2?

Open lesson →
Mathematics visual
Lesson 30LESSON · 3 picturesDropout Regularization: Stochastic Ensemble Approximation & Inverted Scaling

How does randomly dropping neurons during training mathematically approximate an ensemble of 2^N subnetworks with shared weights?

Open lesson →
Mathematics visual
Lesson 31LESSON · 2 picturesCapstone 1: Fashion-MNIST Classification Engine From Scratch

How do data normalization, multi-layer forward propagation, cross-entropy backpropagation, and Adam optimization unite to classify complex real-world clothing images?

Open lesson →
Mathematics visual
Lesson 32LESSON · 1 picturesDeep Learning Software Ecosystem: From Pure NumPy to PyTorch

How do hardware abstraction layers, dynamic computational graphs, and GPU CUDA kernels elevate deep learning from pure Python to scalable production systems?

Open lesson →
Mathematics visual
Lesson 33LESSON · 2 picturesCapstone 2: Continuous Regression Networks & Housing Valuation

How do neural architectures adapt from discrete probability classification to continuous unbounded regression, and how do Mean Squared Error loss and R^2 coefficient quantify performance?

Open lesson →