<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Gradients on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/gradients/</link>
    <description>Recent content in Gradients on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 08 Aug 2026 15:05:00 +0100</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/gradients/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Models From First Principles 07: PACS — Building an Optimizer From Gradient Statistics</title>
      <link>http://programmer.ie/post/models-from-first-principles-07/</link>
      <pubDate>Sat, 08 Aug 2026 15:05:00 +0100</pubDate>
      <guid>http://programmer.ie/post/models-from-first-principles-07/</guid>
      <description>&lt;h1 id=&#34;pacs--building-an-optimizer-from-gradient-statistics&#34;&gt;PACS — Building an Optimizer From Gradient Statistics&lt;/h1&gt;&#xA;&lt;p&gt;So far in &lt;strong&gt;Models From First Principles&lt;/strong&gt;, every post has asked some version of the same question:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;What should the model compute?&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;MR.Q gave us a scalar quality estimate.&lt;/p&gt;&#xA;&lt;p&gt;EBT split one shared representation into Q, V and Policy.&lt;/p&gt;&#xA;&lt;p&gt;SICQL made those heads explicit, replaceable components.&lt;/p&gt;&#xA;&lt;p&gt;HRM introduced repeated computation over fast and slow latent states.&lt;/p&gt;&#xA;&lt;p&gt;Tiny compressed iterative refinement into one recursive latent state.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PyTorch Model Not Learning? A Systematic Debugging Guide</title>
      <link>http://programmer.ie/post/pytorch-zero-to-hero-08/</link>
      <pubDate>Sat, 08 Aug 2026 13:51:00 +0100</pubDate>
      <guid>http://programmer.ie/post/pytorch-zero-to-hero-08/</guid>
      <description>&lt;h2 id=&#34;pytorch-zero-to-hero--step-08&#34;&gt;PyTorch: Zero to Hero — Step 08&lt;/h2&gt;&#xA;&lt;p&gt;Your model runs.&lt;/p&gt;&#xA;&lt;p&gt;The loss is finite.&lt;/p&gt;&#xA;&lt;p&gt;Nothing crashes.&lt;/p&gt;&#xA;&lt;p&gt;And it still does not learn.&lt;/p&gt;&#xA;&lt;p&gt;This is one of the most frustrating states in machine learning because there is no stack trace telling you what is wrong.&lt;/p&gt;&#xA;&lt;p&gt;The program is valid Python.&lt;/p&gt;&#xA;&lt;p&gt;The tensors have legal shapes.&lt;/p&gt;&#xA;&lt;p&gt;The GPU is busy.&lt;/p&gt;&#xA;&lt;p&gt;The optimizer is stepping.&lt;/p&gt;&#xA;&lt;p&gt;And the model is useless.&lt;/p&gt;&#xA;&lt;p&gt;This post is a systematic way to debug that situation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PyTorch Autograd Debugging: requires_grad, detach, backward() and NaN Gradients</title>
      <link>http://programmer.ie/post/pytorch-zero-to-hero-02/</link>
      <pubDate>Sat, 08 Aug 2026 12:55:00 +0100</pubDate>
      <guid>http://programmer.ie/post/pytorch-zero-to-hero-02/</guid>
      <description>&lt;h2 id=&#34;pytorch-zero-to-hero--step-02&#34;&gt;PyTorch: Zero to Hero — Step 02&lt;/h2&gt;&#xA;&lt;p&gt;In the previous post we treated tensor shapes as a debugging problem rather than a mathematical vocabulary exercise.&lt;/p&gt;&#xA;&lt;p&gt;We are going to do the same thing with autograd.&lt;/p&gt;&#xA;&lt;p&gt;If you use PyTorch for any serious amount of time, you eventually see errors like:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;RuntimeError: Trying to backward through the graph a second time...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or worse:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
