---
title: "Backprop in Python"
description: "Backpropagate through y = wx + b by hand: save the forward values, send the loss gradient back to w and b, follow a branch, and check it with autograd."
canonical_url: "https://fanout.sh/ai/lessons/math-fundamentals-backprop-python"
md_url: "https://fanout.sh/ai/lessons/math-fundamentals-backprop-python.md"
access: "pro-preview"
---

# Backprop in Python

Backpropagate through y = wx + b by hand: save the forward values, send the loss gradient back to w and b, follow a branch, and check it with autograd.

- Access: Fanout Pro (public preview)
- Module: Math Fundamentals

## A glimpse of Backprop in Python

A model predicts y = wx + b. Its input is x; w and b are numbers we can adjust. We want the prediction to match a target, t.

Use x = 2, w = 3, b = 1 and t = 5. The model predicts 7, which is 2 too high. Squaring that error gives a loss, L = (y − t)² = 4.

## Continue learning

Pro unlocks guided learning, complete notes, practical walkthroughs, exercises, and every AI Research lesson.

---
This representation contains public Fanout content only. Protected Pro lessons, account data, billing, checkout, and pricing are not included.

Browse the public content map: https://fanout.sh/sitemap.md
