# dsgiitr/d2l-pytorch

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/dsgiitr-d2l-pytorch).**

4,353 stars · 1,235 forks · Jupyter Notebook · Apache-2.0

## Links

- GitHub: https://github.com/dsgiitr/d2l-pytorch
- awesome-repositories: https://awesome-repositories.com/repository/dsgiitr-d2l-pytorch.md

## Topics

`book` `computer-vision` `d2l` `data-science` `deep-learning` `dive-into-deep-learning` `mxnet` `nlp` `pytorch` `pytorch-implmention`

## Description

This project is an educational codebase and reference library that translates theoretical deep learning concepts into executable PyTorch code. It serves as a practical implementation of a deep learning textbook, providing a course-like structure of guided exercises and architectural examples for learning purposes.

The repository includes a library of standard neural network architectures, including linear, convolutional, recurrent, and transformer models. It specifically implements a variety of deep learning patterns such as multilayer perceptrons, VGG networks, gated recurrent units, and long short-term memory networks.

The codebase covers broad capability areas including computer vision for image classification and object detection, as well as natural language processing for sequence modeling and translation. It also implements fundamental machine learning components such as linear and softmax regression, probabilistic classification, and a suite of gradient-based optimization algorithms.

The project is primarily delivered as a collection of Jupyter Notebooks.

## Tags

### Education & Learning Resources

- [Deep Learning Education](https://awesome-repositories.com/f/education-learning-resources/deep-learning-education.md) — Provides a practical, textbook-like implementation of deep learning theory and algorithms using PyTorch.
- [Textbook Implementations](https://awesome-repositories.com/f/education-learning-resources/textbook-implementations.md) — Translates theoretical deep learning textbook concepts into a practical, executable PyTorch codebase.
- [Deep Learning Architectures](https://awesome-repositories.com/f/education-learning-resources/architecture-reference-implementations/deep-learning-architectures.md) — Provides reference implementations of standard neural network architectures for research and educational prototyping.
- [Deep Learning Courses](https://awesome-repositories.com/f/education-learning-resources/deep-learning-courses.md) — Offers a structured educational course on deep learning architectures and their implementation in PyTorch.
- [PyTorch Code Exercises](https://awesome-repositories.com/f/education-learning-resources/deep-learning-education/deep-learning-platforms/pytorch-deep-learning-examples/pytorch-code-exercises.md) — Ships guided coding exercises covering tensors, autograd, and supervised learning using PyTorch.

### Artificial Intelligence & ML

- [Attention Mechanisms](https://awesome-repositories.com/f/artificial-intelligence-ml/attention-mechanisms.md) — Provides the mathematical and computational implementation of attention layers for sequence-to-sequence modeling. ([source](https://github.com/dsgiitr/d2l-pytorch#readme))
- [Automatic Differentiation Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/automatic-differentiation-engines.md) — Provides a dynamic computational graph engine to automate gradient calculation for neural network training.
- [Convolutional Feature Extraction](https://awesome-repositories.com/f/artificial-intelligence-ml/convolutional-feature-extraction.md) — Implements sliding filters to extract local patterns and spatial hierarchies from visual data.
- [Convolutional Neural Networks](https://awesome-repositories.com/f/artificial-intelligence-ml/convolutional-neural-networks.md) — Implements deep learning architectures that use convolutional layers to process grid-structured image data. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch08_Convolutional_Neural_Networks/From_Dense_Layers_to_Convolutions.ipynb))
- [Gradient-Based Parameter Updates](https://awesome-repositories.com/f/artificial-intelligence-ml/gradient-based-parameter-updates.md) — Provides algorithms for updating model weights using gradients calculated from loss functions.
- [Computer Vision](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/frameworks/computer-vision.md) — Enables image classification, object detection, and semantic segmentation using deep learning frameworks. ([source](https://github.com/dsgiitr/d2l-pytorch#readme))
- [Multilayer Perceptrons](https://awesome-repositories.com/f/artificial-intelligence-ml/multilayer-perceptrons.md) — Builds neural networks with multiple fully connected layers to learn non-linear mappings. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch06_Multilayer_Perceptrons/Forward_Propagation_Backward_Propagation_and_Computational_Graphs.ipynb))
- [Neural Network Model Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-model-implementations.md) — Provides a library of reference implementations for linear, convolutional, recurrent, and transformer architectures.
- [Recurrent Neural Networks](https://awesome-repositories.com/f/artificial-intelligence-ml/recurrent-neural-networks.md) — Provides architectures for processing sequential data and learning temporal dependencies. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch10_Recurrent_Neural_Networks/Implementation_of_Recurrent_Neural_Networks_from_Scratch.ipynb))
- [Gated Recurrent Units](https://awesome-repositories.com/f/artificial-intelligence-ml/recurrent-neural-networks/gated-recurrent-units.md) — Implements gating mechanisms in recurrent units to manage information flow and mitigate vanishing gradients.
- [Sequence-to-Sequence Models](https://awesome-repositories.com/f/artificial-intelligence-ml/sequence-to-sequence-models.md) — Implements encoder-decoder architectures for transforming input sequences into target sequences in NLP tasks. ([source](https://github.com/dsgiitr/d2l-pytorch#readme))
- [Contextual Weighting Mechanisms](https://awesome-repositories.com/f/artificial-intelligence-ml/context-injection/runtime-context-injections/attention-weight-injection/contextual-weighting-mechanisms.md) — Implements attention mechanisms that dynamically weight input sequences to provide relevant context during token generation.
- [VGG Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/convolutional-neural-network-architectures/vgg-implementations.md) — Implements the VGG block-based convolutional architecture for high-accuracy image classification. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch09_Modern_Convolutional_Networks/VGG.ipynb))
- [Encoder-Decoder Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/encoder-decoder-architectures.md) — Constructs neural network designs that map input sequences to output sequences via intermediate representations. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch10_Recurrent_Neural_Networks/Encoder-Decoder_Architecture.ipynb))
- [Gradient Computation](https://awesome-repositories.com/f/artificial-intelligence-ml/gradient-computation.md) — Calculates function derivatives via automatic differentiation to enable model training through backpropagation. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch04_The_Preliminaries_A_Crashcourse/Automatic_Differentiation.ipynb))
- [Layered Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/frameworks/model-construction/neural-network-layers/convolution-layers/layered-architectures.md) — Organizes neural networks into modular sequences of reusable linear, convolutional, and recurrent layers.
- [Model Parameter Management](https://awesome-repositories.com/f/artificial-intelligence-ml/model-parameter-management.md) — Provides mechanisms for tracking and updating trainable weights and biases across network layers. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch07_Deep_Learning_Computation/Parameter_Management.ipynb))
- [Momentum Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/momentum-optimizers.md) — Implements momentum-based optimization to accelerate gradient descent and smooth parameter updates. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch12_Optimization_Algorithms/Momentum.ipynb))
- [Natural Language Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-processing.md) — Implements sequence models and transformers for natural language processing tasks like translation and language modeling.
- [Gradient Descent Algorithms](https://awesome-repositories.com/f/artificial-intelligence-ml/optimization-algorithms/gradient-descent-algorithms.md) — Implements iterative gradient descent algorithms to minimize error by updating model weights. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch12_Optimization_Algorithms/Gradient_Descent.ipynb))
- [Neural Network Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/optimization-algorithms/neural-network-optimizers.md) — Implements gradient-based optimizers including SGD, Adam, and RMSProp for refining neural network parameters.
- [PyTorch Computer Vision Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/pytorch-computer-vision-pipelines.md) — Implements end-to-end computer vision workflows for classification and detection using PyTorch.
- [Sequence-to-Sequence Mappings](https://awesome-repositories.com/f/artificial-intelligence-ml/sequence-decoding-models/sequence-to-sequence-mappings.md) — Constructs encoder-decoder architectures that map input sequences to target sequences via latent representations.
- [Stochastic Gradient Descent](https://awesome-repositories.com/f/artificial-intelligence-ml/stochastic-gradient-descent.md) — Implements the fundamental stochastic gradient descent algorithm as part of its optimization suite. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch12_Optimization_Algorithms/Stochastic_Gradient_Descent.ipynb))
- [Stochastic Gradient Descent Optimizations](https://awesome-repositories.com/f/artificial-intelligence-ml/stochastic-gradient-descent-optimizations.md) — Implements mini-batch stochastic gradient descent to improve convergence speed and memory efficiency. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch12_Optimization_Algorithms/Mini-batch_Stochastic_Gradient_Descent.ipynb))

### Part of an Awesome List

- [Long Short-Term Memory Networks](https://awesome-repositories.com/f/awesome-lists/ai/neural-network-architectures/long-short-term-memory-networks.md) — Implements gated recurrent cells that capture long-range temporal dependencies in sequential data. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch10_Recurrent_Neural_Networks/Long_Short_Term_Memory.ipynb))
- [Single Shot Detectors](https://awesome-repositories.com/f/awesome-lists/ai/single-shot-detectors.md) — Implements single-pass bounding box and class label prediction for real-time object detection. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch14_Computer_Vision/Single_Shot_Multibox_Detection.ipynb))
- [Learning Resources](https://awesome-repositories.com/f/awesome-lists/ai/learning-resources.md) — PyTorch adaptation of the Dive into Deep Learning textbook.

### Scientific & Mathematical Computing

- [Linear Algebra](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/linear-algebra.md) — Performs high-dimensional matrix and tensor operations as the computational basis for model weights.
- [Linear Algebra Libraries](https://awesome-repositories.com/f/scientific-mathematical-computing/linear-algebra-libraries.md) — Executes high-dimensional tensor and matrix operations as the computational basis for neural networks. ([source](https://github.com/dsgiitr/d2l-pytorch/blob/master/Ch04_The_Preliminaries_A_Crashcourse/Linear_Algebra.ipynb))
