My personal journey learning PyTorch β from basic tensor operations to designing, training, and optimizing neural networks. Every notebook here is a step in my hands-on deep learning education.
This is a structured, practical archive of my PyTorch learning path. It includes conceptual breakdowns, working notebooks, mini-projects, and optimization experiments β all built to reinforce deep learning foundations and explore advanced applications.
Why I built this: To reinforce my learning with real code, and to share tested, beginner-friendly examples that actually work.
Notebook | Key Learnings |
---|---|
00_Introduction to PyTorch.pdf |
Overview of PyTorch and its ecosystem. |
01_Tensors_in_pytorch.ipynb |
Tensor creation, indexing, broadcasting, and operations. |
02_pytorch_autograd.ipynb |
Gradient computation and backpropagation via autograd . |
03_pytorch_training_pipeline.ipynb |
Manual training loops, loss calculation, and optimization basics. |
Notebook | Focus Area |
---|---|
04_pytorch_nn_module.ipynb |
Writing modular, reusable neural networks using nn.Module . |
05_dataset_and_dataloader.ipynb |
Clean data handling with Dataset and DataLoader . |
06_ANN_using_pytorch.ipynb |
My first complete multi-layer perceptron (MLP) network. |
Notebook | What I Explored |
---|---|
07_neural_network_training_on_GPU.ipynb |
CUDA-powered training on GPU β major performance gains. |
08_Optimize_neural_network.ipynb |
Manual optimization techniques β adjusting learning rates, etc. |
09_Optimize_neural_network_using_optuna.ipynb |
Automated tuning with Optuna β model selection made efficient. |
Notebook | Project |
---|---|
10_a_CNN_on_fashion_mnist.ipynb |
Basic convolutional neural network for image classification. |
11_CNN_on_fashion_mnist.ipynb |
Improved CNN with batch norm, dropout, and deeper layers. |
12_RNN_using_pytorch.ipynb |
Intro to RNNs for handling sequential data. |
13_next_word_predictor.ipynb |
RNN-based language model for next-word prediction. |
File | Usage | Notes |
---|---|---|
06_fmnist_small.csv |
MLP training | Lightweight dataset for quick tests |
07_fashion-mnist_test.csv |
CNN testing | Test set for benchmarking |
07_fashion-mnist_train.zip |
CNN training | Full training data |
12_100_Unique_QA_Dataset.csv |
NLP with RNNs | Custom Q&A dataset |
# 1. Clone the repo
git clone https://github.com/Sourabh-Kumar04/Pytorch.git
cd Pytorch
# 2. Create environment
conda create -n pytorch-learning python=3.9
conda activate pytorch-learning
# 3. Install dependencies
pip install torch torchvision matplotlib numpy optuna pandas jupyter
# 4. Run the notebooks
jupyter notebook
- Simple models first: My early ANN helped me understand more than any advanced CNN tutorial.
- GPU = Game changer: 10Γ training speed-up with CUDA.
- Pipeline precision: Clean data handling saved me hours of pain.
- Optuna: Discovered hyperparameters I wouldn't have considered.
- Following a week-by-week structure
- Running experiments on the same dataset to compare architectures
- Keeping visual checkpoints to understand overfitting/underfitting
- Forgetting
.to(device)
calls β silent bugs on GPU - Skipping normalization β exploding losses
- Wrong loss functions β poor convergence
- Overfitting small datasets β false sense of success
Task | Initial Accuracy | Final Accuracy | Improvements |
---|---|---|---|
CNN (Fashion MNIST) | 78% | 91% | Model tuning & augmentation |
Advanced CNN | 91% | 94% | Dropout, LR scheduler |
Word Prediction (RNN) | 65% | 82% | Larger hidden layer, better preprocessing |
torch>=2.0.0 # Core deep learning framework
torchvision>=0.15.0 # Datasets, transforms, pretrained models
numpy>=1.21.0 # Numerical operations
pandas>=1.3.0 # Data wrangling
matplotlib>=3.5.0 # Visualizations
seaborn>=0.11.0 # Advanced plots
optuna>=3.0.0 # Hyperparameter optimization
jupyter>=1.0.0 # Notebook execution
tqdm>=4.62.0 # Loop progress bars
Week | Topics |
---|---|
Week 1 | Tensors + Autograd (01 , 02 ) |
Week 2 | Training loops & modules (03 , 04 ) |
Week 3 | Data & MLP models (05 , 06 ) |
Week 4 | GPU & Optimization (07 , 08 , 09 ) |
Week 5 | CNNs for CV (10 , 11 ) |
Week 6 | RNNs for NLP (12 , 13 ) |
β Tip: Donβt rush the early modules β theyβre the real foundation!
Do I need a GPU?
Not at the start. You can run all notebooks up to `06_ANN` comfortably on CPU. For CNN and RNN, a GPU is highly recommended for speed.Where should I start?
Begin with `00_Introduction to PyTorch.pdf`. Even if you know NumPy, PyTorch has its own quirks.Can I use this for my own learning/projects?
Absolutely! It's MIT licensed β fork it, adapt it, build on it.- π PyTorch Tutorials
- π Deep Learning with PyTorch Book
- π Fast.ai Course
- π§ PyTorch Forums
- π§© Stack Overflow
- π Papers with Code
Sourabh Kumar π AI Programming with Python - Udacity Graduate
ποΈ AWS AI ML Scholar'24 | AI | ML | GenAI Explorer*
"Always learning, always building β one notebook at a time."
This project is licensed under the MIT License.
If you found this useful:
- Give a βοΈ to the repository
- Fork it and make it your own
- Share feedback or suggestions
- Connect with me for collabs or questions