<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Neural Network Design blog &#187; tips and tricks</title>
	<atom:link href="http://janbogaerts.name/index.php/category/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://janbogaerts.name</link>
	<description>My take on neural networks, AI and more</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:21:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Debugging networks: split paths</title>
		<link>http://janbogaerts.name/index.php/2010/03/04/debugging-networks-split-paths/</link>
		<comments>http://janbogaerts.name/index.php/2010/03/04/debugging-networks-split-paths/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 16:54:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/03/04/debugging-networks-split-paths/</guid>
		<description><![CDATA[ An annoying side effect of this type of resonating network, is, when you have a bug in the code, you generally don’t get 0 answers, but a whole lot. This can sometimes be very confusing to debug. Why does a certain path give a positive result, when it shouldn’t? And more importantly (from NND’s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image4.png"><img style="border-right-width: 0px; margin: 0px 0px 0px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb4.png" width="362" height="323" /></a> An annoying side effect of this type of resonating network, is, when you have a bug in the code, you generally don’t get 0 answers, but a whole lot. This can sometimes be very confusing to debug. Why does a certain path give a positive result, when it shouldn’t? And more importantly (from NND’s point of view at least), how can you follow the construction of that specific result, without the clutter of all the other processors? Enter ‘<em>split paths</em>’. </p>
<p><em><font color="#808080">A split path represent the route that a result took, from start to now, expressed in the neurons that the path chose during all the splits. </font></em></p>
<p>As example, if only 1 split was executed to get to a result, and there were 2 neurons in that split, the path of the result only has 1 node and can have 2 possible values, those that were used in the split. In the real world though, a path usually has many, many nodes.</p>
<p>To record a split path, you first need to put a break point at a position where you know you will get many invalid results. That’s because a split path can only be recorded when the processors are still running, not when the result has already been calculated. </p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image6.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb6.png" width="400" height="246" /></a>In the aici demo, it’s best to put a breakpoint in the ‘<em>Stage 1.1</em>’ code, in the if, second part (GetClusterMeaning(CurrentTo) == flow), if you drill down a bit further, you get the ‘Add split result’ instruction, which is basically the end point of the flow recognition&#160; algorithm. (see picture below).</p>
<p><em><font color="#808080">Put breakpoints on ‘Add split result’ instructions to find </font></em><em><font color="#808080">invalid split paths.</font></em></p>
<p>Once you have a processor that is producing an invalid result at your breakpoint, you can store the split path. Select the processor, open the context menu (right mouse button on a processor in the debugger overview) and select ‘<em>Store split path</em>’.&#160; This will produce a new entry in the tree on the ‘<em>Debugger</em>’ page (see 3th image). The root item will be ‘path for x’ where x is the name of the processor. The children are all the neurons that were selected for the path during a split instruction.</p>
<p>I usually kill everything after I have the path, the other processors will produce invalid results anyway, and you need to start a new run before it’s&#160; possible to actually use the path anyway. <a href="http://janbogaerts.name/wp-content/uploads/2010/03/image2.png"><img style="border-right-width: 0px; margin: 0px 0px 5px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb2.png" width="383" height="91" /></a></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image5.png"><img style="border-bottom: 0px; border-left: 0px; margin: 5px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb5.png" width="294" height="310" /></a>So, finally we can start using the data to debug our network. The basic idea is to&#160; use the path for finding the processors that are following the specified path, so we can take a closer look at the code. In short, a split path provide a shortcut: instead of manually stepping through all the code and individually deciding which processors to follow, we can jump to the ones we are interested in. These will be highlighted in green and will pause when they have reached a split that is selected in the path. Off course, we first need to select the path in the debugger, and at least 1 child node, otherwise there wont be anything to see. </p>
<p>&#160;<em><font color="#808080">Processors that follow a selected split path will show up in green and pause whenever they reach a split that produces a neuron which is selected in the path.</font></em></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image2.png"></a></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image2.png">&#160;</a>One last note perhaps, once you have the processor you want, you can use the ‘Kill all but this’ command to stop all the other processors. This way there is less distraction in the debugger.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/03/04/debugging-networks-split-paths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing code: Tips and tricks</title>
		<link>http://janbogaerts.name/index.php/2009/06/05/designing-code-tips-and-tricks/</link>
		<comments>http://janbogaerts.name/index.php/2009/06/05/designing-code-tips-and-tricks/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 15:13:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code editor]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/06/05/designing-code-tips-and-tricks/</guid>
		<description><![CDATA[Note: this is the second part of in a group of 3.
N2D is still in proto type stage, so there are plenty of idiosyncrasies to work around. Here are some tips and tricks that might make things a bit easier.

When there is lots of code visible, things can slow down fast.&#160; To avoid this, use [...]]]></description>
			<content:encoded><![CDATA[<p>Note: this is the second part of in a<a href="http://janbogaerts.name/index.php/2009/06/05/designing-code-editing-techniques/" target="_blank"> group of 3</a>.</p>
<p>N2D is still in proto type stage, so there are plenty of idiosyncrasies to work around. Here are some tips and tricks that might make things a bit easier.</p>
<ul>
<li>When there is lots of code visible, things can slow down fast.&#160; To avoid this, use the drill down/up arrows on some statements like conditional statements to close as much as possible.&#160; If you are drilling down and need to see more code, you can always open sub items into a new code editor.&#160; This will speed up things dramatically. You can do this on conditionals, their parts and code blocks </li>
<li><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image11.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 10px; border-right-width: 0px" height="255" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb11.png" width="217" align="right" border="0" /></a> Be careful with copying items around (or using shift drag). The editor displays items that are used in multiple places, but you can still be surprised when you change something to an argument only to see it changed it multiple places. The same goes for breakpoints: if an item is used in multiple places and it has a breakpoint defined, it will break everywhere the statement is used.&#160; Keep this in mind while using copy or shift-drag. </li>
<li>I use the <em>sync with explorer</em> command (F4) a lot. This was mainly because the copy paste system wasn’t working yet.&#160; But it’s still useful I think: it’s a quick route into the explorer. </li>
<li>The Toolbox is really useful to build code.&#160; If you select the ‘Instructions’ section, you get a good overview of all the available instructions, grouped by functionality.&#160; To quickly collapse and expand the groups, you can use the context menu of the toolbar. </li>
<li>It’s possible to add items to the toolbox, although this currently has to be done by hacking the “XXXdesigner.xml” file. </li>
</ul>
<h4>Final note</h4>
<p>Ok, this turned out to be a longer post than originally planned.&#160; As you can see, it&#8217;s already a pretty extended little toolset, although there are still a number of shortcomings in the editor that still need to be worked out, more specifically: </p>
<ul>
<li>CPU and memory usage are a problem resulting in a very slow view when there is lot&#8217;s of visible data. This needs be solved by a custom control. </li>
<li>Keyboard entry functionality, similar to the flow editor must still be implemented, this should speed up code editing significantly, compared to the all drag-drop or copy-paste solution. </li>
<li>Clean up the views some so that they are clearer, compacter,… </li>
</ul>
<p>Next up will be the debugger, I guess.&#160; </p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/06/05/designing-code-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
