<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Autograd on Sanketh's Blog</title><link>https://sankethbk.github.io/blog/tags/autograd/</link><description>Recent content in Autograd on Sanketh's Blog</description><generator>Hugo -- 0.166.0</generator><language>en-us</language><lastBuildDate>Sat, 12 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://sankethbk.github.io/blog/tags/autograd/index.xml" rel="self" type="application/rss+xml"/><item><title>Backpropagation in a Fully-Connected Network, From Scratch</title><link>https://sankethbk.github.io/blog/posts/ml/2026-09-12-3-backpropagation-in-a-fully-connected-network/</link><pubDate>Sat, 12 Sep 2026 00:00:00 +0000</pubDate><guid>https://sankethbk.github.io/blog/posts/ml/2026-09-12-3-backpropagation-in-a-fully-connected-network/</guid><description>&lt;ul&gt;
&lt;li&gt;Why is there no deadlock in the order of corrections?&lt;/li&gt;
&lt;li&gt;Why is this cheap enough to do for billions of parameters?&lt;/li&gt;
&lt;li&gt;What is PyTorch&amp;rsquo;s autograd doing when you call &lt;code&gt;loss.backward()&lt;/code&gt;?&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="1-what-you-will-learn"&gt;1. What you will learn&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The shape of a fully-connected (dense) network and what &amp;ldquo;fully-connected&amp;rdquo; means.&lt;/li&gt;
&lt;li&gt;How to forward a single training example through every operation, by hand.&lt;/li&gt;
&lt;li&gt;The backward pass as a message-passing process, with the exact algebra at each edge.&lt;/li&gt;
&lt;li&gt;The recursion that lets you go from 2 layers to 100 layers.&lt;/li&gt;
&lt;li&gt;Why nothing breaks due to ordering — the backward pass &lt;em&gt;computes&lt;/em&gt; gradients; it does not &lt;em&gt;apply&lt;/em&gt; updates.&lt;/li&gt;
&lt;li&gt;Why backprop costs about one extra forward pass, not one forward pass per parameter.&lt;/li&gt;
&lt;li&gt;A pseudocode implementation of the whole algorithm.&lt;/li&gt;
&lt;li&gt;What an autograd engine records, and how &lt;code&gt;loss.backward()&lt;/code&gt; / &lt;code&gt;optimizer.step()&lt;/code&gt; / &lt;code&gt;optimizer.zero_grad()&lt;/code&gt; map onto what we do by hand.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="2-the-network-we-are-going-to-train"&gt;2. The network we are going to train&lt;/h2&gt;
&lt;p&gt;Logistic regression is a single layer: input → weighted sum → sigmoid → probability. Its decision boundary is a line (or hyperplane). There is a famous class of problems it cannot solve — XOR is the classic example — where no single line separates the two classes.&lt;/p&gt;</description></item></channel></rss>