Skip to content

A hands-on, structured PyTorch learning repository that documents my journey from foundational concepts like tensors and autograd to building CNNs, RNNs, and performing hyperparameter tuning. Each notebook contains real experiments, clean code, and practical insights.

License

Notifications You must be signed in to change notification settings

Sourabh-Kumar04/Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 PyTorch Deep Learning Journey

Python PyTorch License Jupyter

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.


🎯 About This Repository

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.


πŸ“š Learning Roadmap

πŸ”° Foundation Phase

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.

πŸ—οΈ Building Better Models

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.

⚑ Performance & Optimization

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.

🧠 Advanced Architectures

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.

πŸ“Š Datasets

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

βš™οΈ Getting Started

πŸ§ͺ Setup Instructions

# 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

πŸ’‘ Key Learnings & Insights

πŸ’₯ What Stood Out

  • 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.

βœ… What Helped Me Most

  • Following a week-by-week structure
  • Running experiments on the same dataset to compare architectures
  • Keeping visual checkpoints to understand overfitting/underfitting

🚧 Pitfalls I Hit

  • Forgetting .to(device) calls β†’ silent bugs on GPU
  • Skipping normalization β†’ exploding losses
  • Wrong loss functions β†’ poor convergence
  • Overfitting small datasets β†’ false sense of success

πŸ“ˆ Results Snapshot

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

🧰 Tools & Libraries

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

πŸ“… Learning Schedule (What Worked for Me)

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!


❓ Common Questions

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.

πŸ“š Resources That Helped Me

Official Docs & Courses

When Stuck


πŸ‘¨β€πŸ’» About Me

Sourabh Kumar πŸŽ“ AI Programming with Python - Udacity Graduate

πŸŽ–οΈ AWS AI ML Scholar'24 | AI | ML | GenAI Explorer*

🌐 GitHub | LinkedIn

"Always learning, always building β€” one notebook at a time."


πŸ“„ License

This project is licensed under the MIT License.


⭐️ Support the Project

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

Happy Learning! πŸš€

"The best way to learn deep learning is by building with it."

About

A hands-on, structured PyTorch learning repository that documents my journey from foundational concepts like tensors and autograd to building CNNs, RNNs, and performing hyperparameter tuning. Each notebook contains real experiments, clean code, and practical insights.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published