The most structured deep learning curriculum on GitHub.
Every topic ships with rigorous mathematical theory, production-grade PyTorch code, and a line-by-line explanation β nothing is left unexplained.
**Made with β€οΈ by Ayush Kumar Singh
- Why This Repository
- The 3-Component System
- Curriculum Map
- Phase Breakdown
- Live Results Snapshot
- Getting Started
- Repository Structure
- Prerequisites
- Progress Tracker
- Contributing
- Author
Most deep learning resources give you one of three things: theory without code, code without intuition, or tutorials that don't scale. This repository gives you all three β for every single topic, without exception.
| What you'll find here | What you won't find here |
|---|---|
| β Full mathematical derivations with LaTeX | β "Just run this Colab" tutorials |
| β Self-contained, runnable PyTorch code | β Code that requires hidden setup |
| β Line-by-line explanations of why | β Copy-paste snippets without context |
| β Inline tensor shape annotations | β Undocumented tensor ops |
| β Empirical proof of theoretical claims | β Theory disconnected from results |
| β CPU + GPU compatible, zero config | β Environment hell |
Every topic in this repository follows an identical, non-negotiable 3-file structure:
topic-name/
βββ theory.md β Mathematics, architecture, intuition
βββ implementation.py β Production-ready PyTorch code
βββ explanation.md β Line-by-line code breakdown
|
π
|
βοΈ
|
π
|
deep-learning-mastery/
β
βββ π¦ phase-1-foundations/ β The bedrock of everything
β βββ 01-perceptron-and-mlp/
β βββ 02-activation-functions/
β βββ 03-gradient-descent-and-backprop/
β βββ 04-loss-functions-and-overfitting/
β βββ 05-regularization-optimizers-batchnorm/
β βββ 06-hyperparameter-tuning-augmentation/
β βββ 07-extra-linear-algebra-pytorch-tensors/
β
βββ πΌ phase-2-cnns/ β Vision intelligence
β βββ 01-convolution-basics/
β βββ 02-architectures-lenet-to-densenet/
β βββ 03-object-detection-rcnn-yolo/
β βββ 04-segmentation-unet-maskrcnn/
β βββ 05-transfer-learning-finetuning/
β
βββ π phase-3-sequential/ β Memory and sequences
β βββ 01-rnns/
β βββ 02-lstm-and-gru/
β βββ 03-seq2seq-nlp/
β βββ 04-extra-state-space-models-mamba/
β
βββ π§ phase-4-attention-transformers/ β The modern backbone
β βββ 01-attention-mechanisms/
β βββ 02-transformer-architecture/
β βββ 03-vision-transformers-swin/
β
βββ π¨ phase-5-generative-ai/ β Create, not just classify
β βββ 01-autoencoders-and-vaes/
β βββ 02-gans-dcgan-cyclegan/
β βββ 03-llms-bert-gpt/
β βββ 04-diffusion-models-ddpm/
β βββ 05-extra-lora-rag-rlhf/
β
βββ π phase-6-advanced-deployment/ β From model to production
βββ 01-graph-neural-networks/
βββ 02-deep-reinforcement-learning/
βββ 03-mlops-quantization-onnx-serving/
Phase 1 β Deep Learning Foundations (7 topics)
| # | Topic | Key Concepts |
|---|---|---|
| 01 | Perceptron & MLP | Biological neuron, convergence theorem, Universal Approximation |
| 02 | Activation Functions | Sigmoid, ReLU, GELU, SELU, SiLU β vanishing gradient proof |
| 03 | Gradient Descent & Backprop | SGD, mini-batch, autodiff chain rule, computational graphs |
| 04 | Loss Functions & Overfitting | BCE, CE, MSE, bias-variance trade-off |
| 05 | Regularization & Optimizers | L1/L2, Dropout, BatchNorm, Adam, RMSprop, Early Stopping |
| 06 | Hyperparameter Tuning | LR schedules, batch size effects, data augmentation strategies |
| 07 β | Linear Algebra & PyTorch | Tensor ops, broadcasting, einsum, autograd mechanics |
Phase 2 β Convolutional Neural Networks (5 topics)
| # | Topic | Key Concepts |
|---|---|---|
| 01 | Convolution Basics | 1D/2D/3D kernels, parameter sharing, receptive field, pooling |
| 02 | Architectures | LeNet β AlexNet β VGG β ResNet β DenseNet β GoogLeNet |
| 03 | Object Detection | Faster R-CNN, anchor boxes, RPN, YOLO v1βv8 |
| 04 | Segmentation | U-Net skip connections, Mask R-CNN instance segmentation |
| 05 | Transfer Learning | Feature extraction vs fine-tuning, domain adaptation |
Phase 3 β Sequential Modeling (4 topics)
| # | Topic | Key Concepts |
|---|---|---|
| 01 | RNNs | Unrolled computation, BPTT, exploding/vanishing gradients |
| 02 | LSTM & GRU | Cell state, forget/input/output gates, GRU simplification |
| 03 | Seq2Seq | Encoder-decoder, teacher forcing, attention bridge |
| 04 β | State Space Models | Mamba, Jamba, selective scan, linear recurrence |
Phase 4 β Attention & Transformers (3 topics)
| # | Topic | Key Concepts |
|---|---|---|
| 01 | Attention Mechanisms | Scaled dot-product, multi-head, causal masking |
| 02 | Transformer Architecture | Encoder-decoder, positional encoding, LayerNorm placement |
| 03 | Vision Transformers | ViT patch embedding, Swin shifted windows, hierarchical features |
Phase 5 β Generative AI & LLMs (5 topics)
| # | Topic | Key Concepts |
|---|---|---|
| 01 | Autoencoders & VAEs | Bottleneck, ELBO, reparameterization trick |
| 02 | GANs | DCGAN, CycleGAN, mode collapse, Wasserstein loss |
| 03 | LLMs β BERT & GPT | Masked LM, causal LM, fine-tuning, summarization, translation |
| 04 | Diffusion Models | DDPM, forward/reverse diffusion, noise schedules, U-Net backbone |
| 05 β | LoRA / RAG / RLHF | Parameter-efficient fine-tuning, retrieval augmentation, DPO alignment |
Phase 6 β Advanced Topics & Deployment (3 topics)
| # | Topic | Key Concepts |
|---|---|---|
| 01 | Graph Neural Networks | Message passing, GCN, GAT, node/edge/graph classification |
| 02 | Deep Reinforcement Learning | DQN, PPO, policy gradients, replay buffer |
| 03 | MLOps | INT8 quantization, ONNX export, FastAPI serving, Dockerization |
These are actual empirical outputs from the implementations β not theoretical claims:
| Experiment | Result |
|---|---|
| Perceptron β AND gate | Converged in 4 epochs, 100% accuracy |
| Perceptron β XOR gate | Hit max 1000 epochs, stuck at 50% (proves single-layer limitation) |
| MLP Scratch β XOR | 100% accuracy from epoch ~2000 onward |
| Production MLP β make_moons | 99% val accuracy in 150 epochs, 6,465 parameters |
| Activation | Input-Layer Gradient Norm | Output-Layer Gradient Norm | Ratio |
|---|---|---|---|
| Sigmoid | 2.82e-10 | 2.62e-01 | 1.1e-09 β catastrophic vanishing |
| Tanh | 1.78e-01 | 9.63e-02 | 1.8Γ β manageable |
| ReLU | 3.78e-03 | 3.16e-03 | 1.2Γ β stable |
| SiLU/Swish | β | β | Lowest val loss (0.0155) |
Every topic will include its own results table as it is completed.
git clone https://github.com/Ayush-2703/deep-learning-mastery.git
cd deep-learning-mastery# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtEvery implementation is fully self-contained β no shared state, no hidden dependencies:
# Example: Run the MLP implementation
python phase-1-foundations/01-perceptron-and-mlp/implementation.py
# Example: Run the Activation Functions comparison
python phase-1-foundations/02-activation-functions/implementation.pyClick the Colab badge at the top of any implementation.py or browse directly:
https://colab.research.google.com/github/Ayush-2703/deep-learning-mastery
Python knowledge assumed:
- Comfortable with Python classes, decorators, and list comprehensions
- Familiarity with NumPy arrays
Math assumed:
- High-school calculus (derivatives, chain rule)
- Basic linear algebra (matrices, dot products)
Everything beyond this is taught from scratch inside
theory.md.
Software:
Python β₯ 3.10
PyTorch β₯ 2.0
NumPy β₯ 1.24
Matplotlib β₯ 3.7
scikit-learn β₯ 1.3
| Phase | Topics | Status |
|---|---|---|
| Phase 1 β Foundations | 7 topics | π© Completed |
| Phase 2 β CNNs | 5 topics | π© Completed |
| Phase 3 β Sequential | 4 topics | π© Completed |
| Phase 4 β Attention & Transformers | 3 topics | π© Completed |
| Phase 5 β Generative AI & LLMs | 5 topics | π© Completed |
| Phase 6 β Advanced & Deployment | 3 topics | π© Completed |
Overall: 27 / 27 topics completed
Contributions are welcome, but this repository maintains a strict quality bar. Before submitting a PR, please read the guidelines:
- Every PR must follow the 3-component structure (
theory.md,implementation.py,explanation.md) - Code must run end-to-end without modification
- Tensor shapes must be annotated inline:
# [batch, seq_len, d_model] - No black-box functions β every non-obvious call gets a comment
- Results must be empirically verified and included in the explanation
# Fork, clone, and create a branch
git checkout -b feature/phase-2-topic-1-convolutions
# After your changes
git commit -m "feat: add phase-2/01-convolution-basics (theory + impl + explanation)"
git push origin feature/phase-2-topic-1-convolutionsThen open a Pull Request with a brief description of what your implementation demonstrates empirically.
Distributed under the MIT License. See LICENSE for details.
You're free to use, fork, and build on this for personal and commercial projects.