labmlai /annotated_deep_learning_paper_implementations
🧑🏫 60+ Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, sophia, ...), gans(cyclegan, stylegan2, ...), 🎮 reinforcement learning (ppo, dqn), capsnet, distillation, ... 🧠
★ 67,742⑂ 6,789👁 496⑃ 155● 145▤ 0◈ 11
67,742
stars
+12
6,789
forks
496
watchers
155
prs
145
issues
0
releases
11
discussions
README
labml.ai Deep Learning Paper Implementations
Note: use the Annotated Implementation Skill with coding
agents to implement any paper with annotations.
This is a collection of simple PyTorch implementations of
neural networks and related algorithms.
These implementations are documented with explanations,
The website
renders these as side-by-side formatted notes.
We believe these would help you understand these algorithms better.
!Screenshot
We are actively maintaining this repo and adding new
implementations almost weekly.
for updates.
Paper Implementations
✨ Transformers
JAX implementation
Multi-headed attention
Triton Flash Attention
Transformer building blocks
Transformer XL
Relative multi-headed attention
Rotary Positional Embeddings
Attention with Linear Biases (ALiBi)
RETRO
Compressive Transformer
GPT Architecture
GLU Variants
kNN-LM: Generalization through Memorization
Feedback Transformer
Switch Transformer
Fast Weights Transformer
FNet
Attention Free Transformer
Masked Language Model
MLP-Mixer: An all-MLP Architecture for Vision
Pay Attention to MLPs (gMLP)
Vision Transformer (ViT)
Primer EZ
Hourglass
✨ Low-Rank Adaptation (LoRA)
✨ Eleuther GPT-NeoX
Generate on a 48GB GPU
Finetune on two 48GB GPUs
LLM.int8()
✨ Diffusion models
Denoising Diffusion Probabilistic Models (DDPM)
Denoising Diffusion Implicit Models (DDIM)
Latent Diffusion Models
Stable Diffusion
✨ Generative Adversarial Networks
Original GAN
GAN with deep convolutional network
Cycle GAN
Wasserstein GAN
Wasserstein GAN with Gradient Penalty
StyleGAN 2
✨ Recurrent Highway Networks
✨ LSTM
✨ HyperNetworks - HyperLSTM
✨ ResNet
✨ ConvMixer
✨ Capsule Networks
✨ U-Net
✨ Sketch RNN
✨ Graph Neural Networks
Graph Attention Networks (GAT)
Graph Attention Networks v2 (GATv2)
✨ Counterfactual Regret Minimization (CFR)
Solving games with incomplete information such as poker with CFR.
Kuhn Poker
✨ Reinforcement Learning
Proximal Policy Optimization with
Generalized Advantage Estimation
Deep Q Networks with
with Dueling Network,
Prioritized Replay
and Double Q Network.
✨ Optimizers
Adam
AMSGrad
Adam Optimizer with warmup
Noam Optimizer
Rectified Adam Optimizer
AdaBelief Optimizer
Sophia-G Optimizer
✨ Normalization Layers
Batch Normalization
Layer Normalization
Instance Normalization
Group Normalization
Weight Standardization
Batch-Channel Normalization
DeepNorm
✨ Distillation
✨ Adaptive Computation
PonderNet
✨ Uncertainty
Evidential Deep Learning to Quantify Classification Uncertainty
✨ Activations
Fuzzy Tiling Activations
✨ Langauge Model Sampling Techniques
Greedy Sampling
Temperature Sampling
Top-k Sampling
Nucleus Sampling
✨ Scalable Training/Inference
Zero3 memory optimizations
Installation
bash
pip install labml-nnTop issues
#275How to Contribute to This Repository8 comments · 2024-09-15#270Unet error in DDPM4 comments · 2024-08-14#195Training code or references for training the latent diffusion model on a custom dataset3 comments · 2023-07-08#169Dimension of subsequent layers in Hypernetwork3 comments · 2023-02-27#165Missing activation for the time embedding inside ResidualBlock for DDPM?3 comments · 2023-01-30#107[BUG] StyleGAN2: latent vector is ignored3 comments · 2022-02-07#260How to use my own database for training and evaluating Retro for Question-Answering?2 comments · 2024-06-27#180MultiHeadAttention parameter setting2 comments · 2023-04-30
Discussions
#295The SGR Manifold: Surpassing Transformer Efficiency via Singular Geometric Strikes0 comments · 2026-01-21#279Wanted help to understand how I can effectively use LabMl1 comments · 2024-12-06#277Questions re: the DeepNorm implementation0 comments · 2024-11-14#269Interested to Contribute0 comments · 2024-08-10#248[pip install labml-nn] showed warnings and when run image_to_image.py it showed: [ModuleNotFoundError: No module named 'transformers']1 comments · 2024-03-21#183PPO experiment on colab report an error2 comments · 2023-05-14#181Any tools to render side-by-side annotations from source code?1 comments · 2023-05-08#176Can I generate nn.labml.ai type of interface for my own notebooks?0 comments · 2023-04-05