<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>NumPy on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/numpy/</link>
    <description>Recent content in NumPy on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 10 Aug 2026 20:53:00 +0100</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/numpy/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Cellular Automata From First Principles 50: Vectorize the Update Loop</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-50/</link>
      <pubDate>Mon, 10 Aug 2026 20:53:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-50/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-50-vectorize-the-update-loop&#34;&gt;Cellular Automata From First Principles 50: Vectorize the Update Loop&lt;/h1&gt;&#xA;&lt;p&gt;A cellular automaton is local.&lt;/p&gt;&#xA;&lt;p&gt;That does &lt;strong&gt;not&lt;/strong&gt; mean we should update it cell by cell in Python.&lt;/p&gt;&#xA;&lt;p&gt;For dense grids, the same local rule is applied everywhere. That regularity is exactly what array programming is good at.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;start-with-the-obvious-implementation&#34;&gt;Start with the obvious implementation&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:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;life_step_slow&lt;/span&gt;(grid):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    height, width &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; grid&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;shape&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    next_grid &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;zeros_like(grid)&#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;    &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; y &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; range(height):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; x &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; range(width):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            total &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;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:#66d9ef&#34;&gt;for&lt;/span&gt; dy &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; (&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;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:#66d9ef&#34;&gt;for&lt;/span&gt; dx &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; (&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;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:#66d9ef&#34;&gt;if&lt;/span&gt; dx &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;and&lt;/span&gt; dy &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;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:#66d9ef&#34;&gt;continue&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    total &lt;span style=&#34;color:#f92672&#34;&gt;+=&lt;/span&gt; grid[(y &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; dy) &lt;span style=&#34;color:#f92672&#34;&gt;%&lt;/span&gt; height, (x &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; dx) &lt;span style=&#34;color:#f92672&#34;&gt;%&lt;/span&gt; width]&#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;            alive &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; grid[y, x] &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            next_grid[y, x] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                total &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;or&lt;/span&gt; (alive &lt;span style=&#34;color:#f92672&#34;&gt;and&lt;/span&gt; total &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&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;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;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; next_grid&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is useful because it states the mechanism clearly.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 11: Diffusion as Local Exchange</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-11/</link>
      <pubDate>Mon, 10 Aug 2026 18:40:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-11/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-11-diffusion-as-local-exchange&#34;&gt;Cellular Automata From First Principles 11: Diffusion as Local Exchange&lt;/h1&gt;&#xA;&lt;p&gt;Until now most cells have stored discrete state:&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;0 / 1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;empty / tree / fire&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;road / car&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let each cell store a continuous quantity.&lt;/p&gt;&#xA;&lt;p&gt;For diffusion:&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;state[y, x] = concentration&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The local transition is no longer birth, death or movement.&lt;/p&gt;&#xA;&lt;p&gt;It is local exchange.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;start-with-a-pulse&#34;&gt;Start with a pulse&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;size &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;121&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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;grid &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;zeros(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    (size, size),&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    dtype&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;float64,&#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;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;grid[&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    size &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    size &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&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:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1.0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At the beginning one cell contains all the concentration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 09: Build a Forest Fire Simulation</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-09/</link>
      <pubDate>Mon, 10 Aug 2026 18:36:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-09/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-09-build-a-forest-fire-simulation&#34;&gt;Cellular Automata From First Principles 09: Build a Forest Fire Simulation&lt;/h1&gt;&#xA;&lt;p&gt;A forest fire is almost an ideal cellular-automaton exercise.&lt;/p&gt;&#xA;&lt;p&gt;The visible states are obvious:&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;0 = empty&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;1 = tree&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;2 = burning&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The interactions are local.&lt;/p&gt;&#xA;&lt;p&gt;And small changes in fuel density or ignition assumptions can produce very different global outcomes.&lt;/p&gt;&#xA;&lt;p&gt;This is not intended as a high-fidelity wildfire model.&lt;/p&gt;&#xA;&lt;p&gt;It is a deliberately simplified &lt;strong&gt;spread model&lt;/strong&gt; designed to isolate one mechanism:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 08: Add Randomness Without Losing the Model</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-08/</link>
      <pubDate>Mon, 10 Aug 2026 18:34:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-08/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-08-add-randomness-without-losing-the-model&#34;&gt;Cellular Automata From First Principles 08: Add Randomness Without Losing the Model&lt;/h1&gt;&#xA;&lt;p&gt;So far every transition in the book has been deterministic.&lt;/p&gt;&#xA;&lt;p&gt;Given the same state, the next state is fixed.&lt;/p&gt;&#xA;&lt;p&gt;That makes deterministic automata unusually easy to debug: if we preserve the initial condition and rule, we preserve the trajectory.&lt;/p&gt;&#xA;&lt;p&gt;But many useful models need another ingredient.&lt;/p&gt;&#xA;&lt;p&gt;A tree may ignite.&lt;/p&gt;&#xA;&lt;p&gt;An organism may reproduce.&lt;/p&gt;&#xA;&lt;p&gt;A driver may hesitate.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 05: Conway&#39;s Game of Life</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-05/</link>
      <pubDate>Mon, 10 Aug 2026 18:25:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-05/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-05-conways-game-of-life&#34;&gt;Cellular Automata From First Principles 05: Conway&amp;rsquo;s Game of Life&lt;/h1&gt;&#xA;&lt;p&gt;Conway&amp;rsquo;s Game of Life is one of the cleanest examples of complex two-dimensional behavior emerging from a tiny local rule.&lt;/p&gt;&#xA;&lt;p&gt;The world is a grid of dead and live cells.&lt;/p&gt;&#xA;&lt;p&gt;Each cell sees its eight surrounding neighbors.&lt;/p&gt;&#xA;&lt;p&gt;Then four ideas decide the next generation:&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;underpopulation&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;survival&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;overpopulation&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;birth&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The standard rule is usually written &lt;strong&gt;B3/S23&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a dead cell is born with exactly 3 live neighbors,&lt;/li&gt;&#xA;&lt;li&gt;a live cell survives with 2 or 3 live neighbors.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Everything else becomes or remains dead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 01: Build Your First Automaton</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-01/</link>
      <pubDate>Mon, 10 Aug 2026 18:21:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-01/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-01-build-your-first-automaton&#34;&gt;Cellular Automata From First Principles 01: Build Your First Automaton&lt;/h1&gt;&#xA;&lt;p&gt;In the previous chapter we reduced a cellular automaton to four things:&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;space&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;neighborhood&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rule&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we are going to build one.&lt;/p&gt;&#xA;&lt;p&gt;Not a framework.&lt;/p&gt;&#xA;&lt;p&gt;Not a library.&lt;/p&gt;&#xA;&lt;p&gt;One update step.&lt;/p&gt;&#xA;&lt;p&gt;That is enough to expose the whole mechanism.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;start-with-a-one-dimensional-world&#34;&gt;Start with a one-dimensional world&lt;/h2&gt;&#xA;&lt;p&gt;Create a row of cells and turn on the centre cell:&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-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;width &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;41&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;zeros(width, dtype&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;uint8)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state[width &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(state)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Conceptually:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
