ArticlesProjectsWeeklyCredentialsAbout

Backpropagation from Scratch in NumPy

A two-layer neural network trained with hand-rolled backprop in NumPy — forward pass, loss, analytic gradients via the chain rule, and a parameter update loop — no autograd, no magic.

machine-learningneural-networksdeep-learning

Forward pass, chain-rule gradients, and SGD update — backprop written out long-hand in NumPy so nothing is hidden.

Source code
# Backpropagation from Scratch

Code from the article [How Neural Networks Actually Learn: Backpropagation Explained](https://rishisharma.in/articles/backpropagation-explained).

Requires Python 3.8+ and NumPy.

```sh
pip install numpy
python backprop.py
```

## Contents

- `backprop.py` — a two-layer network trained on XOR, with every gradient step written out long-hand — no autograd