<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Convolution on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/convolution/</link>
    <description>Recent content in Convolution on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 10 Aug 2026 20:55:00 +0100</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/convolution/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Cellular Automata From First Principles 52: Use FFTs for Large Neighborhoods</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-52/</link>
      <pubDate>Mon, 10 Aug 2026 20:55:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-52/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-52-use-ffts-for-large-neighborhoods&#34;&gt;Cellular Automata From First Principles 52: Use FFTs for Large Neighborhoods&lt;/h1&gt;&#xA;&lt;p&gt;Small local neighborhoods are cheap to evaluate directly.&lt;/p&gt;&#xA;&lt;p&gt;Large smooth kernels are different.&lt;/p&gt;&#xA;&lt;p&gt;Lenia taught us that a neighborhood may cover dozens of cells in every direction. At that scale, direct convolution can become expensive.&lt;/p&gt;&#xA;&lt;p&gt;The Fourier transform gives us another route.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;convolution-becomes-multiplication&#34;&gt;Convolution becomes multiplication&lt;/h2&gt;&#xA;&lt;p&gt;For periodic domains:&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;convolution in space&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        ↕&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;multiplication in frequency&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So instead of sliding a large kernel over every location, we can transform both arrays, multiply them, and transform back.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 28: Neighborhoods as Convolution Kernels</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-28/</link>
      <pubDate>Mon, 10 Aug 2026 19:45:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-28/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-28-neighborhoods-as-convolution-kernels&#34;&gt;Cellular Automata From First Principles 28: Neighborhoods as Convolution Kernels&lt;/h1&gt;&#xA;&lt;p&gt;A neighborhood does not have to be a list of nearby coordinates.&lt;/p&gt;&#xA;&lt;p&gt;It can be a &lt;strong&gt;spatial weighting function&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That lets us say:&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;cells near this radius matter a lot&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cells closer in matter less&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cells farther away do not matter at all&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The standard programming tool for applying that same weighted neighborhood everywhere is convolution.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;start-with-a-small-kernel&#34;&gt;Start with a small kernel&lt;/h2&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-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;kernel &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;array([&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    [&lt;span style=&#34;color:#ae81ff&#34;&gt;0.0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    [&lt;span style=&#34;color:#ae81ff&#34;&gt;0.1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.6&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.1&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    [&lt;span style=&#34;color:#ae81ff&#34;&gt;0.0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;])&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Normalize it:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
