← All projects

A Reverse-Mode Automatic Differentiation Engine

Built a reverse-mode automatic differentiation engine from scratch on top of NumPy — the computational-graph core that powers frameworks like PyTorch and TensorFlow — then used it to train a logistic regression classifier end-to-end.

Python NumPy Autodiff
ML SYSTEMS / AUTODIFF06 / SYSTEM STUDY
A graph that learns backwardsInput x and trainable weight W feed a matrix multiplication, bias b feeds addition, and sigmoid produces a prediction. Prediction and target y feed the loss. Reverse-mode gradients follow the graph backwards to update parameters.REVERSE-MODE COMPUTATION GRAPHxW×b+σLossyFORWARD →← BACKPROPAGATION / ∂L
A graph that learns backwardsForward values / reverse gradients

Overview

A reverse-mode automatic differentiation engine, implemented from scratch on top of NumPy. This is the same core mechanism — building a computational graph of tensor operations and running backpropagation over it — that underlies frameworks like PyTorch and TensorFlow. I used the finished engine to train a logistic regression classifier end-to-end, verifying that gradients computed through the graph actually drive a real model to converge.

Continue to update… soon.