"Implementing Deep Learning from the ground up. No PyTorch. No TensorFlow. Just NumPy and understanding."
- ML Engineers preparing for FAANG interviews who need to implement attention from scratch
- CS Students seeking deep understanding over API usage
- Researchers debugging model internals and custom architectures
Tagline: "If you can't implement it in NumPy, you don't understand it."
34 core topics + 4 optional bonus topics β’ 2-3 hours/day β’ Prerequisites: Python, Linear Algebra 101, Calculus I
- Curriculum fully scaffolded across Modules 00 to 04 (Topics 01 to 34)
- Optional 2026 bonus module available as Module 05 (Topics 35 to 38)
- Every topic includes
README.md,hints/hint-1..3,tests/test_basic.py+test_edge.py+test_stress.py, andsolutions/level01..level04 - Hint content is now standardized with detailed scaffolding across later modules (CNN advanced topics, RNNs, Transformers)
- Recent validation run completed successfully across all topics (
01-34) in a clean virtual environment
# Clone and setup
git clone https://github.com/harshaygadekar/dl-from-scratch.git
cd dl-from-scratch
pip install -r requirements.txt
# Verify your setup
python utils/test_runner.py --verify-setup
# Start learning!
cd "Module 00-Foundations/Topic 01-Tensor-Operations"| Topic | Title | Key Concept |
|---|---|---|
| 01 | Tensor Operations & Broadcasting | Memory layouts, stride tricks |
| 02 | Autograd Engine From Scratch | Computational graphs, reverse-mode AD |
| 03 | Optimization Algorithms | SGD, Momentum, Adam from equations |
| Topic | Title | Key Concept |
|---|---|---|
| 04 | Single Layer Perceptron | Sigmoid, BCE loss, binary classification |
| 05 | MLP Forward Pass | Xavier/Kaiming initialization |
| 06 | Backpropagation | Chain rule, gradient computation |
| 07 | Activation Functions | ReLU, Sigmoid, Tanh, Softmax |
| 08 | Loss Functions | MSE, Cross-Entropy, Binary CE |
| 09 | Regularization | L2, Dropout, Batch Normalization |
| 10 | End-to-End MNIST | 95% accuracy target |
| Topic | Title | Key Concept |
|---|---|---|
| 11-17 | Conv2D β CIFAR-10 | Im2col, ResNet, advanced norms |
| Topic | Title | Key Concept |
|---|---|---|
| 18-24 | RNN β Attention | BPTT, LSTM, Bahdanau attention |
| Topic | Title | Key Concept |
|---|---|---|
| 25-30 | Self-Attention β Mini-GPT | Build a small language model |
| 31-34 | Production Optimization | KV-cache, quantization, distributed |
| Topic | Title | Key Concept |
|---|---|---|
| 35-38 | LoRA β Selective Scan | Modern systems intuition and toy implementations |
- PyTorch (
torch.nn,torch.optim,torch.autograd) - TensorFlow/Keras (
tf.keras,tf.GradientTape) - JAX, Autograd libraries, Scikit-Learn
- Pre-trained models or
torchvision.models
- NumPy:
np.dot, array ops, broadcasting - Python stdlib:
math,random,collections - Matplotlib: Visualization only
- Pandas/PIL: Data loading only
Every topic has 4 solution tiers:
| Level | Focus | Description |
|---|---|---|
| Level 1 | Correctness | Naive but working (loops, readable) |
| Level 2 | Speed | NumPy-optimized (broadcasting) |
| Level 3 | Memory | In-place ops, float16, cache-aware |
| Level 4 | Reference | PyTorch verification (ground truth) |
- Check
hints/hint-1-*.mdfor basic direction - Check
hints/hint-2-*.mdfor pseudocode - Check
hints/hint-3-*.mdfor optimization tips - Still stuck? Use the escape hatch (see Topic folder README)
Topic 02 Escape Hatch: If autograd blocks you, use utils/autograd_stub.py and return later.
- Work module-by-module (
00 -> 01 -> 02 -> 03 -> 04) - For each topic, attempt
level01first, use hints progressively (hint-1 -> hint-2 -> hint-3), then run tests - Move to
level02/level03only afterlevel01passes - Use
level04as reference verification, not as first attempt - Keep a short implementation log: what failed, what changed, what you learned
- Optional after core completion: explore Module 05 Topics 35-38 for 2026 systems extensions
This sequencing keeps understanding ahead of optimization and reduces confusion across dependencies.
python3 utils/progress.py
# [ββββββΆββββββββββββββββββββββββββββ] Module 00 Topic 03 (12%)
# Mark topics complete in your local progress state
python3 utils/progress.py --mark-topic 1 2
# Get machine-readable status
python3 utils/progress.py --status-jsonWe love Karpathy's content! This is complementary, not competitive:
| Karpathy | DL-From-Scratch |
|---|---|
| Video lectures | Text/problem-based |
| One long project | 34 modular daily problems |
| Theory-heavy | Interview-style constraints |
| General education | FAANG interview preparation |
| PyTorch from start | NumPy-only until verification |
Complementary use: Stuck on Topic 6? Watch Karpathy's micrograd video, then return!
# Run tests for a specific topic
python3 utils/test_runner.py --day 05
# List all topics
python3 utils/test_runner.py --list
# Verify your setup
python3 utils/test_runner.py --verify-setup
# Run full curriculum validation (Topics 01-34)
python3 utils/validate_all.py
# Run milestone evaluation harness (Topics 10/17/24/30/34)
python3 utils/milestone_eval.py --smoke
python3 utils/milestone_eval.pyMIT License - see LICENSE for details.
- Assess yourself: PREREQUISITES.md
- Set up environment: SETUP.md
- Begin Topic 01: Module 00/Topic 01
Built with β€οΈ for those who want to truly understand deep learning.