2025-07-13 09:03:00
github.com
TorchLeet is broken into two sets of questions:
- Question Set: A collection of PyTorch practice problems, ranging from basic to hard, designed to enhance your skills in deep learning and PyTorch.
- LLM Set: A new set of questions focused on understanding and implementing Large Language Models (LLMs) from scratch, including attention mechanisms, embeddings, and more.
Note
Avoid using GPT. Try to solve these problems on your own. The goal is to learn and understand PyTorch concepts deeply.
Mostly for beginners to get started with PyTorch.
- Implement linear regression (Solution)
- Write a custom Dataset and Dataloader to load from a CSV file (Solution)
- Write a custom activation function (Simple) (Solution)
- Implement Custom Loss Function (Huber Loss) (Solution)
- Implement a Deep Neural Network (Solution)
- Visualize Training Progress with TensorBoard in PyTorch (Solution)
- Save and Load Your PyTorch Model (Solution)
- Implement Softmax function from scratch
Recommended for those who have a basic understanding of PyTorch and want to practice their skills.
- Implement a CNN on CIFAR-10 (Solution)
- Implement an RNN from Scratch (Solution)
- Use
torchvision.transforms
to apply data augmentation (Solution) - Add a benchmark to your PyTorch code (Solution)
- Train an autoencoder for anomaly detection (Solution)
- Quantize your language model (Solution)
- Implement Mixed Precision Training using torch.cuda.amp (Solution)
These problems are designed to challenge your understanding of PyTorch and deep learning concepts. They require you to implement things from scratch or apply advanced techniques.
- Implement parameter initialization for a CNN (Solution)
- Implement a CNN from Scratch
- Implement an LSTM from Scratch (Solution)
- Implement AlexNet from scratch
- Build a Dense Retrieval System using PyTorch
- Implement KNN from scratch in PyTorch
These problems are for advanced users who want to push their PyTorch skills to the limit. They involve complex architectures, custom layers, and advanced techniques.
- Write a custom Autograd function for activation (SILU) (Solution)
- Write a Neural Style Transfer
- Build a Graph Neural Network (GNN) from scratch
- Build a Graph Convolutional Network (GCN) from scratch
- Write a Transformer (Solution)
- Write a GAN (Solution)
- Write Sequence-to-Sequence with Attention (Solution)
- [Enable distributed training in pytorch (DistributedDataParallel)]
- [Work with Sparse Tensors]
- Add GradCam/SHAP to explain the model. (Solution)
- Linear Probe on CLIP Features
- Add Cross Modal Embedding Visualization to CLIP (t-SNE/UMAP)
- Implement a Vision Transformer
- Implement a Variational Autoencoder
An all new set of questions to help you understand and implement Large Language Models from scratch.
Each question is designed to take you one step closer to building your own LLM.
- Implement KL Divergence Loss
- Implement RMS Norm
- Implement Byte Pair Encoding from Scratch (Solution)
- Create a RAG Search of Embeddings from a set of Reviews
- Implement Predictive Prefill with Speculative Decoding
- Implement Attention from Scratch (Solution)
- Implement Multi-Head Attention from Scratch (Solution)
- Implement Grouped Query Attention from Scratch (Solution)
- Implement KV Cache in Multi-Head Attention from Scratch
- Implement Sinusoidal Embeddings (Solution)
- Implement ROPE Embeddings (Solution)
- Implement SmolLM from Scratch (Solution)
- Implement Quantization of Models
- GPTQ
- Implement Beam Search atop LLM for decoding
- Implement Top K Sampling atop LLM for decoding
- Implement Top p Sampling atop LLM for decoding
- Implement Temperature Sampling atop LLM for decoding
- Implement LoRA on a layer of an LLM
- QLoRA
- Mix two models to create a mixture of Experts
- Apply SFT on SmolLM
- Apply RLHF on SmolLM
- Implement DPO based RLHF
- Add continuous batching to your LLM
- Chunk Textual Data for Dense Passage Retrieval
- Implement Large scale Training => 5D Parallelism
What’s cool? 🚀
- Diverse Questions: Covers beginner to advanced PyTorch concepts (e.g., tensors, autograd, CNNs, GANs, and more).
- Guided Learning: Includes incomplete code blocks (
...
and#TODO
) for hands-on practice along with Answers
: Easy/Medium/Hard along with the question ID./
: The question file with incomplete code blocks./qname.ipynb
: The corresponding solution file./qname_SOLN.ipynb
- Navigate to questions/ and pick a problem
- Fill in the missing code blocks
(...)
and address the#TODO
comments. - Test your solution and compare it with the corresponding file in
solutions/
.
Happy Learning! 🚀
Feel free to contribute by adding new questions or improving existing ones. Ensure that new problems are well-documented and follow the project structure. Submit a PR and tag the authors.
Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.
Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!
Help Power Techcratic’s Future – Scan To Support
If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.
As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!
BITCOIN bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge Scan the QR code with your crypto wallet app |
DOGECOIN D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA Scan the QR code with your crypto wallet app |
ETHEREUM 0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a Scan the QR code with your crypto wallet app |
Please read the Privacy and Security Disclaimer on how Techcratic handles your support.
Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.