Jekyll2018-03-29T20:40:02+00:00https://mlaves.github.io/max laves’ blogThis is my site about stuff I am interested in. Mainly medical imaging, machine learning, math and computer programming in general.Max LavesLearn inverse kinematics of a planar 2 DoF robot2018-03-29T19:34:13+00:002018-03-29T19:34:13+00:00https://mlaves.github.io/jekyll/update/2018/03/29/learning-inv-kin<h2 id="the-networks-architecture">The network’s architecture</h2>
<p><img src="https://mlaves.github.io/assets/ff_net.svg" alt="ff net" title="Feed Forward Network" /><br />
<em>Fig. 1: The network’s architecture for learning inverse kinematics.</em></p>
<p>A simple fully connected network with one hidden layer and 128 units is used to produce joint coordinates $\mathbf{y}$ in joint space, given the tool center point’s position $\mathbf{x}$ in cartesian space.</p>
<h2 id="10-epochs">10 epochs</h2>
<video width="80%" controls="" autoplay="" loop="">
<source src="https://mlaves.github.io/assets/10_epochs.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<p><em>Fig. 2: The robot’s attempt to follow a circle after 10 epochs of training.</em></p>
<h2 id="100-epochs">100 epochs</h2>
<video width="80%" controls="" autoplay="" loop="">
<source src="https://mlaves.github.io/assets/100_epochs.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<p><em>Fig. 3: The robot’s attempt to follow a circle after 100 epochs of training.</em></p>
<h2 id="1000-epochs">1,000 epochs</h2>
<video width="80%" controls="" autoplay="" loop="">
<source src="https://mlaves.github.io/assets/1000_epochs.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<p><em>Fig. 4: The robot’s attempt to follow a circle after 1000 epochs of training.</em></p>
<h2 id="100000-epochs">100,000 epochs</h2>
<video width="80%" controls="" autoplay="" loop="">
<source src="https://mlaves.github.io/assets/100000_epochs.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<p><em>Fig. 5: The robot’s attempt to follow a circle after 100,000 epochs of training.</em></p>Max LavesThe network’s architectureGraph theory on “House of Santa Claus”2018-01-17T20:04:13+00:002018-01-17T20:04:13+00:00https://mlaves.github.io/jekyll/update/2018/01/17/santas-house<p>The “House of Santa Clause” is a famous german drawing game and riddle. My grandfather introduced it to me when I was a little child. Its task is to draw a “house” with exactly 8 lines without drawing a line twice. The drawing is accompanied by the simultaneously spoken rhyme of 8 syllables: “This is the house of San-ta Claus”, or in the german original “Das ist das Haus vom Ni-ko-laus”.</p>
<p><img src="https://mlaves.github.io/assets/HouseOfSantaClaus.gif" alt="Santa's House" /></p>
<p><em>Fig. 1: A solution of <a href="https://de.wikipedia.org/wiki/Haus_vom_Nikolaus#/media/File:Blender3D_HouseOfStNiclas.gif">Santa’s House</a> by <a href="https://commons.wikimedia.org/wiki/User:SoylentGreen">SoylentGreen</a> <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA 3.0</a></em></p>
<p>The problem of “House of Santa Claus” can be modeled with graph theory. A graph is a mathematical structure, which models pairwise relations between objects. The objects are called vertices or nodes which are connected by edges or lines. Santa’s house has 5 nodes and 8 edges. The graph is <em>undirected</em> as there is no given direction between two nodes connected by an edge. However, when trying to find solutions to Santa’s house, you quickly find out that you have to start at the lower left node and end at the lower right one. More specifically, the problem of “House of Santa Claus” it is an <em>Eulerian path</em> problem where we want to find a path in a finite graph which visits every edge exactly once. When discussing the problem of the <a href="https://en.wikipedia.org/wiki/Seven_Bridges_of_Königsberg">Seven Bridges of Königsberg</a> in 1736, Euler found out that an Eulerian path exists for graphs with exactly zero or two nodes having an odd degree. The degree of a node is its number of edges. If a graph has zero nodes with odd degree, the starting node will be the ending node, and is therefore called <em>Eulerian cycle</em>. Santa’s house has two nodes with degree of 3 (node 1 and 2) and the Eulerian path must start and end at them.</p>
<p><img src="https://mlaves.github.io/assets/Jolly-old-saint-nick.gif" alt="Santa Claus" /></p>
<p><em>Fig. 2: Santa lives in this house</em></p>Max LavesThe “House of Santa Clause” is a famous german drawing game and riddle. My grandfather introduced it to me when I was a little child. Its task is to draw a “house” with exactly 8 lines without drawing a line twice. The drawing is accompanied by the simultaneously spoken rhyme of 8 syllables: “This is the house of San-ta Claus”, or in the german original “Das ist das Haus vom Ni-ko-laus”.