<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Moritz Kirschte on Medium]]></title>
        <description><![CDATA[Stories by Moritz Kirschte on Medium]]></description>
        <link>https://medium.com/@kirschte?source=rss-e9624bd27418------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pyN-boZNPQq9SitEVxNkkA.jpeg</url>
            <title>Stories by Moritz Kirschte on Medium</title>
            <link>https://medium.com/@kirschte?source=rss-e9624bd27418------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:37:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kirschte/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Turing Machine with Reinforcement Learning]]></title>
            <link>https://medium.com/data-science/building-a-turing-machine-with-reinforcement-learning-9d06a4f0ce6?source=rss-e9624bd27418------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d06a4f0ce6</guid>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Moritz Kirschte]]></dc:creator>
            <pubDate>Fri, 19 Apr 2019 12:47:57 GMT</pubDate>
            <atom:updated>2019-04-19T17:36:25.981Z</atom:updated>
            <content:encoded><![CDATA[<h4>beyond manual algorithmic design</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_s3lrbYYby3hzSGAmll7A.jpeg" /><figcaption>Alan Turing. A name on which the beginning of an era is manifested. The Turing Award remembers each year on him, lastly to our »<a href="https://www.acm.org/media-center/2019/march/turing-award-2018">Fathers of Deep Learning</a>«.</figcaption></figure><p>I’ll be honest with you, there is no such thing in computer science which is more boring than yet another sorting algorithm. However, this time sorting is just a representation of a universal Turing machine self-learned with an advanced Reinforcement Learning framework.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FxT9IgnBxp2Jp8WWtVK%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fmovie-glengarry-glen-ross-xT9IgnBxp2Jp8WWtVK&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2FxT9IgnBxp2Jp8WWtVK%2Fgiphy.gif%3Fcid%3D790b76115a0708ed9b249d6b5b36b24e958b30b5acbeae02%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="183" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd79fe9c62e79ab4f24847470121946a/href">https://medium.com/media/bd79fe9c62e79ab4f24847470121946a/href</a></iframe><p>As a matter of fact, coming up with an efficient optimization algorithm takes a lot of time, resources and efforts. Moreover, you never know if there is still a more efficient version. Yet until the 1960s before the invention of Quicksort, sorting was known as an <em>O(n²)</em>-problem and took a lot of time. Not even to mention the hilarious race of optimizing matrix multiplications as presented in the graph below…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3lZNdxlUk1zagqOAHErnnQ.png" /><figcaption>Matrix multiplication is known to be in <em>O</em>(<em>n^ω</em>). Currently: <em>ω</em>=2.3728639.</figcaption></figure><p>This is where Reinforcement Learning comes into place: It is not just able to act as a universal heuristic toolkit moreover it could serve as a way of figuring out a mathematically-proven new algorithm in the optimization domain.</p><p>In the following, I’ll show you exactly the latter with the example of sorting. However, please feel free to apply this framework for your own needs, and perhaps you’re able to proof by contradiction the <a href="https://en.wikipedia.org/wiki/P_versus_NP_problem"><em>P=NP</em>-Problem</a> through solving an NP-complete problem in polynomial time: It’d be a pleasure for me to get a part of that $1,000,000 price. ;)</p><h3>Why should I bother?</h3><p>Optimization takes place in any industry. Essentially there is no place where someone couldn’t optimize something.</p><p>However, the crucial part is that given the needed data most of the time we not only don’t know a suitable algorithm to optimize a certain problem moreover we are relying on an intense thinking process combined with good ideas and a long-breathed try-and-error procedure.</p><p>Wouldn’t it be nice to leave the optimization to a universal framework, so that defining an objective (e.g. an optimal strategy) is enough? Requirements to such a system would yield to:</p><ul><li>Convergence to a valid generalized solution</li><li>Significant outperformance of brute force</li><li>Time-efficiency during test time.</li></ul><p>By making use of <a href="https://towardsdatascience.com/what-to-expect-from-reinforcement-learning-a22e8c16f40c">Reinforcement Learning </a>— one latest advance in Machine Learning — we should be able to meet those requirements. See, if we’ll get to that later in this article. ;)</p><h4>Okay, fair enough. Any concrete use cases?</h4><p>Sure. How about</p><ul><li><strong>Logistics</strong>: <a href="https://www.npr.org/2018/11/21/660168325/optimized-prime-how-ai-and-anticipation-power-amazons-1-hour-deliveries?t=1554890603422">anticipatory shipping</a>, <a href="https://medium.com/@RemiStudios/artificial-intelligence-for-inventory-management-c8a9c0c2a694">inventory management</a>, <a href="https://www.youtube.com/watch?v=gdwWrf9roDU">efficient trucking</a> and even <a href="https://www.youtube.com/watch?v=Vv-tYg03xlU">a fully-utilized uber/cab/bus drive</a>.</li><li><strong>Architecture</strong>: <a href="https://inbuildingtech.com/ai-ml/ai-ml-smart-building/">smart building</a> e.g. <a href="https://arxiv.org/pdf/1901.04693.pdf">energy management</a>, <a href="https://papers.nips.cc/paper/1073-improving-elevator-performance-using-reinforcement-learning.pdf">elevator scheduling</a>, etc.</li><li><strong>E-commerce</strong>: <a href="https://blog.acolyer.org/2017/09/27/an-efficient-bandit-algorithm-for-real-time-multivariate-optimization/">UX/I optimization</a>, <a href="https://www.youtube.com/watch?v=kY-BCNHd_dM">movie recommendations</a>, <a href="https://arxiv.org/pdf/1803.09967.pdf">dynamic pricing</a>, etc.</li><li><strong>Computer Science</strong>: <a href="http://axon.cs.byu.edu/papers/Spencer.CEC10.pdf">sorting</a>, <a href="https://arxiv.org/abs/1611.09940">neural combinatorial optimization (e.g. traveling salesman)</a>, <a href="https://arxiv.org/abs/1807.08518">neural Turing machines</a>, <a href="https://deepmind.com/blog/deepmind-ai-reduces-google-data-centre-cooling-bill-40/">data centre cooling</a>, etc.</li></ul><h4>Convinced? Now about the technology…</h4><p>For illustration purpose, I chose to learn a sorting algorithm because it&#39;s easy to verify. However, the following framework available on my GitHub could be used for other optimization techniques as well:</p><p><a href="https://github.com/moritzmoritz98/rlopt">moritzmoritz98/rlopt</a></p><h3>The algorithm</h3><ol><li><strong>Learn</strong> the task through a Q-table using the Bellman equation.</li><li><strong>Collect</strong> all used states for solving the task in a transition table.</li><li><strong>Reconstruct</strong> the learned algorithm either through<br>- a <em>final-state-machine (fsm) graph</em> (automatically),<br>- a <em>lambda function based on the transition table</em> (automatically) or<br>- a <em>simplified fsm and code version</em> (manually) for algorithm speedup.</li></ol><p>In the learning phase, we aim to learn an algorithm solving the sorting objective. For that, I chose the tabular Q-learning algorithm as one specificity of Reinforcement Learning due to its easy notation and interpretability.</p><p>For those of you how are not familiar with tabular Q-learning, essentially we’re spanning actions on the columns and states in the rows where each cell determines the expected future reward in that state by taking its action. The learning process (also called Bellman backup) is described in the picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*PU_LnsmUVYG-4KzoEQI4pw.png" /><figcaption>The Bellman equation: Q(s,a) = r + γ*max Q(s’, a’)</figcaption></figure><p>In case of further interest, take a look at <a href="https://gist.github.com/moritzmoritz98/b9a4d7159cda1514192f632400ad4032">my gist</a> about how tabular Q-learning is functioning.</p><p>In Reinforcement Learning and so in tabular Q-Learning <em>actions</em>, <em>states</em> and <em>rewards</em> are to be defined. Since we aim for a generalized algorithm we have to take special care on how to choose them.</p><p>In essence, we’re designing a multi-head (two heads: <strong>I</strong> and <strong>J</strong>) Turing machine M=⟨ Q, Γ, s, b, F, δ ⟩ processing on its tape a to-be-sorted list <strong>L</strong>. In contrast to existing techniques like Alex Graves’ <a href="https://arxiv.org/abs/1410.5401">Neural Turing Machines</a> in this work, I used a much simpler approach with the price of less customizability but instead with higher interpretability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTbFtU3Xrnalz0fsL8CAKA.png" /><figcaption>Example <a href="https://commons.wikimedia.org/wiki/File:MonusTuringMachine_svg.svg">Turing machine to compute the truncated subtraction (“monus”), after John E. Hopcroft and Jeffrey D. Ullman (1979).</a> In our case, the finite control table corresponds to the learned Q-table applied on a numerical list on the tape.</figcaption></figure><h4><strong>Q — states, 324</strong></h4><p>The states have to be independent of the tape, therefore, I refer to them as the RL-dependent variables.</p><ol><li><strong>L</strong>[<strong>I</strong>] ≥ <strong>L</strong>[<strong>J</strong>] ∈ {0, 1}</li><li><strong>I </strong>compare to <strong>J</strong>:<strong> </strong><strong>I</strong>&lt;<strong>J</strong>|<strong>I</strong>==<strong>J</strong>|<strong>I</strong>&gt;<strong>J </strong>∈ {-1, 0, 1}</li><li><strong>I</strong> == 0 | between |<strong>I</strong> == len(<strong>L</strong>) ∈ {-1, 0, 1}</li><li><strong>J</strong> == 0 | between |<strong>J</strong> == len(<strong>L</strong>) ∈ {-1, 0, 1}</li><li>last_action ∈ {0, 1, 2, 3, 4, 5}</li></ol><p>In detail, the first state is binary, whereas the next ones are ternary and the last one 6-nary hence they could be represented by one boolean, three trileans, and one hexalean resulting in 2¹×3³×6¹=324 different states. Quite low-dimensional actually but still enough to successfully learn a sorting algorithm.</p><h4>Γ — tape alphabet symbols: actions, 6</h4><p>In the code I used the following alphabet:<br><em>TERMINATE</em>,<br><em>INCI</em>,<br><em>INCJ</em>,<br><em>RESETI</em>,<br><em>RESETJ</em>,<br><em>SWAP</em> (values at <strong>I</strong> and <strong>J</strong>).</p><p>There are basically two heads on our Turing machine positioned at <strong>I </strong>and <strong>J</strong>. By increasing one of them or resetting them to zero the machine has the ability to move within the tape. Swapping is the only tape-modifying action and terminating simulates a halting signal by the machine. Funnily, <a href="https://en.wikipedia.org/wiki/Halting_problem">Hilbert’s halting problem</a> occurred during one of my experiments, too.</p><p>Note that, one could separate the tape movement with the actual program however, I personally decided against this formalism due to practical considerations. Moreover, the ‘<em>TERMINATE</em>’ action is a workaround too in order to ensure halting.</p><p>Essentially, just ‘SWAP’ and ‘<em>NOOP</em>’ should be part of Γ.</p><h4>s ∈ Q — initial state</h4><p>i=0; j=0; last_action = ‘<em>TERMINATE</em>’ → -1|-1|0|?|0 in state encoding.</p><h4>b ∈ Γ — blank symbol</h4><p>No blank symbol included due to simplicity however, one could think of adding a ‘<em>NOOP</em>’ operation.</p><h4>F ⊆ Q — final/accepting states</h4><p>Those are learned by the Reinforcement Learning algorithm.</p><h4>δ : (Q∖F)×Γ → Q×Γ×{I0, J0, I++, J++} — transition function</h4><p>Learned with the algorithm: Every non-final state from Q paired with an action from Γ has a deterministic result consisting of a next state landing in by taking an action from Γ together with a tape movement (i.e. one of <em>INCI</em>, <em>INCJ</em>, <em>RESETI</em>, <em>RESETJ</em>).</p><p>Later, I’ll visualize this transition table when we’ll discuss the results.</p><h4>Reward</h4><p>Although not part of a Turing machine, the reward is needed to learn a sorting behavior with Reinforcement Learning. For that, I decided to make the reward function as sparse and simple as possible to leave enough free space for the algorithm to unfold itself:</p><ul><li>± 300: If terminated in a sorted state</li><li>± 10: If swapped correctly</li></ul><p>Even though I didn’t specify that out-of-bounds access is prohibited the program learned that on its own (a useless action decreases the seen reward).</p><p>Also note, that in this scenario a sparse reward has its opportunity with respect to the final performance however, it significantly increases the time to learn especially when dealing with random exploration techniques. Instead by applying a histogram exploration, each state is enforced with a bonus term depending on its novelty to the algorithm. This behavior removes the sparsity of the reward function in the beginning phase as well as increases the chance of reaching a global maximum.</p><p>After making use of this advanced histogram exploration technique, the algorithm is able to solve the list in a few 1k steps nonetheless, it still needs 5M steps to be certain and optimal in its outcome.</p><h4><strong>Input data</strong></h4><p>One small notice on the input data: I generated all possible permutations of list length between three and six (870 distinctive’s) to mitigate any thinkable overfitting issues.</p><h3>Results</h3><p>Congratulations! You made it through the tough technical part. Now you wanna see results, right?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b3b0da30ff67b2fbd0e7989a64587213/href">https://medium.com/media/b3b0da30ff67b2fbd0e7989a64587213/href</a></iframe><p>Okay, you got me. The table doesn’t look brilliant yet, right?</p><p>Nonetheless, it&#39;s worth mentioning what happened here. Basically, I learned the <em>(324,6)</em>-Q-table over <em>5,000,000</em> steps and “tested” it by predicting all <em>870</em> distinctive permutations of a list (length: 3 to 6) plus <em>5,040</em> permutations of list length 7 and collected during execution what states are actually used and what kind of actions are taken in that states.</p><p>Surprisingly, there aren’t many unique states (essentially <em>20</em>) and moreover, the algorithm does generalize well to the <em>5,040</em> 7th-list-permutations without any error.</p><p>I’d really like to emphasize that point again: With just 5M steps and training data of a small subset of all infinite possible lists combined with an easy hand-crafted reward function, we were able to teach an algorithm or a universe Turing machine respectively how to sort.</p><blockquote>Could you now imagine how easily one could advance this to other optimization dilemmas?</blockquote><p>However, we’re still not at the destination of our journey yet unless you’re able to read and actively understand our learned algorithm from those <em>20</em> lines or eventually from below’s GraphViz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bekCCm8LZjpbTFBmsY18tw.png" /><figcaption>An astonishing transition graph, isn’t it?</figcaption></figure><h4>The complete Turing Machine</h4><p>In the algorithmic description, I left off the final states set and the transition function as it’s learned by our Q-learning. Now we are able to define our Turing machine altogether.</p><p>First, the final states set is simple, it’s state 16 as seen in the transition graph.</p><p>Second, our transition function gets a little bit trickier as a more readable version than the formally correct from above’s graph and table is intended. Despite being not a valid transition function anymore, I’m really happy to actually shortened it to 4 distinct situation in which a question mark represents irrelevancy.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4bd159774d5bb682cee3d0dd4f41cd86/href">https://medium.com/media/4bd159774d5bb682cee3d0dd4f41cd86/href</a></iframe><p>Finally, from the simplified transition table, it is quite intuitive to actually code it statically: <em>Our main goal of this post</em>!</p><pre>j <strong>&lt;-</strong> <em>0</em><br>i <strong>&lt;-</strong> <em>1</em><br><strong>while</strong> action <strong>is not</strong> <em>TERMINATE</em>:<br>    <strong>if</strong> i <strong>==</strong> <em>len</em>(l):<br>        action <strong>&lt;-</strong> <em>TERMINATE</em><br>    <strong>elif</strong> l[i] <strong>&gt;</strong> l[j]:<br>        movement <strong>&lt;-</strong> <em>INCJ</em><br>    <strong>elif</strong> i <strong>&gt;</strong> j:<br>        action <strong>&lt;-</strong> SWAP<br>        movement <strong>&lt;-</strong> <em>INCJ</em><br>    <strong>else</strong>:<br>        movement <strong>&lt;-</strong> <em>RESETJ</em><br>        movement <strong>&lt;-</strong> <em>INCI</em></pre><p>To be honest, until now I have no clue if Reinforcement Learning was in this case actually able to find a new sorting algorithm or just a very unpopular one. About the only thing I am certain is that it is actually sorting any arbitrary list a 100%-correctly!</p><p>That said, I’d really appreciate it, if you could leave a note about what kind of algorithm that looks like to you!</p><h4>Performance evaluation</h4><p>As a result of the limited action space, learning something better than <em>O(n²)</em> is per definition implausible. Nonetheless, the following algorithmic complexities could be obtained.</p><p>Non-simplified / raw version w.r.t. the number of needed steps:</p><ul><li><em>Min</em>: O(0.5n² + 1.5n + 1)</li><li><em>Max</em>: O(n² + n + 1)</li></ul><p>On the simplified version however it’s faster and (surprisingly) constant:</p><ul><li><em>Min</em>/<em>Max</em>: O(0.5n² + 0.5n)</li></ul><p>Note, that by splitting the tape movements (i.e. <em>I0</em>, <em>J0</em>,<em> I++</em>, <em>J++</em>) from the actual algorithmic-related action alphabet (i.e. <em>SWAP</em>, <em>TERMINATE</em>, <em>NOOP</em>) one could improve the algorithmic performance since with an action most of the time also a movement on the tape is required and vice versa. However, I’ll leave that for future work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*-YQmw6PMG0gNqr6fP_Lvnw.png" /><figcaption>RLSort vs. BubbleSort</figcaption></figure><p>Unfortunately, my RLSort algorithm is not as fast as bubble sort probably due to overhead and the matter of a fact that for-loops are better optimized on a CPU than a while-loop with an abort criterion. Additionally, the lower performance bound is with <em>O(n²)</em> not competitive with a quick <em>O(n)</em>-validation check: He is doing a lot of nonsense with an already sorted list!</p><h3>Try it on your own!</h3><p>I really like to encourage you to try this out and apply this framework for your own ideas. In case you’re optimizing on something similar to a list, it’s just three simple steps and a few minutes of your CPU:</p><ol><li>Check out my <a href="https://github.com/moritzmoritz98/rlopt">repo</a>.</li><li>Adapt the <a href="https://github.com/moritzmoritz98/rlopt/blob/master/rlopt/env/env.py#L112">reward function</a> to your needs.</li><li>Be patient until the algorithm finds your (hopefully) generalized solution.</li></ol><p>You won’t just get the result of an optimized list of your training data, you’ll also receive a <a href="https://github.com/moritzmoritz98/rlopt/blob/master/rlopt/rl_sorting.py#L187">reconstructed ready-to-use lambda function</a>!</p><p>Of course, please let me know about your use case! I’m really interested in hearing your unique story with my framework. :)</p><h4>Amendment</h4><p>Below you’ll find an example call of <em>RLSort</em> sorting [6 4 3 7 0] clueing about how the learned sorting algorithm works in detail: Have fun with the riddle!</p><pre>  <em>2</em> <em>&lt;&lt;-</em> [6 4 3 7 0], <strong>i</strong>=<em>0</em>, <strong>j</strong>=<em>0</em>: <em>INCI</em>.<br> <em>64</em> <em>&lt;&lt;- </em>[6 4 3 7 0], <strong>i</strong>=<em>1</em>, <strong>j</strong>=<em>0</em>: <em>SWAP</em>.<br><em>281</em> <em>&lt;&lt;- </em>[4 6 3 7 0], <strong>i</strong>=<em>1</em>, <strong>j</strong>=<em>0</em>: <em>INCJ</em>.<br><em>134</em> <em>&lt;&lt;- </em>[4 6 3 7 0], <strong>i</strong>=<em>1</em>, <strong>j</strong>=<em>1</em>: <em>RESETJ</em>.<br><em>227</em> <em>&lt;&lt;- </em>[4 6 3 7 0], <strong>i</strong>=<em>1</em>, <strong>j</strong>=<em>0</em>: <em>INCI</em>.<br> <em>64</em> <em>&lt;&lt;- </em>[4 6 3 7 0], <strong>i</strong>=<em>2</em>, <strong>j</strong>=<em>0</em>: <em>SWAP</em>.<br><em>281</em> &lt;&lt;- [3 6 4 7 0], <strong>i</strong>=<em>2</em>, <strong>j</strong>=<em>0</em>: <em>INCJ</em>.<br><em>136</em> <em>&lt;&lt;- </em>[3 6 4 7 0], <strong>i</strong>=<em>2</em>, <strong>j</strong>=<em>1</em>: <em>SWAP</em>.<br><em>299</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>2</em>, <strong>j</strong>=<em>1</em>: <em>INCJ</em>.<br><em>134</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>2</em>, <strong>j</strong>=<em>2</em>: <em>RESETJ</em>.<br><em>227</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>2</em>, <strong>j</strong>=<em>0</em>: <em>INCI</em>.<br> <em>65</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>3</em>, <strong>j</strong>=<em>0</em>: <em>INCJ</em>.<br><em>137</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>3</em>, <strong>j</strong>=<em>1</em>: <em>INCJ</em>.<br><em>137</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>3</em>, <strong>j</strong>=<em>2</em>: <em>INCJ</em>.<br><em>134</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>3</em>, <strong>j</strong>=<em>3</em>: <em>RESETJ</em>.<br><em>227</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>3</em>, <strong>j</strong>=<em>0</em>: <em>INCI</em>.<br> <em>64</em> <em>&lt;&lt;- </em>[3 4 6 7 0], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>0</em>: <em>SWAP</em>.<br><em>281</em> <em>&lt;&lt;- </em>[0 4 6 7 3], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>0</em>: <em>INCJ</em>.<br><em>136</em> <em>&lt;&lt;- </em>[0 4 6 7 3], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>1</em>: <em>SWAP</em>.<br><em>299</em> <em>&lt;&lt;- </em>[0 3 6 7 4], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>1</em>: <em>INCJ</em>.<br><em>136</em> <em>&lt;&lt;- </em>[0 3 6 7 4], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>2</em>: <em>SWAP</em>.<br><em>299</em> <em>&lt;&lt;- </em>[0 3 4 7 6], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>2</em>: <em>INCJ</em>.<br><em>136</em> <em>&lt;&lt;- </em>[0 3 4 7 6], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>3</em>: <em>SWAP</em>.<br><em>299</em> <em>&lt;&lt;- </em>[0 3 4 6 7], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>3</em>: <em>INCJ</em>.<br><em>134</em> <em>&lt;&lt;- </em>[0 3 4 6 7], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>4</em>: <em>RESETJ</em>.<br><em>227</em> <em>&lt;&lt;- </em>[0 3 4 6 7], <strong>i</strong>=<em>4</em>, <strong>j</strong>=<em>0</em>: <em>INCI</em>.<br> <em>70</em> <em>&lt;&lt;- </em>[0 3 4 6 7], <strong>i</strong>=<em>5</em>, <strong>j</strong>=<em>0</em>: <em>RESETJ</em>.<br><em>232</em> <em>&lt;&lt;- </em>[0 3 4 6 7], <strong>i</strong>=<em>5</em>, <strong>j</strong>=<em>0</em>: <em>TERMINATE</em>.<br>Sorted list in <em>28</em> steps: <strong>[0 3 4 6 7]</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d06a4f0ce6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/building-a-turing-machine-with-reinforcement-learning-9d06a4f0ce6">Building a Turing Machine with Reinforcement Learning</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What to expect from Reinforcement Learning?]]></title>
            <link>https://medium.com/data-science/what-to-expect-from-reinforcement-learning-a22e8c16f40c?source=rss-e9624bd27418------2</link>
            <guid isPermaLink="false">https://medium.com/p/a22e8c16f40c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[inside-ai]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <dc:creator><![CDATA[Moritz Kirschte]]></dc:creator>
            <pubDate>Sat, 09 Mar 2019 19:05:10 GMT</pubDate>
            <atom:updated>2019-03-28T23:35:00.879Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsdatascience.com/inside-ai/home">Inside AI</a></h4><h4>And what’s beyond Imitation Learning?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*n6988tGzPaUscqrv9FjD4Q.gif" /><figcaption>The <a href="https://gym.openai.com/envs/LunarLanderContinuous-v2/">Lunar Lander</a></figcaption></figure><p>Geoffrey Hinton once gave the example of “The trophy would not fit in the suitcase because it was too [big/small]”, where it clearly depends on our own prior world knowledge to what “it” is referring to. We’re considerably confident that a suitcase is regularly bigger than a trophy so that either a “too big trophy” or a “too small suitcase” is meant.</p><p>That said, through naturally optimizing each sentence or even each document separately to its desired translation does not only suffer from its lacking real-world context furthermore it’s rather stochastic due to language as a fuzzy system. In this case, there are multiple valid translations although a perfect translation might be impossible to determine.</p><p>Nonetheless, there ought to be the most optimal translation for a given situation as expressed by metrics such as readability of the target group, persuasiveness or information density. By optimizing to those metrics though e.g. Reinforcement Learning instead of simply imitating human behavior as being practiced in supervised learning, we’re following a more end-to-end approach increasing the capabilities of our system considerably.</p><p>In this story, we’ll first cover a little bit of a context and first attempts of leveraging an AI-automation of complex tasks like self-driving cars, intelligent sorting robots, etc. through Imitation Learning. Then we’ll stick deeper into why Reinforcement Learning might be a more capable choice, when it’s worth to be considered and how it actually works in principle but also by sketching two popular algorithms abstractly. Summing up with encouragement on my behalf about seeking practical use cases of this powerful technique, does help to spread RL more over right into the industry where those algorithms support finding more beneficial solutions. Or a nerd would prefer saying:</p><blockquote>from __future__ import ultimate_ai_solution</blockquote><h3>Imitation Learning</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqhUvQiKec2U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqhUvQiKec2U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqhUvQiKec2U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e515a451b76c8094661b2a61d77d10e/href">https://medium.com/media/0e515a451b76c8094661b2a61d77d10e/href</a></iframe><p>Back in 2016, NVIDIA achieved ground truthing innovation: Instead of an explicit decomposition of the self-driving car objective (e.g. lane marking detection, path planning, etc.) in a hand-crafted internal representation, their system abstracts and optimizes all necessary processing steps including the internal representation automatically. In NVIDIA’s approach, the car’s reaction given certain feedback of its sensors (e.g. steering angle, speed, front image, etc.), which could, of course, preprocessed by advanced deep learning techniques, wasn’t explicitly programmed, alternatively they followed the concept of <em>Imitation Learning</em>.</p><blockquote>Imagine you’re driving a car now, would you break down your driving decision process into small criteria each by itself combined and finally evaluated with the help of a huge manifesto?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*a2W-Qm6vmebAgxx1DvFY3g.png" /><figcaption>NVIDIA’s imitation learning pipeline at DAVE-2</figcaption></figure><p>Never ever! We as humans learned how to drive once by an unknown learning function, which couldn’t be extracted. Nevertheless, the results of the learned driving function could be recorded (i.e. steering angle, speed, etc.), so that a neural network can learn how to map from a front-facing image sequence to exactly those desired action. This behavior cloning is done by NVIDIA’s DAVE-2 system and is called Imitation Learning, which by definition imitates the behavior of an already functional system by end-to-end training for the final action itself instead of fractions of what would be the final action.</p><p>Nonetheless, Imitation Learning suffers various issues, which could be in practice actually mitigated by workarounds in order to become functional, yet, it still remains under its possible capabilities:</p><ol><li><strong>Distribution mismatch</strong>: An initial try on imitation learning could be to collect tons of hours of human’s driver play, then train the system and hope for the best. This could work fine under the constraint that the neural network doesn’t make any mistakes.<br><em>Let’s imagine for short, what would happen in this case, where the car e.g. comes off track?</em><br>It’ll behave randomly because we neither programmed any corrective action nor even collect that data. Our own prior knows not only how to handle these rare situations, but also that there are worse accidents out there, which should clearly be avoided! So we’d never trying to drive against a tree, nor would we ever able to collect that data.<br>In short terms: The distribution of the collected data is not only a tiny subset of all possible situation once can land it, but also in the case we are able to collect from the whole distribution, it will suffer from too much data!<br>A more consistent approach would be to collect data, the network is actually needing in order to explore best (e.g. by focusing on new states or by those being able to maximize the gained information).<br>Practically speaking, a conceivable workaround would be to place three about 30°-rotated cameras in front of the car as NVIDIA practiced it, whereas the left one states steer right all the time, and the right one insist to steer left.<br>With that trick could those corrective actions actually be implemented, however, that’s just a well-meant drop into the ocean.</li><li><strong>Error-prone human behavior</strong>: Intuitively, our system should be better than our own driving behavior by being e.g. more fuel, time and attrition efficient. Especially optimizing for certain human preferences could also be desirable, like driving-comfort vs. time-saving. All in all, it doesn’t mean, that we’re incapable of driving thoroughly, it’s more about the micro-optimization being relevant. As outlined by <a href="https://homes.cs.washington.edu/~todorov/papers/LiThesis.pdf">Li &amp; Todorov</a> even natural tasks like moving your arm could result in a huge movement variability along each trail.<br>It’ll be much more promising if we are able to build a system which is not only capable of copying human’s strength but also build new ones especially in those areas where it has more computational power.</li><li><strong>No déjà-vu resistance</strong>: Observing the same thing twice doesn’t mean being also in the same situation.<br>Imitation Learning just optimizes about the present without preceding data i.e. fulfilling the <a href="https://en.wikipedia.org/wiki/Markov_property">Markov property</a> and without any foresight: It lives and acts in the present. Former could actually be alleviated by using sequence data in an LSTM e.g., on the contrary latter could not be realized although this might be reasonable: A precomputation of conceivable future outcomes would not only reinforce some sort of creativity by keeping a variety of solutions in mind instead of the most popular one, but it would also mitigate issues where two valid solution trajectories (e.g. driving left or right of a tree) are present, but the mean of them would result in a tragedy.</li></ol><blockquote>Is Reinforcement Learning be able to alleviate those three issues?</blockquote><p>Yes, all of them besides the Markov property which couldn’t really be unfulfilled in practice.</p><p>Reinforcement Learning’s idea is essentially that of directly optimizing for the higher objective a human would also use instead of just imitating its fruits. With this approach we don’t dictate the system what we think is relevant, alternately it figures it out on its own.</p><h3>Reinforcement Learning Objective</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNtPq-tDxaimF_WdICGP4g.png" /><figcaption>Reinforcement Learning is <strong>end-to-end</strong></figcaption></figure><p>Did you remember the three main issues with imitation learning?<br>The first one can actually be solved by providing your system the opportunity to decide on its own, which action it will need in order to make progress. With that, the second issue also disappears just because it doesn’t imitate anymore and learns on its own evaluated by a higher reward objective (the third foresight issue).</p><p>To emphasize that: It learns like a human originally learned the task, but by starting at the very first beginning. The first few training hours would literally mean just data collection by taking random actions and hopefully, we’ll do something great (determined by the reward function) so that we can learn to reinforce that behavior, which should become more likely in future iterations.</p><p>This could be compared to the try-and-error learning behavior of a recent-born baby, which doesn’t really know its own capabilities. His way of handling that situation is to explore its environment by crawling and crying, which is the current best choice for him.</p><p>Note, that as we’ll become better, we’ll have to continue to not only take those actions which were promising in past iterations but to also consider new uncommon actions. This is called exploitation-exploration tradeoff, where with algorithms like ε-greedy a small percentage is allocated to random actions. This is a point where most humans are stopping by claiming “That works well so why changing something?”. There is always a better solution, it just takes time, costs and effort to explore it…</p><h4>Definitions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*6-gvskgfhE9uNblrQad92g.png" /><figcaption>Reinforcement Learning loop, slightly enhanced from <a href="http://rail.eecs.berkeley.edu/deeprlcourse/">DeepRL Course</a> by <a href="https://people.eecs.berkeley.edu/~svlevine/">Sergey Levine</a></figcaption></figure><p>I don’t wanna confuse you, so I’ll quickly go through the most basic technical terms here and clarify shortly the whole loop process in Reinforcement Learning.</p><p>There are basically just two parties involved: The <em>environment </em>and the <em>agent</em>. The environment provides the agent with a suitable <em>observation </em>of the current <em>state </em>(e.g. an image, video, sensory data, etc.) which gets processed by the agent through a <em>policy </em>(e.g. a convolutional neural network) outputting the most likely action in that current state which could then executed by the agent in its environment. The Environment now responses with a <em>reward </em>signal evaluating the quality of that step. It could be a positive reward signal to reinforce certain behavior or a negative one to punish bad decisions. Of course, the whole process is repeated until either the <em>episode </em>terminates by reaching the goal or we reach an upper limit. Some algorithms depend on data collected through this whole episode like <em>Policy Gradient</em>, others just need a batch of {<strong>state</strong>, <strong>action</strong>, <strong>reward</strong>, <strong>next state</strong>} to be learned.</p><blockquote>And what’s the optimization criteria?</blockquote><p>It’s simply <em>maximizing the sum of all expected future rewards</em> in a given episode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mUfy2PFcJSJTcKsH2htZzQ.png" /><figcaption>One data batch {<strong>s</strong>, <strong>a</strong>, <strong>r</strong>, <strong>s’</strong>}. Scenery images from <a href="https://devblogs.nvidia.com/deep-learning-self-driving-cars/">NVIDIA</a></figcaption></figure><p>Here, this data batch is graphically visualized. It’s important to note, that we’re now needing a continuous flow of data. So a one-time labeling data process like being done in Imagenet isn’t valuable anymore. That’s because we’ll need to collect even in those regions data, the algorithm doesn’t even know in the beginning, that such a region might exist. Like a baby, who doesn’t know how fun playing with a toy could be until it eventually founds one. Or a car which doesn’t know that it should be aware of a slithering risk while snowing until it comes into such a situation.</p><p>That’s why the environment is an essential part of the algorithm’s design and couldn’t be precomputed like in Supervised Learning.</p><h4>Q-Learning</h4><p>Q-Learning is one of the most famous concrete algorithms in Reinforcement Learning. It was named after the Q-function which estimates the sum over all future reward by taking a certain action in a given state. Note, that it does not just enable the opportunity to learn off-policy meaning any {<em>state</em>, <em>action</em>, <em>reward</em>, <em>next</em><strong> </strong><em>state</em>}-batch is sufficient instead of one whole episode containing multiple of these batches, furthermore, it also reduces variance: Through the Q-function calculation, the algorithm doesn’t just rely on information of one episode. Instead, it prefers those steps which turned in similar situations over multiple episodes out to be good. One episode for itself is always by some means uncommon and flawed but summed together their basic common pattern is emphasized.</p><blockquote>And how do you actually train this Q-function?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PU_LnsmUVYG-4KzoEQI4pw.png" /><figcaption>The Bellman equation: Q(s,a) = r + γ*max Q(s’, a’)</figcaption></figure><p>The Q-function outputting all future rewards could be represented by either a huge tabular with the states as rows and the actions as columns or by a neural network.</p><p>Abstractly spoken, training could be as simple as expressed in above’s picture: Add to the current reward of your data batch the Q-Value of the next state (assuming you’ll always take the best action according to the Q-Value) and this is per definition the current Q-Value. Now try to maximize this reward.</p><p>The discount factor <em>γ</em> on his behalf ensures that the algorithm prefers achieving a certain reward now over the same reward in two or more timesteps so it does not reach the goal certainly in some point of the infinite horizon but instead as soon as possible. Multiplying the discount factor to every calculated Q-Value tend to let future reward less rewarding.</p><p><strong>A tabular Q-Learning example: FrozenLake</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/872590d90e1ea2be8bdb080f77309048/href">https://medium.com/media/872590d90e1ea2be8bdb080f77309048/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*6HeAWIzEJqJD700yFYnsUA.png" /><figcaption><a href="https://gym.openai.com/envs/FrozenLake-v0/">FrozenLake</a>: Starting at plate 1, an agent has to find its path to plate 16 which is rewarded by one while avoiding the deadly holes.</figcaption></figure><p>In the example of FrozenLake, an agent interacts with his environment by receiving a state (1 to 16: current plate) and sending the desired action (calculated with the Q-function) resulting in a certain reward.</p><p>Removal of the discount factor would, in this case, result in a tabular containing either <em>0.00</em> for holes or <em>1.00</em> for the remaining lakes: It does learn how to solve the task without making a mistake, but won’t solve it as soon as possible as it would be logical to us humans.</p><p>Moreover, in a more realistic scenario, one can’t just use a tabular even when considering images as input states or even continuous states. This is where neural networks come into place. Sadly, in this setting, it is not guaranteed that it will converge however, in practice it is often the case.</p><p>Rather useful than our toy example is the game called Breakout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*EiLokAjPgB8fj9MzJnz_BA.gif" /><figcaption>Q-learning on <a href="https://gym.openai.com/envs/Breakout-v0/">Breakout</a>: 1st vs. 7000th[~4h] vs. 9000th[~10h] episode</figcaption></figure><blockquote>Four Decades ago, Steve Jobs and Woz programmed Breakout at Atari in four nights by just using 42 TTL-chips. Did they even imagine back then that’s now possible with Reinforcement Learning to learn an advanced policy capable of observing on its own how to play best? An AI not specifically programmed to one game and clearly having no access to the internal state representation? It’s more than just getting familiar with available actions and keeping the ball alive, it’s about the strategy of playing: Avoiding both penalties at hitting the orange blocks (increased speed) and the top of the game (shortened the paddle) seems to work out quite well. At least in later iterations…</blockquote><h4>Model-based RL</h4><p>Last but not least the supreme discipline, the crème de la crème is still missing: Meta-learning. The learn-how-to-learn algorithm par excellence! Oh no, not that crème. For now, we’ll stick with model-based RL being as visionary as Meta-learning yet simpler in its usage.</p><p>Rather than learning a reward function as in Q-learning in model-based RL an even more end-to-end approach is considered: Dreaming about what the environment might be and then acting according to your dream as best as possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DeggjSKgInU14LWEwrTfiQ.png" /><figcaption>The model-based RL cycle</figcaption></figure><p>Essentially you start off with the same kind of data but continue with learning a neural network called <em>dynamics model</em> dreaming about how the next state might be given the current state and a to-be-executed action in that state. With that, it is actually possible to predict in the algorithm’s mind multiple steps into the future without executing that action following into a more deliberate behavior.</p><p>In the next step, planning through a spanned tree by considering every reachable state and its corresponding reward within a predefined horizon (e.g. 15 timesteps) with Monte-Carlo Tree Search turns out to be appropriate.</p><blockquote>And how many actions do we execute?</blockquote><p>Just the first one! Why? It’s because executing the first action of that spanned tree being on the path of a high-reward trajectory is pretty accurate in comparison to the reality whereas the whole path would be especially error-prone since the learned dynamic model is not 100% accurate. In this case, errors would add up in each timestep as well as our model would be unable to predict unexpectable environmental changes.</p><p>Consider e.g. the case of a navigation system in an autonomous car: Sure it can predict what particular action sequence to take to get to the driver’s destination, however, the whole driving process depends furthermore on other cars and pedestrians the traffic light circuit, yet even the wind, etc. Once encountered such an unexpected behavior it should be able to take corrective action to its optimal navigation. Hence just one action is executed before replanning again with the real new state received from the environment.</p><blockquote>Sure. That’s about the intuition of model-based RL. But why is it in some sense visionary?</blockquote><p>It’s because of its ability to dream. Suppose e.g. the Visual Foresight technique in the images below. As one might think, those images are real images, but the contradictory is true! They’re predicted ones from the dynamics model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DzGuMU7HqGyrEbiJ83cnpg.png" /><figcaption><a href="https://sites.google.com/view/sna-visual-mpc">Visual Planning</a> by Ebert et al.</figcaption></figure><p>This system figures out on its own that moving the robot arm beside a toy would most likely result in a moving behavior of that toy, too. And as expected is the toy disappearing of its original position with an ongoing movement of the robot arm as additionally visualized in the lower row with a likelihood map of an appearance with respect to the green toy.</p><blockquote>Fair enough. But are there are any practical usages especially in comparison to Q-Learning?</blockquote><p>Of course! In fact, it takes huge advantages with respect to the sample-efficiency (i.e. episodes needed) through the planning process as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4i-LFpeVdQkYr29Al7zQuA.gif" /><figcaption>Model-based RL vs. model-free (e.g. Q-learning) performance. More details <a href="https://arxiv.org/abs/1708.02596">here</a>.</figcaption></figure><p>However, exactly this planing strength is also its main downside: It is very vulnerable to overfitting of the dynamics model often mitigated by shallower neural networks in practice which in essence can’t model the objective as effective as in the Q-learning case.</p><h3>What did we cover so far?</h3><ul><li>Imitation Learning is the first step towards fully-automated and self-learning algorithms since it imitates one’s behavior.</li><li>In Reinforcement Learning an <em>agent</em> is able to find its own safe and optimal solution through trial-and-error by executing needed <em>actions</em> in its <em>environment</em>, observing the outcoming <em>state</em> and maximizing the returning <em>reward</em>.</li><li>In contrast to supervised learning with its handcrafted labels and once-made dataset, a continuous dataflow is needed when dealing with RL.</li><li>There are three dominant algorithms in RL: <em>policy gradient</em>, <em>Q-Learning</em>, and <em>model-based RL</em>. These algorithms differ in their computational performance, achievable performance in a given task and sample efficiency: Their sample efficiency and the ability to parallelize improves in ascending order whereas the achievable performance decreases.</li></ul><p>I’m glad that you made it so far and encourage you as a final remark to never say</p><blockquote>Self-learning algorithms is something for the future</blockquote><p>again because now and especially after completing the great <a href="http://rail.eecs.berkeley.edu/deeprlcourse/">DeepRL Course at UC Berkeley</a> you can make it a topic of today! That’s also why I gave a talk last month at <a href="https://www.meetup.com/de-DE/meetupai-Hamburg/">meetup.ai Hamburg</a> about exactly the same content.</p><p><em>Get out there and find use cases where not only a clear reward function (margin, CTR, accidents per mile, Jenga-tower stability, etc.) is available but also a safe-environment could be provided so that mistakes don’t hurt.</em></p><p>Self-learning doesn’t mean that it’ll continue to learn in the wild as Microsoft’s <a href="https://en.wikipedia.org/wiki/Tay_(bot)">Tay </a>bot on Twitter in 2016 did. You wouldn’t just get a massive shitstorm, you’re also unable to prove in any sense that your software is production-ready because the final software isn’t there yet.</p><p>RL could as a starting point also be operated in a smaller sense:<br><em>Self-learned in a safe environment, one could e.g. take the observed and hopefully unseen results (item order in an online shop, user experience through a website, </em><a href="https://youtu.be/HT-UZkiOLv8"><em>new tactics in GO</em></a><em>) and then statically implemented these in the real environments leading into a dramatic increase the system’s capability.</em></p><p>Any other thoughts? Feel free to leave a note. 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a22e8c16f40c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/what-to-expect-from-reinforcement-learning-a22e8c16f40c">What to expect from Reinforcement Learning?</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>