Machine Learning

Basics

Models

  • Linear Regression
  • Generalized Linear Models
  • Logistic Regression
  • Naive Bayes
  • Support Vector Machines
  • Decision Trees
  • Random Forest
  • K-Means Clustering
    • Hierarchical Clustering
    • Density Clustering
  • Gaussian Mixture Model

Deep Learning Models

Primitives (from scratch)

Atomic notes, each with the equation and a short from-scratch PyTorch implementation. Full list: Primitives index.

  • Normalization: GroupNorm, InstanceNorm, RMSNorm, QK-Norm, Adaptive LayerNorm, Normalization Comparison
  • Activations: ReLU, GELU, Swish, SwiGLU, Softmax, Log Softmax
  • Losses: Cross-Entropy Loss, Focal Loss, InfoNCE Loss, Triplet Loss, Knowledge Distillation Loss, Label Smoothing
  • Attention: Scaled Dot-Product Attention, Multi-Head Attention, Grouped-Query Attention, Multi-Head Latent Attention, KV Cache Implementation, Rotary Positional Embeddings, Transformer Block
  • MoE and adaptation: MoE Routing, MoE Load Balancing Loss, LoRA, QLoRA
  • Generative: DDPM, DDIM Sampling, Noise Schedules, Classifier-Free Guidance, Flow Matching, Score Matching, VQ-VAE, VAE ELBO
  • Optimization: AdamW, SGD with Momentum, RMSProp, Learning Rate Schedules, Gradient Clipping, Weight Initialization
  • Framework internals: Autograd Engine, Manual Backprop Rules, Custom autograd Function, Broadcasting and Reduction, Tensor Layout and Strides, Straight-Through Estimator

Applications

Computer Vision

57 items under this folder.