Skip to content

Exorust/TorchLeet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


TorchLeet is a curated set of PyTorch practice problems, inspired by LeetCode-style challenges, designed to enhance your skills in deep learning and PyTorch.

Table of Contents

Question Set

🟢Easy

  1. Implement linear regression (Solution)
  2. Write a custom Dataset and Dataloader to load from a CSV file (Solution)
  3. Write a custom activation function (Simple) (Solution)
  4. Implement Custom Loss Function (Huber Loss) (Solution)
  5. Implement a Deep Neural Network (Solution)
  6. Visualize Training Progress with TensorBoard in PyTorch (Solution)
  7. Save and Load Your PyTorch Model (Solution)

🟡Medium

  1. Implement an LSTM (Solution)
  2. Implement a CNN on CIFAR-10 (Solution)
  3. Implement an RNN (Solution)
  4. Use torchvision.transforms to apply data augmentation (Solution)
  5. Add a benchmark to your PyTorch code (Solution)
  6. Train an autoencoder for anomaly detection (Solution)

🔴Hard

  1. Write a custom Autograd function for activation (SILU) (Solution)
  2. Write a Neural Style Transfer
  3. Write a Transformer (Solution)
  4. Write a GAN (Solution)
  5. Write Sequence-to-Sequence with Attention (Solution)
  6. Quantize your language model (Solution)
  7. [Enable distributed training in pytorch (DistributedDataParallel)]
  8. [Work with Sparse Tensors]
  9. Implement Mixed Precision Training using torch.cuda.amp (Solution)
  10. Add GradCam/SHAP to explain the model. (Solution)

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

Getting Started

1. Install Dependencies

2. Structure

  • <E/M/H><ID>/: Easy/Medium/Hard along with the question ID.
  • <E/M/H><ID>/qname.ipynb: The question file with incomplete code blocks.
  • <E/M/H><ID>/qname_SOLN.ipynb: The corresponding solution file.

3. How to Use

  • 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! 🚀

Contribution

Feel free to contribute by adding new questions or improving existing ones. Ensure that new problems are well-documented and follow the project structure.

Authors

Stargazers over time

Stargazers over time

About

Leetcode for Pytorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •