<?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</title>
	<atom:link href="http://janbogaerts.name/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://janbogaerts.name</link>
	<description>My take on neural networks, AI and more</description>
	<lastBuildDate>Thu, 04 Mar 2010 18:48:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</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>WPF is getting under my skin</title>
		<link>http://janbogaerts.name/index.php/2010/02/24/wpf-is-getting-under-my-skin/</link>
		<comments>http://janbogaerts.name/index.php/2010/02/24/wpf-is-getting-under-my-skin/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 12:58:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/02/24/wpf-is-getting-under-my-skin/</guid>
		<description><![CDATA[I have been fighting the WPF model all the way during the development of NND. And it is wearing me down. Latest problem: the updated selection box for frame element filters doesn’t want to get focus, making it impossible to use the keyboard. I guess the new release will have to wait until I can [...]]]></description>
			<content:encoded><![CDATA[<p>I have been fighting the WPF model all the way during the development of NND. And it is wearing me down. Latest problem: the updated selection box for frame element filters doesn’t want to get focus, making it impossible to use the keyboard. I guess the new release will have to wait until I can get this fixed. Bummer. </p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/02/image1.png"><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://janbogaerts.name/wp-content/uploads/2010/02/image_thumb1.png" width="758" height="728" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/02/24/wpf-is-getting-under-my-skin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On resonance</title>
		<link>http://janbogaerts.name/index.php/2010/02/22/on-resonance/</link>
		<comments>http://janbogaerts.name/index.php/2010/02/22/on-resonance/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:10:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[resonance]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/02/22/on-resonance/</guid>
		<description><![CDATA[Just a small mental burp, while this thesaurus is (still) loading.
In case you are looking for a mental image to visualize this whole concept, try this: Resonance. When a link gets activated (for instance, the one to the very first neuron), it creates a resonance that triggers one or more other neurons. This excitation in [...]]]></description>
			<content:encoded><![CDATA[<p><em>Just a small mental burp, while this thesaurus is (still) loading.</em></p>
<p>In case you are looking for a mental image to visualize this whole concept, try this: <strong>Resonance. </strong>When a link gets activated (for instance, the one to the very first neuron), it creates a resonance that triggers one or more other neurons. This excitation in turn can cause another link between 2 neurons to be activated, causing more resonance and so and and on until the whole thing settles down.</p>
<p>I have absolutely no prove or idea that this is how it works in the real world, that’s just how my model can be interpreted. Truth be told, this is not how I conceived the thing (aka lets try to create a model that uses resonance), it was rather more like: I have 2 neurons, they are linked, how can I make something happen? Well, I can attach some code to the link and execute that. Cool. But, wait a moment, that looks like resonance…</p>
<p><em>and we just passed ‘culminate’, pfff</em></p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/02/22/on-resonance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The AICI demo</title>
		<link>http://janbogaerts.name/index.php/2010/02/22/the-aici-demo/</link>
		<comments>http://janbogaerts.name/index.php/2010/02/22/the-aici-demo/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 15:45:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[AICI]]></category>
		<category><![CDATA[demos]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/02/22/the-aici-demo/</guid>
		<description><![CDATA[Well, I think I am finally getting to writing a bit about the next demo, AICI (there is a big background job running at the moment: the complete English thesaurus is being imported, which takes a bit of time). To start with, for those who like to know: AICI is short for Artificially Intelligent Chat [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I think I am finally getting to writing a bit about the next demo, AICI (there is a big background job running at the moment: the complete English thesaurus is being imported, which takes a bit of time). To start with, for those who like to know: <strong>AICI</strong> is short for <strong>A</strong>rtificially <strong>I</strong>ntelligent <strong>C</strong>hat <strong>I</strong>nterface. I guess that should sort of give you a hint at what it does: </p>
<p><em><font size="2">AICI is a chatbot framework, running on a (new kind of) neural network.</font></em></p>
<p>Wow, that sounded a lot heavier than it really is. Truthfully, it’s all still in it’s infancy: quite a bit of functionality is missing and I haven’t yet provided it with enough ‘<em>experience</em>’ (aka flows, frames and actions), to be very useful. This results in some limitations and challenges still to overcome. So here are some restrictions for using AICI:</p>
<h4>Limitations</h4>
<ul>
<li>Use simple sentences: subject-verb-object kind of structures, no nested or grouped sentences: I haven’t yet defined enough flows to handle complex sentences (These will come in the ‘English grammar’ flow group). </li>
<li>Capitals and signs aren’t handled yet (very well or at all). This is a matter of expanding the code a bit, for the capitals, and defining the correct scanner and grammar flows for the signs. </li>
<li>The network is also not yet able to pick up spelling errors. I have an idea for an algorithm to do this, which would consist out of grouping the letters together in front, middle and back, but that’s just an idea at the moment. </li>
<li>Compound words (like ‘English grammar’) aren’t recognized (again). These are important cause the thesaurus is full of them, and they provide good shortcuts, I think. So I did implement that, and then overrode the code, so I’ll have to do that again. Bummer. </li>
<li>It’s not yet able to automatically<em> generate frames, flows and actions</em>. Again, I have a couple of ideas for this, but it’s still a bit to soon for that. So you currently have to ‘train’ networks by manually creating frames, flows and some code.       <br />The lack of this algorithm unfortunately,results in improper error handling. That is to say, some situations currently simply generate a ‘Confusion’ or ‘Don’t know’ kind of output. This usually means that the network found unknown input and should try to generate new frames/flows and or actions. </li>
</ul>
<p><em>Small recap:      <br />Both frames and flows are used to define ‘known’ or ‘recognized’ sequences in the input. Frames use restrictions to filter out data and can only handle a fixed nr of simple sequences. They were inspired by <a href="http://verbs.colorado.edu/~mpalmer/projects/verbnet.html" target="_blank">VerbNet</a> and <a href="http://framenet.icsi.berkeley.edu/" target="_blank">FrameNet</a>. Flows are more flexible, they can define optional and repetitive parts. Their origins go back to <a href="http://www.ssw.uni-linz.ac.at/Coco/" target="_blank">Coco/R</a> and <a href="http://users.telenet.be/GeneCompiler/" target="_blank">Gene</a>.</em></p>
<h4>How does it work</h4>
<p>There are basically 4 stages at work, to get from letters to a response. The first 2 have already been covered in the <a href="http://janbogaerts.name/index.php/2009/10/01/demos-explained-scanner/" target="_blank">scanner demo</a>. These are used to transform letters into words (the scanner view, which contains flows) and words into grammatically understood sentence parts, like: subject, verb,… (that’s the English grammar view, which are also flows). The transformation between those stages is done by code, that’s part of the framework (so it’s all neurons). Basically, this is the syntax recognition stage.</p>
<p>The new stuff starts from here: From the grammar, we do a translation process to the frames and these in turn trigger actions, which finally ‘do’ something, like render some output, store information and/or trigger an external process.</p>
<p><em>Reminder:      <br />A logical neural network, is a free form network (all link combinations are allowed), which functions on the basis of resonance: a link traversal can activate other parts of the network. It’s roots can be traced back to <a href="http://en.wikipedia.org/wiki/Interpreter_%28computing%29" target="_blank">interpreters</a> and <a href="http://en.wikipedia.org/wiki/Database" target="_blank">databases</a>.</em></p>
<p>Actions are able to handle different moods and time frames. This means that the same action can result in a different result, depending on the condition/state of the system. Furthermore, frames provide ‘time’ info (passed, present, future), which can also be handled differently by the actions. There’s a very simple reason for this: actions are all code. So unlike flows and frames, which you can declare, the actions need to be programmed.</p>
<p>The important thing to note here is that it’s all done by neurons, so code, frames, flows,… are all neurons, and everything that can be done with neurons from the designer, can be done through code (in fact, the latter can do quite a bit more). This means that it should be possible to create actions that are able to generate frames/flows/actions. Unfortunately, I am not that far yet.</p>
<h4>About the code</h4>
<p>I’ve been doing a lot of thinking on how best to explain this. First of all, it’s very dry stuff. Most people probably aren’t interested in the guts of the thing and just want to get working with it.&#160; Possibly, quickly add some of their own functionality and be done with it. Furthermore, I’ve been debugging this thing for so long now, it sort of started to grow on me. <em>I now how it works by now. </em>So I’m ok. Off course, you do need to know some details to get the most out of it. So I decided to, instead of explaining every single neuron in the code, I would simply give you the algorithm that I used for coming up with it in the first place. From than on, I could simply show some step by step techniques to add new functionality. So here goes:</p>
<p>To build an algorithm, I first tried to find the path from start to end neuron/status/situation/.., that should be traversed. Then, each step is focused upon individually, to find out ‘what’ needs to be done to get from A to B. For instance, image you have a text neuron, that contains the value ‘Jan’. If I need to find the flow that fits this input, I need to first find out which part of speech it is (POS=verb, noun, adverb, adjective,…). This can be found through an outgoing link on the text neuron, with the meaning ‘POS’ (this is an agreed upon convention, it could be declared differently, which is the case, the point is that it should always be done in the same way in a single network). Once I have that, I can query for all the ‘flows’ or ‘flow parts’ in which this pos value is used. Perhaps the ‘Noun’ pos is declared in the ‘subject’ and ‘object’ flows. In this case, we do a split and evaluate further. Eventually, one path of the split should die out (if it doesn’t, we currently have a ‘confusion’, but it should end with the addition of a new filter somewhere, or similar), and we can render some output.</p>
<p><em>Reflection:      <br />As a neuron, I can see links coming in from the left, going out to the right, and when I look up, I can see all the clusters I belong too. If I am a value neuron, I can store something in my belly, and if I am a cluster, and look down, I can also see all my children.</em></p>
<p>I still need to to a little fixing to AICI (the new storage system has uncovered some more bugs in the network code) and than I’ll continue with some hands on examples on extending the functionality,.. stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/02/22/the-aici-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roadmap revised</title>
		<link>http://janbogaerts.name/index.php/2010/01/21/roadmap-revised/</link>
		<comments>http://janbogaerts.name/index.php/2010/01/21/roadmap-revised/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 15:40:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Roadmap]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/01/21/roadmap-revised/</guid>
		<description><![CDATA[A few notes on what’s coming next (just to keep me on focus). I’m changing direction a bit, compared to the previous roadmap: I’d like to end the prototype faze and prepare for beta. This means I plan to drop the visual (graphics) and audio sensory interfaces for version 1. Instead, I will initially focus [...]]]></description>
			<content:encoded><![CDATA[<p>A few notes on what’s coming next (just to keep me on focus). I’m changing direction a bit, compared to the previous <a href="http://janbogaerts.name/index.php/2009/09/14/roadmap/" target="_blank">roadmap</a>: I’d like to end the prototype faze and prepare for beta. This means I plan to drop the visual (graphics) and audio sensory interfaces for version 1. Instead, I will initially focus on linguistic skills solely and move the visual and audio stuff to later releases.</p>
<h4>Storage system</h4>
<p>First thing on the agenda is the storage system. I am currently saving everything in xml files (1 neuron = 1 xml file), grate for debugging, crap for real networks: reading/copying and moving 30.000 something files around is just to slow to work with (and that’s just a bare bones chatbot). I initially planned on using an sql db or something similar, but for practical reasons, this is not an option. Hence, it’s going to be binary, blocked flat files.</p>
<h4>AICI demo</h4>
<p>I would also like to extend the aici demo so that it shows how it can interact with the .net system by perhaps program it to copy files or something similar. Before I do anything to this demo though, the new storage system will have to work, cause debugging it is otherwise far to slow.&#160; When this is done, there will probably be a new release.</p>
<h4>Modules</h4>
<p>next on the agenda will probably be the modules. These are <em>partial networks</em>, that can be imported into or exported&#160; from an existing neural network. This way, you can share peaces of your work with others (like a set of frames or some actions, a thesaurus, …).</p>
<h4>Designer improvements</h4>
<p>From then on, I’m hoping to only do improvements/bug-fixes, mostly on the designer, so it can be moved to beta. These are the major areas that I will focus on first:</p>
<ul>
<li>There’s still a memory leak in the designer somewhere. This needs some serious attention. I thought I knew where it was, bit it isn’t there, so I have no idea at the moment what it could be.&#160; Mmm…</li>
<li>The code editor needs a custom control. I’m currently using wpf’s default listboxes for the editor (yes, it’s all listboxes). This was grate to get started, but you’ve probably already experienced some of it’s problems: it gets slow, real fast, only to blow up with a layout recursion exception (bugger). For me, it’s also a pain to get exactly how I want it (you constantly have to fight with it’s default behavior). Solution: custom control.</li>
<li>The same is true for the mind maps and the flow editor (also all listboxes), which need custom controls.</li>
<li>I will have to move the search functionality into it’s own thread, cause any small search at the moment freezes the UI. This can’t be off course.</li>
<li>Finally there are lots of small things still doing strange things at times, but I guess that’s for the beta stage.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/01/21/roadmap-revised/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NND 0.3</title>
		<link>http://janbogaerts.name/index.php/2010/01/20/nnd-0-3/</link>
		<comments>http://janbogaerts.name/index.php/2010/01/20/nnd-0-3/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 19:16:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[N²D]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[0.3]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/01/20/nnd-0-3/</guid>
		<description><![CDATA[ The new release is finally ready.&#160; The Aici demo took a bit longer than planned. Also, lots of things have been fixed and updated. Here’s a non exhaustive list:

There’s a complete new lockmanager running in the background. This is much more secure (thread-wise, that is) and a lot faster. It’s still a bit of [...]]]></description>
			<content:encoded><![CDATA[<p> The new release is finally ready.&#160; The Aici demo took a bit longer than planned. Also, lots of things have been fixed and updated. Here’s a non exhaustive list:</p>
<ul>
<li><a href="http://janbogaerts.name/wp-content/uploads/2010/01/image1.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px 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/01/image_thumb1.png" width="207" height="296" /></a>There’s a complete new lockmanager running in the background. This is much more secure (thread-wise, that is) and a lot faster. It’s still a bit of a diesel though, it takes some time for it to get going, but once running, it should be pretty fast. The slow start is due to the storage mechanism (all xml files currently). This is the major drag on the entire system at the moment, and will be fixed next.</li>
<li><a href="http://www.ebswift.com/OpenSource/WordNetSQLServer/" target="_blank">Wordnet</a> import has been seriously updated, a lot more info is retrieved, and it’s now also possible to import the entire db in one go (although not yet advisable, due to a memory bug in the designer, it still takes a major byte out of the hard disk and it simply takes ridiculously long).</li>
<li>The thesaurus has been given a make over to allow for editing and filtering. He can now also display / edit non recursive relationships. Drag drop is also supported.</li>
<li> The frame editor has been updated considerably: drag drop support has been added and frame element filters/restrictions have also been introduced (will probably be extended in the future).</li>
<li>I changed the function of the ‘contains’ operator a bit. It now only checks the contents of a variable. For clusters/children, there are the new instructions (IsClustesteredBy, LinkExists, ContainsChildren, GetInFiltered,…).</li>
<li>I have added the ‘not contains’ operator.</li>
<li>New instructions:</li>
<ul>
<li>Arithmetic group (+-/*%): I finally caved on those. My <a href="http://janbogaerts.name/wp-content/uploads/2010/01/image2.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 20px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://janbogaerts.name/wp-content/uploads/2010/01/image_thumb2.png" width="559" height="223" /></a>original plan was to see how far I got without using any arithmetic in the neural code. I guess, this is as far as I got with that.</li>
<li>Get-at group: get child at, get cluster at, get out at, get in at, get info at.</li>
<li>Distinct</li>
<li>get Incoming, get outgoing, get info, Get in filtered, get out filtered, Get info filtered</li>
<li>Is clustered by, Link exists, Contains children</li>
<li>Remove-at group: Remove child at, remove info at, remove link in at, remove link out at</li>
</ul>
<li>many, many bug fixes, updates and little improvements.</li>
</ul>
<h4>Aici 1</h4>
<p>This demo is a small chat interface. Though, in it’s current state, it’s not much more than a framework. It can initiate a conversation, close it, ask for the name of the user and store the data. It’s not yet able to fully recognize a recurring user since I haven’t defined the neural code for this yet. </p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/01/image3.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 20px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://janbogaerts.name/wp-content/uploads/2010/01/image_thumb3.png" width="204" height="315" /></a> I will be explaining how it works and how you can expand on this functionality, shortly. For those who can’t wait and want to get a peek under the hood, here are some pointers to get started:</p>
<ul>
<li>There are 3 main stages:</li>
<ul>
<li>Flow recognition, which is basically the syntactical stage: check the word types and order. Project pages are: </li>
<ul>
<li>the flows (aici/flows), </li>
<li>the code that is attached to these flows (aici/code/flow code)</li>
<li>the code that recognizes the flows in the input (aici/code/flow recognition)</li>
</ul>
<li>Frame recognition, or the semantics stage. This is where we try to find meaning in the words. Project pages are:</li>
<ul>
<li>the frames (aici/frames)</li>
<li>the code that is attached to the frame sequences (aici/code/frame seq code). The frames don’t have code (yet).</li>
<li>the code that recognizes the frames in the flow results (aici/code/frame recognition).</li>
</ul>
<li>action execution, or the response of the network to the input. Project pages are:</li>
<ul>
<li>Actions: all the different actions that the system knows (not yet a lot, should be extended).</li>
<li>Output: some common code blocks for rendering output. This is also used by the frame sequences, since they are also used to render data in a predefined format.</li>
<li>Action helpers: code that the action neurons can use to perform common tasks, like stopping a conversation or controlling the timers. Timer callbacks are also stored here.</li>
</ul>
</ul>
<li>The transition between the different stages can be located in aici/code/transition. </li>
<ul>
<li>More specifically, the ‘Transition’ neuron is used to go from the flows to the frames and finally to the actions.&#160; </li>
<li>An action is started using the ‘Execute action’ neuron as meaning for a link from a data cluster to the action that needs to be started.</li>
</ul>
<li>The project also contains some mindmaps that describe the inner data structures and functionality.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/01/20/nnd-0-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aici&#8217;s first words</title>
		<link>http://janbogaerts.name/index.php/2010/01/19/aicis-first-words/</link>
		<comments>http://janbogaerts.name/index.php/2010/01/19/aicis-first-words/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 19:08:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/01/19/aicis-first-words/</guid>
		<description><![CDATA[ 
   
New release coming shortly.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://janbogaerts.name/wp-content/uploads/2010/01/image.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://janbogaerts.name/wp-content/uploads/2010/01/image_thumb.png" width="842" height="509" /></a> </p>
<p><img alt="" src="http://www.zu14.cn/coolemotion/emotions/round_2.gif" /> <img alt="" src="http://www.zu14.cn/coolemotion/emotions/round_6.gif" /> <img alt="" src="http://www.zu14.cn/coolemotion/emotions/round_2.gif" /> </p>
<p>New release coming shortly.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/01/19/aicis-first-words/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lightning fast</title>
		<link>http://janbogaerts.name/index.php/2009/10/03/lightning-fast/</link>
		<comments>http://janbogaerts.name/index.php/2009/10/03/lightning-fast/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 18:53:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/10/03/lightning-fast/</guid>
		<description><![CDATA[The new thread locking algorithm is beginning to work and it looks fast, real fast. Yes 
]]></description>
			<content:encoded><![CDATA[<p>The new thread locking algorithm is beginning to work and it looks fast, real fast. Yes <img alt="" src="http://www.zu14.cn/coolemotion/emotions/round_2.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/10/03/lightning-fast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demos explained: Scanner</title>
		<link>http://janbogaerts.name/index.php/2009/10/01/demos-explained-scanner/</link>
		<comments>http://janbogaerts.name/index.php/2009/10/01/demos-explained-scanner/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 13:19:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[demos]]></category>
		<category><![CDATA[flow recoginition]]></category>
		<category><![CDATA[flows]]></category>
		<category><![CDATA[scanner]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/10/01/demos-explained-scanner/</guid>
		<description><![CDATA[Intro
Time for the second demo overview: the Scanner.&#160; It builds on most of the ideas found in the first demo but it goes way further, and actually does something very useful (although you wouldn’t say it at first).&#160; It’s probably going to be a lengthy piece so I’m thinking of cutting it in 2 or [...]]]></description>
			<content:encoded><![CDATA[<h4>Intro</h4>
<p>Time for the second demo overview: the Scanner.&#160; It builds on most of the ideas found in the <a href="http://janbogaerts.name/index.php/2009/03/12/demos-explained-echo/" target="_blank">first demo</a> but it goes way further, and actually does something very useful (although you wouldn’t say it at first).&#160; It’s probably going to be a lengthy piece so I’m thinking of cutting it in 2 or maybe even 3 parts. Anyway, lets first start it up, either through the start menu shortcut (in the <em>Demo’s</em> sub folder, conveniently called <em>Scanner demo</em>), or by opening it in NND (<em>File/Open</em>, select the ‘<em>My documents/NND/Demos/Scanner</em>’ folder). Once the project is loaded, you should see a single text communication channel open (called Text sin), if this is not the case, go to <em>View/Communication channels/Text</em> sin and make certain that it is is selected. </p>
<h4>Overview</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/10/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 5px 10px; border-right-width: 0px" height="419" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb.png" width="606" align="right" border="0" /></a> </p>
<p>Lets get a taste of what it does, so enter some text (or leave the one that’s already there) and press the ‘send’ button (or enter).</p>
<p>You’ll notice that it basically does the same thing as the <a href="http://janbogaerts.name/index.php/2009/03/12/demos-explained-echo/" target="_blank">echo demo</a>: the input text is echoed back, except that it’s a bit slower. If you had the debugger tab open, you probably also noticed a lot more activity, so something more must be going on. </p>
<p>And indeed, if you take a closer look to the text sin channel, in the upper section, you can see the neurons that were send to the network (on the left) and those that were returned (on the right), which are different. This was not the case with the echo demo, it simply sent all the incoming neurons back out, as they were. In this demo though, we get back something completely different: TextNeurons, that represent the same thing as the int neurons that were sent as input (if you regard them as ASCII characters). Hence the name of the demo, it’s a scanner.</p>
<p>Converting a stream of ASCII chars into words, integers, doubles and signs is a pretty useful feature and that’s all this demo is capable of doing, but that’s only because <em>I</em> stopped there. You see, in the background, is a general purpose algorithm that converts an input stream of neurons into a single result cluster, using any and all of the flows that are defined in the network. This means that you can use the same algorithm with many different flow definitions. I have simply defined some to recognize words, integers and doubles. You could go further and add flows to find verbs, sentence subjects,.. (in fact, that’s what the <em>AICI 1</em> demo does). You could even go further still and create flows for visual objects or audio fragments, the same algorithm can be used. Unfortunately though, the editor doesn’t yet support such types of displays for flows (will probably be added somewhere in the future though).</p>
<h4>Details</h4>
<p>So how is the translation actually performed? To explain this, let me first recap some of the basic concepts of neurons and flows: </p>
<ul>
<li><a href="http://janbogaerts.name/wp-content/uploads/2009/10/image1.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="98" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb1.png" width="105" align="right" border="0" /></a>The different types of&#160; data available to a neuron are: incoming and outgoing links, possibly one or more <em>parent</em> clusters, for clusters possibly 1 or more children and a <em>meaning</em>. And finally value neurons also have their value off course. This is important, cause when the translation process starts, this is all the available information. </li>
<li>Flows are nothing more than <em>clusters</em> that contain flow items, which can be statics or conditionals (loops and options). These in turn can only contain conditional parts. They represent a single branch of the decision tree. Parts can again have the same data as flows: statics or conditionals. So if you are a neuron (a static, part, conditional or flow), you can always look up into your list of parents to see in which flows and parts it is used. </li>
</ul>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/10/image2.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="108" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb2.png" width="114" align="left" border="0" /></a>Now, if you recall from the first demo, an input starts by creating an IntNeuron for each ASCII value, which is linked to another neuron using the ‘<em>Letter</em>’ neuron (ID 109). These are all put on the execution stack and the processor starts (the <em>Rules</em> code on the <em>Letter</em> neuron is executed). </p>
<p>So both neurons are new and only have each other as links. This means that <a href="http://janbogaerts.name/wp-content/uploads/2009/10/image3.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="110" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb3.png" width="145" align="right" border="0" /></a> we can’t use links or parent/child relationships to resolve the first step, but instead must use something different. The only other thing that remains is the value of the int neurons, so this is compared against some constants to see if they are digits (0..9) alpha numeric (a..z+A..Z), spaces | returns, or something else.&#160; This comparison results in the creation of 1 new neuron per input neuron: the result cluster, in which we store the integer. One of these clusters (or it’s duplicate, due to a split) will eventually store the end result.&#160; This cluster is linked to one of 3 static neurons: <em>Digit</em>, <em>Alpha or</em>&#160;<em>Space </em>(signs like . or , are handled a bit differently, this will be explained later). Naturally, if the integers would represent color values, we would use other starting points than <em>digit</em> or <em>alpha</em>. In other words, this first part is variable according to the type of input and the required accuracy of the algorithm. As meaning, we use&#160; the start of the ‘flow recognition’ algorithm, called ‘<em>Stage 1.1</em>’ and put the result cluster back on the stack.&#160; It’s important to put this one back on the stack, and not the item we are looking for. That’s because the algorithm can perform numerous splits and we want the result to be duplicated not the searchable, cause the contents of the list are continuously modified and we don’t want the result of one processor to be modified by&#160; another one (I had to learn this the hard way). </p>
<p>After this initial step, the actual recognition algorithm kicks in. This consists out of 4 stages, grouped by 2. Meaning that&#160; stage 1.2 is executed immediately after stage 1.1 for each neuron (this is the same for stage 2,1 and 2.2), but at the end of stage 1.2 and 2.2 all the result neurons are collected into a single cluster. Only after the last link of the last item on the stack has&#160; been processed, are all the result clusters put back on the stack, with links for the next stage.&#160; This is done for allowing to group items together.</p>
<p>The different stages are:</p>
<ul>
<li><em><strong>Stage 1.1 (search parts/flows)</strong></em>: Find conditional parts or flows in the list of parents of the searchable. If there are multiple results, perform a split for each, after the result list has been filtered (these are the shortcuts). If there are no results and this is the only and last item still on the stack, the end result has been found. </li>
<li><em><strong>Stage 1.2 (sequence-combine and filter): </strong></em>Check if items are sequential (2 flow items declared after each other in the same parent list, which is a part or flow)<strong><em> </em></strong>and handle floating flows, which are allowed to appear anywhere in the input stream, but which break up the sequence of other items.&#160; Different actions can be performed if the order of the items is not ok: try to solve further or exit without result. Results of sequential items are grouped together. </li>
<li><em><strong>Stage 2.1 (search conditionals): </strong></em>Find conditionals in the list of parents of the searchable if this is a conditional part, otherwise the stage is simply skipped. If there are multiple results, perform a split for each after the result list has been filtered (not yet completely implemented at this stage). If there are no results, there is an error in the flow definition. </li>
<li><strong><em>Stage 2.2 (process loops and sync-points):</em></strong> If there was a conditional found in the previous stage, check if this is a loop. If so, and the previous item is of the same loop, combine the results. Also start a sync-point (will be explained later) if this was defined on the conditional. </li>
</ul>
<p>These 4 stages are repeated until there is only 1 result cluster on the stack that represents the end result of a flow which is no longer used in any other flows. This cluster is made the result of the&#160; split for the processor it ran on.&#160; Off course, because there were possibly many splits, there could be many results. These will all be presented in the split-callback cluster (you need to provide a code cluster to the Split instruction, which will be called when all sub processors are done). In this demo, the result is sent back to the sin that caused the input, in a normal situation thought, this will simply start another process, as is done in the AICI 1 demo.</p>
<p>During this whole process, the algorithm is capable of executing callback code (attached to the statics, conditionals, parts and flows) at certain specific moments in the code. This is where the magic happens. The following types of callbacks are possible (together with&#160; their execution time):</p>
<ul>
<li>Flow code: this code cluster is executed when a flow has been recognized in the stream. The ‘Result’ variable (ID 1822) contains all the neurons that match the flow. It’s here for instance that the int neurons are converted to a single word using the CiToS (Cluster with ints to string) instruction. </li>
<li>Filter flow code: this code cluster is called from stage 1.1&#160; (or 2.1, but this is not yet completely implemented) just after all the next items were retrieved from the list of parents of the searchable (stored in the CurrentTo variable). It allows the flow item to determine if it is a valid result, given the current state of the network. This is done by checking the contents of a number of globals, like ‘<em>Prev stage item</em>’ (ID 1956), which contains the previously processed neuron. </li>
</ul>
<p>In the next post, I’ll go deeper into the specifics of the algorithm itself, for as you’ve guessed by know, it’s a bit funky, and I don’t want to forget all the subtleties, since it’s definitely still a work in progress (there are many improvements still possible).</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/10/01/demos-explained-scanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roadmap</title>
		<link>http://janbogaerts.name/index.php/2009/09/14/roadmap/</link>
		<comments>http://janbogaerts.name/index.php/2009/09/14/roadmap/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 13:22:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Roadmap]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/09/14/roadmap/</guid>
		<description><![CDATA[I thought I’d write something down on how I see things progress from here on. No dates and times, just a general idea of what I have planned for the next release (version 0.3), so here goes.
Thread sync system
There still is a major hiccup in the execution core: some instructions aren’t guaranteed to be uninterruptable, [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I’d write something down on how I see things progress from here on. No dates and times, just a general idea of what I have planned for the next release (version 0.3), so here goes.</p>
<h5>Thread sync system</h5>
<p>There still is a major hiccup in the execution core: some instructions aren’t guaranteed to be uninterruptable, that is to say, some, like the instructions that change links, can be interrupted by other processors before finishing. This could result in data corruption.&#160; </p>
<p>The current protection mechanism against data corruption also appears to slow down the core way to much (most time is actually spend waiting on a sync object here or there).&#160; While trying to fix this, I pushed a bit to far, which resulted in the occasional loss of recycled id’s, in other words, deleted neurons are dropped incorrectly (you can usually see this in version 0.2 after a large input stream has been processed, the explorer might show some red slots).</p>
<p>The fix is a new thread syncing system on top of that provided by the OS, instead of trying to rely on the slower, clumsier locks&#160; provided by the system, I need to create something new.&#160; The design is mostly done, it just needs implementing, which requires some work.</p>
<h5>AICI 1</h5>
<p>I really like to get this demo working as soon as possible, so I will probably do a lot of work here.&#160; There are some updates required to the system though, before this is possible:</p>
<ul>
<li>The wordnet importer needs some work. It currently doesn’t do a good job with respect to verbs, that is to say, their conjugations aren’t imported and linked properly.&#160; This needs to be corrected so that it’s easier to determine the part of speech of a word in a sentence.</li>
<li>Verbnet needs some serious work.&#160; Not all the data gets imported or can be edited. I also need to write the neural network code to compare the data that was found against the <em>known(imported)</em> verbnet frames. And finally, I need to attach some action code to the frames, so that they actually do something.</li>
<li>I also decided to rebuild the English grammar used by the AICI example, so this needs finishing.&#160; I did this to force me to take a closer look at each and every flow item as to better understand later on where the filter code needs to be attached and where to attach the code that will build the result.</li>
</ul>
<p>I guess by the time I have gotten this far, a lot more, currently unforeseen stuff will have been added, so for now, lets make this all for version 0.3. After that, I plan to do some more work on the visual side of things (not how the UI looks, but the image sensory interfaces and their UIs).</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/09/14/roadmap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NND 0.2 released</title>
		<link>http://janbogaerts.name/index.php/2009/09/12/nnd-0-2-released/</link>
		<comments>http://janbogaerts.name/index.php/2009/09/12/nnd-0-2-released/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 17:43:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[releases]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/09/12/nnd-0-2-released/</guid>
		<description><![CDATA[I sort of blew out all the cylinders while attempting a first run directly from numbers to the English grammar: memory usage went up to +1.5 gig, thread count was +800 and a gazillion temporary neurons had been created before it all came to a grinding halt. Some redesign was required. So I beefed up [...]]]></description>
			<content:encoded><![CDATA[<p>I sort of blew out all the cylinders while attempting a first run directly from numbers to the English grammar: memory usage went up to +1.5 gig, thread count was +800 and a gazillion temporary neurons had been created before it all came to a grinding halt. Some redesign was required. So I beefed up the execution engine so that you are now able to throttle the maximum amount of simultaneous system threads that are used, which saves an incredible amount of resources and it prevents the app from grinding to a halt (well, that and the removal of a small army of bugs).</p>
<p>I also realized that the flow recognition algorithm simply was not yet mature enough to be used in even the most basic situations. Not just because it was not yet able to process the more complex flow structures, but also because I made a basic design error that I did not yet know off: <em>always put the result cluster on the stack (‘from’ part of link) and the item-to-search in the ‘to’ part</em>. Getting this algorithm ready definitely took the most effort, but it was a grate catalyst to improve the debugger and the execution core. Here’s a (non exhaustive) list of new/changed things:</p>
<ul>
<li>New instructions: GetClustersFiltered, GetChildrenFiltered, Freeze</li>
<li>Added ‘Stop all processors’&#160; and ‘kill single processor’&#160; commands</li>
<li>Added import of VerbNet data</li>
<li>Updated Frame editor so that it is able to edit VerbNet data, this is a work in progress, not all data items found in verbnet can already be edited.</li>
<li>major update to the scanner demo</li>
<li>Added the start of the AICI 1 demo, which will/should soon become able to parse the English grammar (it’s already able to parse the verb ‘to be’ ex: you are, I am, is he, he is, they were,.. (silly I know, but a start is a start!)</li>
<li>Updated flow editor with overlay items, which display the presence of certain (useful) links, like code that is attached to the flow item.</li>
<li>Added a new dialog: ‘Overlay editor’ in the Tools menu for editing the overlays that are defined in a project. This means that overlays can eventually be used everywhere.</li>
<li>new debug feature: split paths, which allow you to track previously recorded paths of processors.</li>
<li>new debug feature: attached neurons, which allow you to track down data changes in threads that should not be allowed to change the data.</li>
<li>Extra info about the static neurons (like the display title and the description) is now stored globally, outside of the project so that I only have to update 1 thing, and not all the projects whenever some documentation needs to be updated. This does mean that you can no longer store any description info for these statically defined neurons.</li>
<li>Updated the <a href="http://www.ebswift.com/OpenSource/WordNetSQLServer/" target="_blank">WordNet</a> sensory interface so that it generates POSGroup objects, which ‘group’ all objects together, that have the same text and part of speech. This saves a grate number of unneeded splits while processing the English grammar.</li>
<li>Made project saving/opening multi threaded so that the UI doesn’t appear frozen.</li>
<li>Many, many small bug fixes all over the place.</li>
</ul>
<p>Perhaps a final note, best to uninstall any previous versions.&#160; I haven’t yet tested how the installer works when it overwrites a previous installation, so it might screw things up.&#160; And off course, you can get the new installer from <a href="http://www.janbogaerts.name/files/setup.exe" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/09/12/nnd-0-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finally</title>
		<link>http://janbogaerts.name/index.php/2009/09/06/finally/</link>
		<comments>http://janbogaerts.name/index.php/2009/09/06/finally/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 18:09:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[flows]]></category>
		<category><![CDATA[output]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/09/06/finally/</guid>
		<description><![CDATA[Man, this was a tough nut to crack, but it’s done, it’s finally done. The flow recognition algorithm is working.&#160; 
 
To find some of the more tedious bugs, I had to create 2 new debugging techniques: attached neurons and split paths, which I will explain shortly. The whole algorithm eventually became seriously elaborate to [...]]]></description>
			<content:encoded><![CDATA[<p>Man, this was a tough nut to crack, but it’s done, it’s finally done. The <em>flow recognition algorithm</em> is working.&#160; </p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/09/image1.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px; border-left: 0px; border-bottom: 0px" height="65" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/09/image_thumb1.png" width="121" border="0" /></a> </p>
<p>To find some of the more tedious bugs, I had to create 2 new debugging techniques: attached neurons and split paths, which I will explain shortly. The whole algorithm eventually became seriously elaborate to deal with some of the more complicated situations. I need to document this very soon before I forget myself (I guess the <a href="http://janbogaerts.name/index.php/2009/06/11/radio-silence/" target="_blank">radio silence</a> is out of the window, dev time simply took to long for 1 algorithm, I need to do at least 3 more of these which would take far to long). I’m pretty convinced there are still some caveats to work out, but, as far as I have been able to test, all the situations using a <em>scanner</em> flow definition seem to work. The core still shows some hick-ups at times, which can still result in bogus results, but this has also been improving considerably. Expect a new update very shortly (like in a week or so).</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/09/06/finally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A mind of it&#8217;s own</title>
		<link>http://janbogaerts.name/index.php/2009/08/15/a-mind-of-its-own/</link>
		<comments>http://janbogaerts.name/index.php/2009/08/15/a-mind-of-its-own/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 14:22:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[flows]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[Results]]></category>
		<category><![CDATA[strange]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/08/15/a-mind-of-its-own/</guid>
		<description><![CDATA[My network is starting to get a mind of it’s own:
 
I am trying to get the flow recognition algorithm working so it can handle mixed content (words, numbers and signs mixed), which has been one of the more difficult algorithms I have worked on, to date. Clearly, I still haven’t got the order quite [...]]]></description>
			<content:encoded><![CDATA[<p>My network is starting to get a mind of it’s own:</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/08/image.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px; border-left: 0px; border-bottom: 0px" height="131" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/08/image_thumb.png" width="154" border="0" /></a> </p>
<p>I am trying to get the flow recognition algorithm working so it can handle mixed content (words, numbers and signs mixed), which has been one of the more difficult algorithms I have worked on, to date. Clearly, I still haven’t got the order quite right.&#160; This has been the main issue holding back a new release by the way. </p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/08/15/a-mind-of-its-own/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auch</title>
		<link>http://janbogaerts.name/index.php/2009/07/22/auch/</link>
		<comments>http://janbogaerts.name/index.php/2009/07/22/auch/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 13:26:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/07/22/auch/</guid>
		<description><![CDATA[I hate storms, especially when they happen round the same time that there is a solar eclipse on the other side of the world. My crohn did not agree with this situation one bit and made me aware of this through an unwelcome series of cramps, followed by first brown, than red stuff.
So, I’m not [...]]]></description>
			<content:encoded><![CDATA[<p>I hate <a href="http://www.standaard.be/Artikel/Detail.aspx?artikelId=GL52CTSVA&amp;subsection=3" target="_blank">storms</a>, especially when they happen round the same time that there is a <a href="http://www.google.com/hostednews/ap/article/ALeqM5iX8d-T09U9BY--80N9QWImFwW2ewD99JGMNO0" target="_blank">solar eclipse</a> on the other side of the world. My crohn did not agree with this situation one bit and made me aware of this through an unwelcome series of cramps, followed by first brown, than red stuff.</p>
<p>So, I’m not doing much today.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/07/22/auch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deadlocks and DotNet</title>
		<link>http://janbogaerts.name/index.php/2009/06/28/deadlocks-and-dotnet/</link>
		<comments>http://janbogaerts.name/index.php/2009/06/28/deadlocks-and-dotnet/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 18:56:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[N²D]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[deadlocks]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/06/28/deadlocks-and-dotnet/</guid>
		<description><![CDATA[Well, that bear (you know, the deadlocks) turned out to be a formidable grizzly. Now, I don’t know about you, but me, when I see a monster like that, I turn around and run… I can assure you, there’s nothing better than a fierce predator on your tail to streamline things.&#160; First to go was [...]]]></description>
			<content:encoded><![CDATA[<p>Well, that bear (you know, <a href="http://janbogaerts.name/index.php/2009/06/03/nnd-011-released/" target="_blank">the deadlocks</a>) turned out to be a formidable grizzly. Now, I don’t know about you, but me, when I see a monster like that, I turn around and run… I can assure you, there’s nothing better than a fierce predator on your tail to streamline things.&#160; First to go was .net’s WeakReference pattern.&#160; This simply couldn’t keep up with the engine (a change that touched every part of the designer: all editors, toolbox, explorer, thesaurus, timers,…). Next was the ReaderWriterLockSlim thingy (used to protect data blocks from corruption), which has a very peculiar definition of slim: you have no idea how many times I have seen my RAM blown up because of a simple integer scan. Lots of other stuff got tuned up or hacked out as well, so the expected update has arrived.</p>
<p>The engine appears to be stabling out, although it is still acting fishy on single core machines, where there are errors I don’t have on my multi core dev system, so I need to move to a different machine to test this out. The designer is also still very much lingering behind the engine when this is processing at full speed, but the UI should remain responsive now.</p>
<p>I have also included an extra demo project called ‘<em>Scanner</em>’. It is able to transform an input stream containing integers, representing characters, into words and numbers (ints and doubles).&#160; This doesn’t seem much, and it isn’t, except that it is doing this using a couple of flows and a general purpose algorithm (processing is still slow, mostly because the UI is trying to catch up).&#160; This was the guts of the older ‘<em>English language definition</em>’ demo, which I have split into 2: the scanner and the language definition, which is no longer able to do any processing (all code removed). It’s an example of a more complex flow.</p>
<p>The scanner demo also has the <em>number scanning problem</em> fixed (numbers longer than 2 came out with multiple results). This appeared to be caused by deleting a couple of neurons to many (in the scanning algorithm).&#160; I had already experienced the dangers of deleting neurons I thought were no longer used, but which were because of the splits. I will probably have to implement some sort of a garbage collection system to clean up unused neurons (but that’s for later).</p>
<p>Anyway, here’s the latest <a href="http://www.janbogaerts.name/files/setup.exe" target="_blank">download</a> (best to remove previous installation before installing this one).</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/06/28/deadlocks-and-dotnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Radio silence</title>
		<link>http://janbogaerts.name/index.php/2009/06/11/radio-silence/</link>
		<comments>http://janbogaerts.name/index.php/2009/06/11/radio-silence/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 11:55:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/06/11/radio-silence/</guid>
		<description><![CDATA[It’s time to do a final hack-stretch. There’s still this annoying bug in the scanner to fix which causes numbers to be misunderstood. This shouldn’t be to bad though (I hope). Followed by the final&#160; push towards a responsive network that is able to record simple statements and respond to ‘what is’ questions. This is [...]]]></description>
			<content:encoded><![CDATA[<p>It’s time to do a final hack-stretch. There’s still this annoying bug in the scanner to fix which causes numbers to be misunderstood. This shouldn’t be to bad though (I hope). Followed by the final&#160; push towards a responsive network that is able to record simple statements and respond to ‘<em>what is</em>’ questions. This is going to take some time, so there wont be many posts coming out in&#160; the near future. Perhaps a small&#160; update here or there, but nothing serious until I have <em>something</em>. Here goes…</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/06/11/radio-silence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The debugger</title>
		<link>http://janbogaerts.name/index.php/2009/06/09/the-debugger/</link>
		<comments>http://janbogaerts.name/index.php/2009/06/09/the-debugger/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 18:36:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code editor]]></category>
		<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/06/09/the-debugger/</guid>
		<description><![CDATA[This is the very first debugger I have written, and I am pretty proud about it! It’s not a masterpiece, but functional.&#160; The code definitely could use some tidying up and some speed tuning wouldn’t hurt at all, but you can trace bugs, inspect values and follow the program flow, and that’s already something I [...]]]></description>
			<content:encoded><![CDATA[<p>This is the very first debugger I have written, and I am pretty proud about it! It’s not a masterpiece, but functional.&#160; The code definitely could use some tidying up and some speed tuning wouldn’t hurt at all, but you can trace bugs, inspect values and follow the program flow, and that’s already something I guess. To explain the debugger to you, I thought it perhaps best to do it using some of the demo’s.&#160; Simply open the ‘<em>Echo words</em>’ project to get started.</p>
<h4>Set up</h4>
<p>Before we send some input to the network, we need to set up the designer so that it is ready to debug:</p>
<ol>
<li>We need to&#160; put a breakpoint&#160; on a statement. You can do this in a code editor. The very first code block that gets called in this network is the <em>rules</em> code on the ‘<em>Contains Word</em>’ neuron, so simply double click on the ‘<em>Code: Contains Word</em>’ node in the <em>Projects</em> tab.       <br />To set the breakpoint on the first statement, expand the ‘<em>CheckStartTextBlock – space insertion</em>’ code block and click in the little circle on the ‘<em>if</em>’ statement. This should make it turn red. </li>
<li>The designer also needs to be set in design mode.&#160; You can do this by the drop down box on the main toolbar or on the debugger tab’s toolbar. There are 3 possible modes:
<ul>
<li>Off: no debugging is possible.&#160; This mode runs faster. </li>
<li>Normal: The debugger stops whenever a breakpoint is encountered. When a breakpoint is encountered or a processor was paused, it is possible to inspect values.&#160; This is how most other debuggers provide debug capabilities. </li>
<li>Slow motion: In this mode, the debugger automatically pauses and continues on every statement, creating a <em>movie</em> of the execution process. You can use the throttle bar on the left of the combo box to select the speed, which is updated real time. It’s possible to pause and continue this movie using the pause and play buttons on the debugger tab’s menu.&#160; I have included this type of debugging mode because I believe it is sometimes useful to see the path that is taken to a specific point of interest. With this feature, you don’t have to keep pressing <em>F6</em> to advance. </li>
</ul>
</li>
<li>It’s also possible, but not required, to let a processor stop when an error was encountered. This is done by activating the ‘<em>Break on error</em>’ button. This only works when the error happened on a processor in debug mode. </li>
</ol>
<p></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image15.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px; border-right-width: 0px" height="615" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb15.png" width="768" border="0" /></a> </p>
</p>
<p>Note that it is not possible to switch between different modes while a processor is running. You can only specify the debug mode for newly created processors. </p>
<p>An overview of all the breakpoints in the project can be found on the right side of the debugger tab. Currently it simply lists all the breakpoints, but new features should be added to this list shortly.</p>
<h4>Start a processor</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image16.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="473" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb16.png" width="378" align="right" border="0" /></a> To get started, we need to send&#160; some data to the network through it’s text-sin (sensory interface), so make certain that the ‘<em>Echo channel</em>’ is opened (a communication&#160; channel is the visual interface for a sin). Go to <em>View/Communication Channels/Echo channel</em>, and make certain it is checked (and that the tab is selected).</p>
<p>Once the channel is open, type some text in the input section and send it to the network by pressing enter (or the <em>send</em> button). You should see a neuron appear in the left upper screen, which represents the input event (the neuron that will be solved by the processor). Your text will also appear as a string in the centre dialog screen. There will also appear an object in the centre screen of the debugger tab. This represents the processor that was started and which is handling the input event. </p>
</p>
<p>The processor overview contains 2 numbers. The first number represents the name of the processor. This value can be changed and is used to identify it between multiple processors. The second number represents the number of neurons that are left on the stack + the current neuron that&#160; is being solved. </p>
<p>The buttons represent, from left to right:</p>
<ul>
<li>a toggle button that can be used to open and close the detailed view for the processor.&#160; </li>
<li>An indicator that is selected when the processor is paused. This is used to inform you on the run state, it’s not an interactive button. </li>
<li>An indicator that lets you know that the processor is still running or not. When this is no longer selected, an irrecoverable error occurred in the processor and it is actually dead (in other words, you’ve got a problem when this is no longer selected). </li>
</ul>
<p>Once a processor is started, the middle square in the right side group on the status bar will be blue.&#160; This will remain so for as long as the network has still a processor running. </p>
<h4>Detailed view</h4>
<p>If you press the first toggle button, a detailed view of the processor should open in a new tab (using the same name as that of the processor). </p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image17.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px; border-right-width: 0px" height="484" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb17.png" width="637" border="0" /></a>&#160;</p>
<p>This tab is divided into 3 sections (from left to right):</p>
<ul>
<li>The content of the execution stack.&#160; This stack contains the neurons that have to be solved by the processor.&#160; You can add and remove neurons from/to this stack using the Pop and Push instructions (The first neuron is automatically added). In our demo, there is only 1 item currently on the stack, that’s the one being solved. This item displays&#160; a square in the stack UI element. </li>
<li>All the neurons that were assigned as meaning to the links starting from the solvable neuron. The top one will be executed first.&#160; A special case is the ‘Actions’ neuron, which will only be solved when all the others have been, no matter where it is found in the list. </li>
<li>A stack containing all the processor frames.&#160; A frame represents a single cluster’s code that is being executed by the processor. Since some statements call other clusters, like conditional statements, code blocks,… a processor will usually have a number of frames active. This provides an exact view of the processor’s current execution location.      <br />The following info is provided for each frame, from top to bottom
<ul>
<li>The code, in textual form. Each code unit can easily be selected separately for debugging purposes (check out the context menu on each item to see what you can do with it).&#160; It’s not possible to edit in this window though (you have to open the editor for this). </li>
<li>The name (or id when no name is defined) of the neuron that defines all the code. </li>
<li>The relationship between the neuron that defines the code and the actual cluster containing the code.&#160; This can be:
<ul>
<li>Children: in this case, the neuron that defines the code, is the cluster that contains the code. </li>
<li>Rules: the neuron that defines the code has a link with meaning ‘Actions’ to a code cluster. </li>
<li>Actions: the neuron that defines the code has a link with meaning ‘Actions’ to a code cluster. </li>
</ul>
</li>
</ul>
</li>
</ul>
<p>The detailed view is great to have an overview of where we are in the processing stage, but it isn’t very useful to&#160; debug a program flow. It’s better to use the code editor for this because it provides a better overview of the connection between the statements.&#160; To do this, open the editor containing the code and make certain the the processor in the debugger tab’s center screen is selected.&#160; This last action is very important for the following reason: a detailed view is opened for a specific processor, so a single tab always links to a single processor.&#160; Code however is not specific to a processor, it can be called by many processors. So it needs to know the processor context for displaying debug information.&#160; It uses the processor that is selected in the&#160; debugger overview for this purpose.&#160; This has a nice&#160; side effect: when you have multiple processors running, you can quickly switch between active processor and view where each one is in the code. Note that the code editor will put a red square around the statement that will be executed next, to indicate execution location.</p>
<h4>Do the debug</h4>
</p>
</p>
<p> <a href="http://janbogaerts.name/wp-content/uploads/2009/06/image18.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px; border-right-width: 0px" height="669" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb18.png" width="801" border="0" /></a><br />
<h5>Code flow</h5>
<p>We are ready now to start debugging the network. The first thing you can do is walk through the code using the following commands:</p>
<ul>
<li><strong>Run (F5)</strong>: continue execution until the next breakpoint or until the processor is finished (only active when paused). </li>
<li><strong>Next step (F6)</strong>: execute the next step only and&#160; pause again (only active when paused). Note, when&#160; you do a <em>step next</em> on a split instruction that creates multiple sub processors, all sub processors will also wait on the next statement, they wont run wild, but wait until you tell them what to do, which is very useful for inspecting stuff. </li>
<li><strong>Pause</strong>: stop execution and wait until the <em>Run</em> or <em>Next step</em> command have been given (only active when running). </li>
<li><strong>Stop</strong>: Ok, this sounds silly, I know, but I haven’t yet implemented the stop.&#160; I’ve always been able to stop in other ways (I’m running the debugger inside another debugger which is great for creating a schizoid coding mind). If you feel an urgent need for this command, let me know, otherwise, it’ll get in there,&#160; I just have absolutely no time frame for this. </li>
</ul>
<h5>Inspecting values</h5>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image19.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="186" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb19.png" width="275" align="right" border="0" /></a> When a processor is paused, it is possible to inspect the value of any item that returns a result, this includes: variables, globals, result statements, bool expressions and ByRefs. You can do this by selecting the item you want to inspect with the mouse, and pressing <strong>F7</strong> or through it’s context menu (Inspect value). This opens a dialog with the debug info of the result.&#160; This can be empty, 1 or multiple neurons.</p>
<p>Debug info for a neuron contains the following info:</p>
<ul>
<li>All the incoming links, where they point to and the meaning of the link (note that the meaning UI element still has to be changed into a debug neuron). </li>
<li>All the outgoing links, where they point to and the meaning of&#160; the link. </li>
<li>All the clusters that contain the parent node. </li>
<li>When the parent node is a cluster, all it’s children. </li>
<li>When the parent is a cluster, the meaning of the cluster is depicted, in brackets, after it’s name.&#160; This is also a debug UI element. </li>
</ul>
<p>The debug info is depicted recursively for all neurons. This type of debug visualization is used in multiple places throughout the designer.&#160; You might have noticed that the <em>echo channel</em> uses this UI element to depict the incoming and outgoing neurons. The detailed view of a processor also uses it to depict most of the neurons. </p>
<h5>Watches</h5>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image20.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" height="162" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb20.png" width="451" align="left" border="0" /></a> A final feature of the debugger is watches.&#160; These allow you to observe the content of variables and globals in a list for a single processor or across all processors for those that are paused.&#160; </p>
<p>This feature is best experienced using the ‘<em>English language definition</em>’ demo since this performs some splits while processing text input. I have put a breakpoint in the ‘<em>Code: Stage 1.1</em>’ page on the second <em>if</em> statement&#160; (first child <em>if</em> in the left-side path of the only root <em>if</em>) and ran it until ‘<em>Found == Sentence(flow</em>)’ to get the screenshot on the left.</p>
<p>To add watches, drag a variable or global and drop it in the left part of the debugger tab.&#160; This will add it at the bottom of the list. If you are dragging it from a code editor, it is best to hold the <em>ctrl</em> key pressed, so that the item stays at it’s original position.&#160; Note that it’s currently not yet possible to drag from the toolbox.&#160; This is a small bug that still needs fixing. Also note that it’s not yet&#160; possible to remove variables (except by editing the designer file).&#160; This command will be added very soon (just goes to show how fresh the debugger still is).</p>
<p>By default, a list of watches with their values for the selected processor is depicted.&#160; The left side is the name of the variable (or it’s id if no name has yet been assigned). To the right of the name, the content of the variable is displayed. This can be empty, 1 or more neurons, all of which are depicted using the debug UI element for neurons.</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image21.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="207" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb21.png" width="521" align="right" border="0" /></a> </p>
</p>
</p>
<p>If you switch to variable view, the left section of the debugger tab will only display a radio button for each watch. The middle section, which contains processor info, will now display the contents of the selected watch for each processor.&#160; </p>
<p>Also note that, when a processor gets split up into multiple sub procs, the view will switch to a tree.&#160; The root node shows the number of processors contained by the node. If a new input event is sent to the network before the previous has been processed, it is added as a list item, at end of the list. If sub processors split up, more sub nodes are created as children of the nodes that triggered the split (tree structure). This allows you to see how processors are related to each other.&#160; At the moment you can only see the current state, through the tree/list structure.&#160; In the future, an extra view might be added that shows a line view over time to show when and how may processors did a split and when they died out, although that’s just an idea at the moment, so don’t put your hopes up to see it any time soon, there are still far more important things to do.</p>
<h5>Errors and warnings</h5>
<p>If there are any errors generated by the code, either through the <em>Error</em> or <em>Warning</em> instruction or because of an error in the code, you can view exactly where it occurred. All messages are stored in the log tab. When they are blue, you can double click on them. This will open a code editor with the statement selected&#160; that caused the log item (note: if it is somewhere in a sub section, this is not expanded automatically) Because you can use the same statement in multiple locations, only the first few will be selected, this is to take care of some problems with WPF’s standard controls (will be fixed in the future).</p>
<p>As you can see, it’s all still fresh,&#160; but functional. The debugger has already become a central point of usage for me and I suspect this will only increase, so this will get some extensive testing early on. There are plenty of things that still need adding like conditional breakpoints, counts on breakpoints, enabling-disabling of breakpoints, more commands on the breakpoints-list (like clear, enable/disable all,…),… These things will probably be added as needed.</p>
<p>I am certain there is plenty more to say about NND’s debugger, I just can’t think of anything&#160; anymore, so I guess I’ll leave it by this for today. It’s already turned out a long enough post.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/06/09/the-debugger/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>
		<item>
		<title>Designing code: Statements</title>
		<link>http://janbogaerts.name/index.php/2009/06/05/designing-code-statements/</link>
		<comments>http://janbogaerts.name/index.php/2009/06/05/designing-code-statements/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 15:12:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code editor]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/06/05/designing-code-statements/</guid>
		<description><![CDATA[Note: this is the second part of in a group of 3.
All the different statement types, the general neuron types, some common static neurons, all the operators and the instructions can be accessed from the toolbox. You can easily drag and drop them on the editor.
Assignment

An assignment is used to assign one or more neurons [...]]]></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><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image1.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 10px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb1.png" border="0" alt="image" width="187" height="695" align="right" /></a>All the different statement types, the general neuron types, some common static neurons, all the operators and the instructions can be accessed from the toolbox. You can easily drag and drop them on the editor.</p>
<h4>Assignment</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image2.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb2.png" border="0" alt="image" width="331" height="43" align="left" /></a></p>
<p>An assignment is used to assign one or more neurons to a variable. After the operation, the variable will reference the result of the right part of the assignment. The left part must always be a variable: regular or global, but no system variables are allowed.  What exactly is assigned to the left part, depends on the type of the right part.</p>
<ul>
<li>If it is another variable, the contents of the right part are assigned to the left part.</li>
<li>It can also be a result statement, in which case the statement is executed and it&#8217;s result is assigned to the variable.</li>
<li>ByRef statements are also resolved: the content of the ByRef statement will be assigned to the variable. This is useful if you want to assign a variable or a result statement to a variable and not it&#8217;s contents or results.</li>
<li>In all other cases, the right part is assigned to the left part, so if you put a code block in the right section, it will not executed, instead, the variable will point to the code block.</li>
</ul>
<h4>(Result) Statement</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image3.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb3.png" border="0" alt="image" width="199" height="46" align="left" /></a></p>
<p>A statement is used to call an instruction and provide all the parameter values for this instruction. You can call any type of instruction with a statement, even those that return values, although that&#8217;s not very useful cause any result values are lost when used in a statement.</p>
<p>You select the instruction using the drop down box.  The instruction itself is also just another neuron, that the statement links to.  This has some consequences.  For instance, if you want to find all the statements that use a specific instruction, just check the incoming links on the instruction.</p>
<p>Most instructions require 1 or more arguments. The values for these arguments are displayed in a list that comes after the instruction. This is a regular drop list, like a code list. Each  instruction should have a little description (you can see/edit this in the description tool-frame if you select the instruction in the toolbox).  This description should say all the required arguments and any possible result values.</p>
<p>A result statement works similar to a normal statement, except that it return a value and tend to be used as part of another statement, like an assignment, a Boolean expression or as an argument value.  Result statements are depicted using the same template, but with a slightly different color to make a distinction.</p>
<h4>Code block</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image4.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb4.png" border="0" alt="image" width="108" height="46" align="left" /></a></p>
<p>A code block is used to group other statements together. This allows you to reuse common functionality.  It is a bit similar to a <em>function</em> in traditional programming languages (like C, Pascal,..), except that there are no arguments allowed and it doesn&#8217;t allow for local variable values (scope locality), see Variables for more info on this one. Internally, a code block stores all the statements in a cluster that is linked to the statement.</p>
<p>It is possible to see the statements of a code block inline, by using the expand button in front of the name.  Note that this can slow the editor down dramatically.  Better is to open the code block in a new editor frame (make certain that ‘<em>Statements</em>&#8216; tab is selected).  You can do this through the context menu’s ‘<em>View code</em>’ command (can also be triggered from the main toolbar). If you want to reuse a code block, you can simply drag it from the explorer frame to the editor.</p>
<p>Even though you define parameters on code blocks, it’s still possible to pass along argument values.  Because the content of a variable isn’t reset when a code block is called, you can create some Variables that function as parameters, fill them before you call the block and access them inside the subroutine.  The same can be done for result values, you can return as many as you want, simply  define some variables and assign a value to them in your code block.</p>
<h4>Conditional statement and it’s parts</h4>
<p>A conditional statement is used by the processor to perform execution jumps (if, case, while, foreach,…).  Each conditional should contain at least 1 conditional part, but can have more. This depends on how it is set up. You add parts by dropping them in the ‘<em>Children</em>’ section of the UI element (which moves to the right).  You can also move them around, just make certain that the entire part is selected, and not just the ‘<em>conditional</em>’ section. When correctly selected, the part will have a selection border.</p>
<p>Visually, a conditional statement is always represented as a horizontal split in the vertical code branch.  When there is a repetition in the statement (for-each, looped, until, case-looped), 2 vertical lines are also visible, making the conditional statement boxed in. This is an easy visual queue to identify repetitions (so you can have a bit of a birds eye on the code to see the structure, without the details).</p>
<p>There are currently 5 different types of conditional statements (which can be selected from the drop down box): these are:</p>
<h5>If statement</h5>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image12.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb12.png" border="0" alt="image" width="452" height="189" align="left" /></a></p>
<p>An ‘<em>If</em>’ statement can be compared with a <em>structural language’s </em>if statement. It can contain multiple parts, with only the last one allowed to have no condition. The first part who’s condition evaluates to true will have it’s code executed, all other parts are skipped from then on (so there is no fall through possible like in C’s case statement). After all the code in the part has been executed, the next statement after the if is performed, so there is no repetition in this type of conditional.</p>
<p>Adding statements to a part is done by dropping them in the ‘<em>children</em>’ section of the UI element. Because a condition must evaluate to either true or false, a Bool expression tends to be used, but a result statement can also be used. Simply drop an item in the ‘<em>condition</em>’ section.</p>
<h5>Case statement</h5>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image5.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb5.png" border="0" alt="image" width="550" height="112" align="left" /></a></p>
<p>The case statement is, like the ‘if’ statement, very similar to it’s structural equivalent: the content of a value is compared against a number of different possibilities.  Each possibility is provided through the ‘<em>condition</em>’ of the part, which can be a static or another statement that returns a result. Only the last part can be empty, which will be executed if none of the previous values matched the variable.  An empty part is not required though. There is no fall through possible (unlike the <em>switch</em> in C).</p>
<p>When you select this type of conditional statement, the UI element will display an extra drop target for you to specify the variable  who’s content needs to be checked.  This has to be a variable (or global).</p>
<h5>Looped statement</h5>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image13.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb13.png" border="0" alt="image" width="633" height="112" align="left" /></a></p>
<p>A looped conditional is comparable with  the ‘while’ statement, but with a twist: it is possible to define multiple parts.  It’s actually a bit like C’s <em>while</em> and <em>if</em> combined. The loop will run for as long as the condition in one of the parts evaluates to true.  Like the if statement, this part’s sub-statements will be executed.  The last part doesn’t require a condition, in that case, the loop will run for ever and will only stop when a break or one of the exit instructions is called. These instructions will always terminate a loop. If there  is no ‘<em>empty</em> part, the loop will stop when none of the conditions evaluates to true.</p>
<h5>Until statement</h5>
<p>The <em>until</em> conditional is similar to the <em>looped</em> variant in that it is repetitive, but it only allows 1 part that must always have a condition which is evaluated after all the sub statements have been executed.  When the condition evaluates to <em>true</em>, the repetition is stopped. This type of conditional is very similar with C’s <em>do until</em> loops.</p>
<h5>Case looped statement</h5>
<p>This conditional is a looped statement, but instead of using an ‘<em>if</em>’ kind of testing style, a <em>case</em> is used. This means that you need to provide an extra <em>case item </em>variable, like the case statement. The statement will loop for as long as a condition in one of the parts equals to the content of the case variable. The conditions in the parts should be static values, result statements, ByRefs, bool expression, variables or globals (so anything that can return a result). You can also specify an empty condition in the last part which will be activated if all of the other parts were different than the case variable.  This results in a never ending loop, which will only stop when the <em>break</em> or one of the <em>exit instructions </em> is called.</p>
<p>The case looped statement is a bit of a strange beast.  It’s origins can be traced back to <a href="http://genelib.tigris.org/" target="_blank">Gene</a>, where it made a lot of sense for parsing or generating stream.  Id don’t know if it’s useful in this context, so I simply left it in, you never know where this might end up: could be the dumpster, could be some cool trick.</p>
<h5>For each statement</h5>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image14.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb14.png" border="0" alt="image" width="310" height="140" align="left" /></a></p>
<p>This type of conditional statement can probably best be compared to C#’s ForEach loop: it executes a peace of code for each neuron  in a list. Only 1 part is allowed. It’s condition should be a statement that returns some neurons.  This can be a variable or global that contains multiple items, or a result-statement that returns a number of items, like the one that returns all the children of a cluster.</p>
<p>When this type of conditional is selected, an extra drop target is visualized, which should reference a variable (or global) that will receive the current item from the list, as it’s content. This allows you to reference the loop item from within  the subroutine.  After the loop is done, this will still reference the last item in the list.</p>
<h4>Bool expression</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image6.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb6.png" border="0" alt="image" width="429" height="47" align="left" /></a></p>
<p>A Boolean expression is evaluated to the ‘<em>True</em>’ or ‘<em>False</em>’ neurons. It can be used as a conditional part’s condition. The left part is compared with the right part, using the specified operator. This statement type is probably recognizable from more classical programming languages.  There are a couple of important twists to this type of statement though:</p>
<p>First of all, because the operator is also a neuron, it can just as well be another result statement, or variable.   As long as you have something that can be evaluated to 1 or more operators, it’s ok. And this brings us to the second wrinkle:</p>
<p>Because variables, globals and result statements can return a list of neurons, so that the left, operator and/or right sides can have multiple items, the expression evaluates the lists using the following algorithm:</p>
<ul>
<li>If the left part has no result (no neurons) and all the operators are all ‘!=’ and the right side is not empty, true is returned, otherwise false.</li>
<li>Otherwise: for all items in the left part, compare each item in the right using every operator.</li>
</ul>
<p>Note, when there are multiple operators, it is like having an ‘and’ operator for conditions that work with the same left and right side, but different operators.  This will probably not be used a lot (I haven’t yet).  It’s just a result of the structure, so I let it be available.</p>
<p>All the operators are represented by statically declared neurons (so you can’t add your own). Most are recognizable from classical programming languages like C(++). You have:</p>
<table border="0" cellspacing="0" cellpadding="2" width="347">
<tbody>
<tr>
<td width="63" align="right">==</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">equal</td>
</tr>
<tr>
<td width="63" align="right">&lt;</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">less than</td>
</tr>
<tr>
<td width="63" align="right">&lt;=</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">less or equal than</td>
</tr>
<tr>
<td width="63" align="right">&gt;</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">more than</td>
</tr>
<tr>
<td width="63" align="right">&gt;=</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">more or equal than</td>
</tr>
<tr>
<td width="63" align="right">!=</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">different</td>
</tr>
<tr>
<td width="63" align="right">||</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">logical or</td>
</tr>
<tr>
<td width="63" align="right">&amp;&amp;</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">logical and</td>
</tr>
<tr>
<td width="63" align="right">contains</td>
<td width="10" valign="top"></td>
<td width="272" valign="top">contained in the child or clustered-by list</td>
</tr>
</tbody>
</table>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image7.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb7.png" border="0" alt="image" width="275" height="44" align="left" /></a></p>
<p>The ‘Contains’ operator is a bit different. First of, there is no equivalent in traditional programming languages and it  requires a little more information to work properly: it needs to know which list to search: in the child list (in which case the left part should be a cluster),  or in the clustered-by list, which contains all the clusters that contain the neuron (this list is available in every neuron type, so the left part can be any type).</p>
<p>There is no operator precedence defined as in most traditional languages, since it is the structure of the neurons that defines the order.  This is visually verifiable by the statement’s container: first the left part is evaluated, next the operator and finally the right part.  If left or right has a sub bool expression, this is recursively repeated.</p>
<h4>Search expression</h4>
<p>This type of statement has already become deprecated. It’s been surpassed by the instructions, which provide more functionality and flexibility.  Nothing more to say about this, I guess.</p>
<h4>Variable</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image8.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb8.png" border="0" alt="image" width="112" height="30" align="left" /></a>A variable is a neuron that is able to store a reference to other neurons in the context of a processor. That is to  say, the content of a variable is only valid for as long as the processor running the code is still alive.  The contents of a variable can also be different for each processor. It will also be reset after the processor has completed evaluating all the links on a neuron and when a split callback function is called (scope locality).</p>
<p>A variable doesn’t have an initial value by default. It is possible to provide one though.  You need to unfold the drop location to make it accessible. This value can be another result statement, variable, global byref, or bool expression, in which case it is first resolved. In all other cases, the value is treated as a static.</p>
<h4>Global</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image9.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb9.png" border="0" alt="image" width="381" height="28" align="left" /></a></p>
<p>A global is similar to a variable, except that it has a different scope.  Globals are able to retain the same value for as long as the processor is alive while normal variables are reset at different times during the execution process of a processor. This is useful to pass along data generated during the execution of one link to another one.</p>
<p>Globals are also able to define what should happen during a split operation.  Possible values are:</p>
<ul>
<li>Empty: clear all values from the global in the new processors</li>
<li>Duplicate: create duplicates from the content of the globals. A duplicate is a neuron with the same incoming and outgoing links, same value (in case of Int-, double- and Text-Neurons) and same children, but a different ID and not clustered by any item (so the clustered-by list is not duplicated, cause the clusters don’t get new neurons added because of a split).</li>
<li>Copy: simply copy the content of the global to the new processors.</li>
</ul>
<h4>ByRef</h4>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image10.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb10.png" border="0" alt="image" width="85" height="30" align="left" /></a></p>
<p>The ByRef statement can best be compared with C’s ‘&amp;’ operator, but instead of getting the address of the memory location, in a neural network, it prevents a statement that return a result (like a variable, result statement, bool expression) from calculating that result, but instead returns the statement itself.</p>
<p>Although this statement probably wont be used that much, it is very important for the split instruction to work properly, since this requires a variable neuron as one of it’s arguments.  Often, this statement is the only way to provide this value.  There are other situations where this statement can be used, but less often.</p>
<p>This concludes the overview of all the different statements.  Up next, some <a href="http://janbogaerts.name/index.php/2009/06/05/designing-code-tips-and-tricks/" target="_blank">tips and tricks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/06/05/designing-code-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing code: Editing techniques</title>
		<link>http://janbogaerts.name/index.php/2009/06/05/designing-code-editing-techniques/</link>
		<comments>http://janbogaerts.name/index.php/2009/06/05/designing-code-editing-techniques/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 15:09:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code editor]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/06/05/designing-code-editing-techniques/</guid>
		<description><![CDATA[Today, I&#8217;d like to talk a bit about the code editor which is used to create and view executable data. Notice that I used the verb &#8216;designing&#8216; instead of &#8216;writing&#8216; code in the title. There&#8217;s a very simple reason for this: N2D doesn&#8217;t yet define a syntax for textual input of code, instead, there is [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I&#8217;d like to talk a bit about the code editor which is used to create and view executable data. Notice that I used the verb &#8216;<em>designing</em>&#8216; instead of <em>&#8216;writing</em>&#8216; code in the title. There&#8217;s a very simple reason for this: N2D doesn&#8217;t yet define a syntax for textual input of code, instead, there is the code designer which provides a visual view on the raw assembly code (so there is no complex conversion required). The idea is that it will eventually (I hope sooner rather than later) be able to understand natural language, making a custom syntax not necessary.  Because designing a good language, with accompanying parser can be tricky and time consuming, I opted to skip this step and instead rely on WPF for me to build a powerful designer with.  This has sort of worked.</p>
<p>Before you get started with this post, might I suggest you to check the <a href="http://janbogaerts.name/index.php/2009/03/12/demos-explained-echo/" target="_blank">Echo words demo explanation</a> for a more general introduction on how to use the code editor. This provides a good introduction for most of the general concepts. This post will deal with some more technical details.  Because of the length, I decided to split it into 3 posts:</p>
<ul>
<li>editing techniques: that’s this post</li>
<li>all the different <a href="http://janbogaerts.name/index.php/2009/06/05/designing-code-statements/" target="_blank">code statements</a></li>
<li>and: <a href="http://janbogaerts.name/index.php/2009/06/05/designing-code-tips-and-tricks/" target="_blank">tips and tricks</a>.</li>
</ul>
<h4>Editing techniques</h4>
<p>Code editing is currently based on a drag drop paradigm in which you drag statements to the editor and drop them at the appropriate location.</p>
<ul>
<li>Drop locations are indicated using a gray, rounded border, containing the name of the drop target, like &#8216;Args&#8217;, &#8216;Children&#8217;,&#8230;</li>
<li>To add statements at the bottom, simply drop them somewhere in the white space below or at the side.</li>
<li>To insert items, drop them on the little black line above the statement.  The previous statement will be moved down.</li>
<li>When you drag an item and drop it somewhere else, it will be moved, except if the &#8217;shift&#8217; key is pressed, in which case the item will remain at it&#8217;s original position and will be copied to the drop target (no duplicate, but the same neuron is referenced. <strong>This is important</strong>!)</li>
<li>You can also copy and paste items. During the copy process, the id&#8217;s of all the selected items are placed on the clipboard.  A paste will get the id&#8217;s from the clipboard, transform them into neurons which are put in the selected place.  You paste in drop targets, simply click in the drop target (there is no visual queue yet to indicate that the drop target is selected, this still needs some work) and paste. Note that copy-paste doesn&#8217;t yet work across multiple applications.</li>
<li>If you press delete while an item is selected, it&#8217;s reference will be removed from the editor.  If the underlying neuron is no longer referenced anywhere else, it is removed.  All neurons that it references which are also no longer referenced are also removed (cascading delete).  This is the most used deletion method in code editing.  This means that when you delete a statement, all the parameter values that are no longer used, are also deleted. Or, if you delete a code block, all the statements that are no longer used anywhere else, are also deleted from the network.</li>
<li>If you want more deletions options, use the &#8216;Delete special&#8217; (ctrl+del)  command.  This shows a dialog which allows you to specify the deletion method you want:
<ul>
<li>simply remove the reference, but always leave the neuron in the network</li>
<li>Remove the reference and when  no longer used, delete it (as with the normal delete)</li>
<li>Always delete the neuron.Referenced neurons can be</li>
<li>left alone: they are not deleted</li>
<li>deleted when no longer referenced</li>
<li>always deleted</li>
</ul>
</li>
<li>All neurons can have a &#8216;<em>display title</em>&#8216;. When the designer finds one for a neuron, this is displayed when possible.  You can easily change this name by pressing &#8216;F2&#8242; or through the context menu of the selected item.  This is very useful for variables and globals.</li>
<li>Most statements have a little circle in the front of the image.  This is a toggle button to enable/disable a breakpoint on the item. This is part of the debugger integration into the editor (more on that later).</li>
<li>It’s also possible to change a statement from one type to another one through the context menu.  A warning though about this command, you might loose data with this command, that can’t yet be undone (no proper undo support yet for this command).</li>
<li>If you simply need to move a statement up or down, you can also use the context menu, which has a submenu for moving items around.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/06/05/designing-code-editing-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NND 0.1.1 released</title>
		<link>http://janbogaerts.name/index.php/2009/06/03/nnd-011-released/</link>
		<comments>http://janbogaerts.name/index.php/2009/06/03/nnd-011-released/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 18:41:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/06/03/nnd-011-released/</guid>
		<description><![CDATA[It was itching to much, I had to do a new release.&#160; Lots of things have been updated behind the scene, so not much visually new to report (except for the debugger perhaps, that&#8217;s definitely visual). As I mentioned in a previous post, I was expecting some serious coding requirements to get the scanner-parser routines [...]]]></description>
			<content:encoded><![CDATA[<p>It was itching to much, I had to do a new release.&#160; Lots of things have been updated behind the scene, so not much visually new to report (except for the debugger perhaps, that&#8217;s definitely visual). As I mentioned <a href="http://janbogaerts.name/index.php/2009/04/05/update-flow-editor-take-2/">in a previous post</a>, I was expecting some serious coding requirements to get the scanner-parser routines working that transform input streams into output using flows. This definitely turned out to be a slash and dash marathon.&#160; perhaps best to be compared with a hiking trip from point A to B through a jungle with nothing but a machete and a compass: all you know is where you&#8217;re heading and the bug that&#8217;s directly in front of you, nothing else.&#160; Well, I eventually got to point b, only to find a big bear to wrestle with: threading deadlocks.<img alt="Confused" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/confused_smile.gif" /> Although this might turn out to be nothing but a pesky mosquito, easily rectified.</p>
<p>Anyway, here are some of the most significant changes:</p>
<ul>
<li>Cut/copy paste system: this was still missing.&#160; The backbone is done, the code and flow editors already have a working implementation, the rest should follow. </li>
<li>Deletion system: I updated the deletion system so as to better reflect common editing practices.&#160; This is again done for the code and flow editors, the rest will be done later. </li>
<li>undo system: There were still some issues with undoing network operations.&#160; This should be fixed.&#160; The mind-map editor still requires some redoing in this area (and many more by the way). </li>
<li>Debugger: This is starting to become really useful.&#160; I would not have been able to get the scanner demo working without this. I&#8217;ll explain more about this one in a later post cause it definitely needs some explanation. </li>
<li>Demos updated:
<ul>
<ul>
<li>I have split the echo demo in 2: a word echo demo and letter echo demo. Both give a very basic implementation of 2 different coding techniques to use in neural networks: a singular operation, and a collector. </li>
<li>The English language&#160; def demo is currently able to scan incoming letters and turn them into words and numbers (although there&#8217;s still a problem with the numbers).&#160; This scanner algorithm (which really is a general purpose flow interpreter) will be explained later, cause it&#8217;s a bit funky (to say the least). You&#8217;ll also probably notice that the UI needs some serious speed tuning in order to keep up with the engine. </li>
</ul>
</ul>
</li>
<li>Execution engine: this is where the major hacking had to be done, the axe is still glowing red hot, but it&#8217;s running, oh yea, it&#8217;s running. </li>
<li>Some new instructions: More will probably follow, but I&#8217;m beginning to get a better picture of instruction requirements.&#160; This is starting to stable out. </li>
<li>lots and lots of small fixes. </li>
</ul>
<p>The new release can be downloaded from <a href="http://www.janbogaerts.name/files/setup.exe">here</a>, or through the usual links in the menu. I&#8217;ll probably be spending some more time on posting new entries to explain the debugger and some algorithms. I might also need to start explaining how you actually do you&#8217;re own coding in NND. I&#8217;d say: stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/06/03/nnd-011-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Floating flows</title>
		<link>http://janbogaerts.name/index.php/2009/05/11/floating-flows/</link>
		<comments>http://janbogaerts.name/index.php/2009/05/11/floating-flows/#comments</comments>
		<pubDate>Mon, 11 May 2009 19:08:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[flows]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/05/11/floating-flows/</guid>
		<description><![CDATA[Just a quick &#8216;in between&#8217; note. I had to make a small change to the flow editor because a flow can now have an attribute &#8216;FlowIsFloating&#8217; assigned (through a link pointing to &#8216;True&#8217; or &#8216;False&#8217;). It is used by the scanner and parser routines to find flows that can appear anywhere in a stream.&#160; This [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick &#8216;in between&#8217; note. I had to make a small change to the flow editor because a flow can now have an attribute &#8216;FlowIsFloating&#8217; assigned (through a link pointing to &#8216;True&#8217; or &#8216;False&#8217;). It is used by the scanner and parser routines to find flows that can appear anywhere in a stream.&#160; This provides a generalized manner of defining this property without having to create custom routines for each set of flows. Spaces between words are good examples where this is used. The context menu for the flow name in the overview list on the editor contains a toggable menu item to activate/deactivate this attribute.&#160; A green line in front of the flow indicates it is floating.&#160; Here&#8217;s a screenshot:</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/05/image.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="389" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/05/image-thumb.png" width="502" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/05/11/floating-flows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New location</title>
		<link>http://janbogaerts.name/index.php/2009/05/08/new-location/</link>
		<comments>http://janbogaerts.name/index.php/2009/05/08/new-location/#comments</comments>
		<pubDate>Fri, 08 May 2009 19:12:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2009/05/08/new-location/</guid>
		<description><![CDATA[Well, I hope&#160; you like the new engine, it should be much better.&#160; The new address should be easier to find.
]]></description>
			<content:encoded><![CDATA[<p>Well, I hope&#160; you like the new engine, it should be much better.&#160; The new address should be easier to find.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/05/08/new-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Progress report</title>
		<link>http://janbogaerts.name/index.php/2009/04/27/progress-report/</link>
		<comments>http://janbogaerts.name/index.php/2009/04/27/progress-report/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 19:05:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,69b93581-d3c4-45b7-ad4d-0b3142a8ab82.aspx</guid>
		<description><![CDATA[Crohn complications have slowed me down a bit over the last couple of weeks, but everything seems to be coming under control and progress has slowly picked up again. So, it&#8217;s become time again for a new update before I start explaining the new stuff in depth.&#160; These are the main changes:

The undo system is [...]]]></description>
			<content:encoded><![CDATA[<p>Crohn complications have slowed me down a bit over the last couple of weeks, but everything seems to be coming under control and progress has slowly picked up again. So, it&#8217;s become time again for a new update before I start explaining the new stuff in depth.&#160; These are the main changes:</p>
<ul>
<li>The undo system is starting to be functional.&#160; There&#8217;s still something going wrong with undoing some link operations, but that&#8217;ll be sorted out soon probably. </li>
<li>There&#8217;s a new expression type: the global, which is a variable that is able to retain it&#8217;s value for as long as a processor is alive.&#160; It&#8217;s also possible to determine what should happen with a global during a processor split: copy or duplicate the value, or do nothing. This is done with an outgoing link on the expression, so you can change it dynamically. </li>
<li>You can now easily attach and edit an unlimited number of code clusters to any neuron from the code editor.&#160; This is useful to attach code to a neuron that shouldn&#8217;t be executed directly by the processor (the actions and rules link) but is stored as data, to be retrieved and called from code. Flows for instance use this to attach code that needs to be called by the parser during different stages of the parsing process. </li>
<li>The debugger is starting to become fully operational with a useful interface.&#160; There are still plenty of quirks that need ironing out, but it&#8217;s starting to become useful. Here&#8217;s a screenshot of the debugger in action (I&#8217;ll explain what everything means and how to use it later on):
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="521" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/Progressionreport_CB16/image_thumb.png" width="758" border="0" /></p>
</li>
<li>Many, many bug-fixes. </li>
</ul>
<p>The scanner and parser are almost working.&#160; You can already push text to the network, which&#160; is almost parsed into words (some quirks still left).&#160; It doesn&#8217;t yet know what to do with the words though (so the link between the scanner and parser is still broken), this is why I needed the extra functionality in the code editor. I&#8217;ll explain the scanner and parser&#8217;s details in a later post. For now, check out the <a href="http://www.janbogaerts.name/files/setup.exe">new release</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/04/27/progress-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: flow editor, take 2</title>
		<link>http://janbogaerts.name/index.php/2009/04/05/update-flow-editor-take-2/</link>
		<comments>http://janbogaerts.name/index.php/2009/04/05/update-flow-editor-take-2/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 19:29:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Updates]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[flows]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,53baa899-23c8-4710-90eb-3970277d27f3.aspx</guid>
		<description><![CDATA[After using the flow editor a bit, some of the more annoying errors became pretty obvious, so it&#8217;s time for a new update (well, full install again) to the flow editor. Besides the more obvious bug fixes, I&#8217;ve also introduced some new functionality, notably:

shortcuts &#8216;N&#8217; &#38; &#8216;ctrl+N&#8217;: add/insert a new neuron. 
shortcut &#8216;R&#8217;: toggle &#8217;selection [...]]]></description>
			<content:encoded><![CDATA[<p>After using the flow editor a bit, some of the more annoying errors became pretty obvious, so it&#8217;s time for a new update (well, <a href="http://www.bragisoft.com/files/setup.exe">full install</a> again) to the flow editor. Besides the more obvious bug fixes, I&#8217;ve also introduced some new functionality, notably:</p>
<ul>
<li>shortcuts &#8216;N&#8217; &amp; &#8216;ctrl+N&#8217;: add/insert a new neuron. </li>
<li>shortcut &#8216;R&#8217;: toggle &#8217;selection Required&#8217; for current option/loop.&#160; This is an important feature that I missed (in gene this was no problem since you could use an empty condition which is not possible here).&#160; The problem is this: sometimes,      <br />an option or loop has to require at least 1 selection between a part (so you can&#8217;t skip the condition or flow), sometimes this is not required.&#160; To allow a distinction between the 2, an extra &#8216;attribute&#8217; is attached to the conditional (the loop or option), much the same as how a selection between loop and option is done. </li>
<li>I changed the layout from wrap-panel to horizontal stack-panel, which is more logical to work with. </li>
</ul>
<p>Note: I have updated the table on the <a href="http://bragisoft.com/blog/2009/03/31/UpdateFlowEditor.aspx">first post</a> about the flow editor so it contains the new shortcuts.</p>
<p>I will probably also have to implement a new statement type, to allow for grouping ery soon.&#160; It&#8217;s not really needed for defining the flows, but I think it can be useful later on, during the parsing. For instance, the expression: (verb &quot;ing&quot;) means that you are expecting a verb, with ing behind (standing, listening,&#8230;).&#160; You don&#8217;t need the brackets to define it, but it makes more sense while parsing, if the grouping statement has an attribute attached to it that indicates how it needs to be interpreted.</p>
<p>I have also noticed a &#8216;logical&#8217; error in the way that I implemented keyboard navigation: some keys have been reversed. So when you are on an item inside a part and need to get to that part, use the left arrow instead of the right.&#160; Being able to select    <br />a part is important to continue adding items at the end again when you have added a conditional like in the next image. It&#8217;s annoying, but fuck it, this is one for later on.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="303" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/UpdateFlowEditortake2_D5D2/image_thumb.png" width="259" border="0" /></p>
<p>I&#8217;m also not yet very happy with the deletion functionality.&#160; As it is at the moment, you can remove or delete.&#160; Removing simply takes away the reference to a neuron in a list, deleting, will remove the neuron from the brain.&#160; This is annoying, cause you usually want to remove statics and delete conditionals and parts.&#160; If you want to remove an entire condition, you need to first delete all the parts separately.&#160; A better scheme would be as that of the code editor, which will check for this type of situation.&#160; Again, this is a minor thing, so I will add it to the feature list. At the moment, there are more important things to do though.</p>
<p>A bit more interesting, I have also began work on an English grammar definition.&#160; Here&#8217;s a screenshot of a part:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="993" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/UpdateFlowEditortake2_D5D2/image_thumb_1.png" width="664" border="0" /></p>
<p>It&#8217;s off course not a definition that covers the complete language, but I think it should be enough to build a natural language interface, which should be interesting. I&#8217;m certain I missed a bunch, I still need to define adverb handling (which will be treated in a pre parser, a bit like how comments are handled in more traditional parsers) and the scanner also needs commencing.&#160; And expect some shuffling around and updates as I implement the parser for this definition.&#160; At this stage, extra attributes will probably be added, to handle more semantically oriented parsing. I have no idea how long this is going to take me, but I expect some issues with the debugger, so I might be out for a week or 2 for the next update.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/04/05/update-flow-editor-take-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: FlowEditor</title>
		<link>http://janbogaerts.name/index.php/2009/03/31/update-floweditor/</link>
		<comments>http://janbogaerts.name/index.php/2009/03/31/update-floweditor/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 19:11:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[flows]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,ec819077-366f-4a55-ab7d-ad514d9a0a05.aspx</guid>
		<description><![CDATA[I&#8217;ve added support for flow editing, which should be the final &#8216;big&#8217; editor required to create useful networks. From now on, only finishing functionality and bugfixes. It took a little longer than I had originally planned, mostly because of a struggle    with WPF&#8217;s keyboard navigational system, which is crap. I finally got [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added support for flow editing, which should be the final &#8216;big&#8217; editor required to create useful networks. From now on, only finishing functionality and bugfixes. It took a little longer than I had originally planned, mostly because of a struggle    <br />with WPF&#8217;s keyboard navigational system, which is crap. I finally got it working though (it also supports drag and drop, copy-paste still needs implementing), hope you like it.&#160; You can download the program from <a href="http://www.janbogaerts.name/files/setup.exe">here</a>. Unfortunately it&#8217;s still a full install, so it&#8217;s the whole 40 and some megs download.&#160; I&#8217;ll try to find some time to create an update installer so that the download size can be minimized.</p>
<p>The editor is still a bit rough, but it should be useful. I&#8217;ve tried to make it more text oriented, so you can easily navigate/add/remove items from the keyboard.&#160; In the background though it&#8217;s still listboxes so coding the view and data was easy and fast, just that creepy WPF navigation system, off course more importantly, it makes certain no illegal input can be provided.</p>
<p>Anyway, here&#8217;s a screenshot:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="334" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/UpdateFlowEditor_12AB3/image_thumb.png" width="524" border="0" /></p>
<p>Basically, this Flow editor describes how a noun can be found in a stream: a noun should start either with an article (which is either &#8216;a&#8217; or &#8216;the&#8217;) or a number, followed by 0 or more adjectives finalized with a single noun.&#160; Ok, there are gaps here (it&#8217;s still a sketch to show the editor): what&#8217;s a number, adjective or noun and how to find them.&#160; These things will be explained in the demo, but basically, you use converters (functions that can transform a neuron into another one, like the object &#8216;house&#8217; into the neuron &#8216;noun&#8217;) or some other info that can be used in a search function which can be attached to the flow items.</p>
<p>To create one yourself, go to &#8216;<em>Insert/Flow editor</em>&#8216;, use the toolbar button &#8216;<em>Create new flow editor</em>&#8216;, use the toolbar button on the &#8216;<em>Project</em>&#8216; overview tool frame or use it&#8217;s context menu. Press &#8216;F&#8217; to create a new flow followed by a &#8216;.&#8217; to select a static or &#8216;['/'{' for an option/loop (press '|' to add new parts in a loop or option). Here's a complete list of available short cuts:</p>
<table cellspacing="0" cellpadding="2" width="633" border="0">
<tbody>
<tr>
<td valign="top" width="135">
<p align="right"><strong><u>Shortcut</u></strong></p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p><strong><u>Meaning</u></strong></p>
</td>
</tr>
<tr>
<td valign="top" width="136">
<p align="right">arrow left</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>go to the previous flow item</p>
</td>
</tr>
<tr>
<td valign="top" width="136">
<p align="right">arrow right</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>go to the next flow item.</p>
</td>
</tr>
<tr>
<td valign="top" width="136">
<p align="right">arrow down</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<ul>
<li>When on a conditional block: go to the next conditional block </li>
<li>When on a static item: go to the first item of the next conditional block. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="135">
<p align="right">arrow up</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<ul>
<li>When on a conditional block: go to the previous conditional block </li>
<li>When on a static item: go to the first item of the previous conditional block. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="135">
<p align="right">end</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>go to the end of the current list, when at end of current list, go to end of parent list, until the end of the flow is reached.</p>
</td>
</tr>
<tr>
<td valign="top" width="134">
<p align="right">home</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>go to the start of the current list, when at start of current list, go to start of parent list, until the start of the flow is reached.</p>
</td>
</tr>
<tr>
<td valign="top" width="134">
<p align="right">Ctrl + arrow/end/home/mouse click on item</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>select multiple neurons.</p>
</td>
</tr>
<tr>
<td valign="top" width="134">
<p align="right">Alt+arrow down</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>go to the next flow</p>
</td>
</tr>
<tr>
<td valign="top" width="134">
<p align="right">Alt+arrow up</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>go to the previous flow</p>
</td>
</tr>
<tr>
<td valign="top" width="134">
<p align="right">.</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>open a popup for selecting a 'named' neuron to add at the end of the current list as static.</p>
</td>
</tr>
<tr>
<td valign="top" width="134">
<p align="right">ctrl+.</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>open a popup for selecting a 'named' neuron to insert at the current pos as static.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">{</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>add a loop at the end of the current list.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">ctrl+<strong>{</strong></p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>insert a loop at the current position.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">[</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>add an option at the end of the current list.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">ctrl+[</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>insert an option at the current position.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">}</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>change the currently surrounding option to a loop.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">]</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>change the currently surrounding loop to an option.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">R</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>toggle &#8217;selection Required&#8217; for current option/loop</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">|</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>add a new part in the first parent loop or option of the currently selected item.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">ctrl + |</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>insert a new part in the first parent loop or option of the currently selected item.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">del</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>remove the currently selected item from the list, but don&#8217;t delete the actual neuron.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">ctrl+del</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>delete the actual neuron.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">O</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>Add a new object (neuron cluster with meaning &#8216;Object&#8217;) at the end of the current list.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">ctrl+O</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>insert a new object (neuron cluster with meaning &#8216;Object&#8217;) at the current position.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">N</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>Add a new neuron at the end of the current list.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">ctrl+N</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>Insert a new neuron at the current position.</p>
</td>
</tr>
<tr>
<td valign="top" width="133">
<p align="right">Double click on static</p>
</td>
<td valign="top" width="10">&#160;</td>
<td valign="top" width="481">
<p>Go to the flow.&#160; This is only available when the static is a reference to another flow.&#160; This is indicated by a line underneath the static.</p>
</td>
</tr>
</tbody>
</table>
<p>A final note perhaps on how to use these flows in a neural network.&#160; The thing is, this is really up to you, the application doesn&#8217;t make any hard-coded use of them. Though, there will probably be a couple of default algorithms that can be reused.&#160; <br />The basic idea is relatively simple: when the first neuron comes in, search all the clusters to which it belongs with the meaning &#8216;Flow&#8217;, &#8216;FlowItemConditional&#8217; or &#8216;FlowItemConditionalPart&#8217; and store the result list in a cluster.&#160; When the second comes in, try to find all the clusters of the previous result set that allow the new neuron to follow the previous one, all clusters that don&#8217;t allow this are removed from the result set.&#160; Various clean ups / lookups can be performed during 2 incoming points. When a &#8216;flow&#8217; cluster is found with code attached to it, execute this. This off course, can be made as simple or as complex as you want. More on this in a later post. Fuel is depleted for today.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/31/update-floweditor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: Splits working</title>
		<link>http://janbogaerts.name/index.php/2009/03/20/update-splits-working/</link>
		<comments>http://janbogaerts.name/index.php/2009/03/20/update-splits-working/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 19:53:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,f02b8633-7e6f-4d20-9960-8e5ce000ab9e.aspx</guid>
		<description><![CDATA[There&#8217;s a new update available for N&#178;D. The major change is with regards to how the split functionality works. In the original design, the processor&#8217;s stack was used to return any results at the end of a split. This was causing problems, especially with nested splits where stack contents get duplicated.&#160; In the original design, [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a new update available for <a href="http://www.janbogaerts.name/files/setup.exe">N&#178;D</a>. The major change is with regards to how the split functionality works. In the original design, the processor&#8217;s stack was used to return any results at the end of a split. This was causing problems, especially with nested splits where stack contents get duplicated.&#160; In the original design, stack duplications didn&#8217;t generate new id&#8217;s for the neurons, which was changed, for good reasons.&#160; Unfortunately, this created a problem for the split: split result were unwanted getting duplicated.&#160; You now how it goes, pull the sheet a bit on this side, only to uncover it on the other    <br />one.</p>
<p>The solution was very simple and pretty elegant: use a different list to store the result of a split. So now a processor has 2 internal lists: the execution stack used to build the code that should be executed next and a list with the split results (<em>unique </em>neurons) and their weights. A couple of new instructions had to be created to control this list.&#160; No biggie: an Add, Remove, Get and Clear.</p>
<p>Anyway, I&#8217;m updating all the documentation now.&#160; If I mist something, don&#8217;t forget: 2 separate lists. The next post will probably be a Demos explained on the split.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/20/update-splits-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About sandboxes</title>
		<link>http://janbogaerts.name/index.php/2009/03/17/about-sandboxes/</link>
		<comments>http://janbogaerts.name/index.php/2009/03/17/about-sandboxes/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 16:26:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,2e12442f-ff13-4a85-ac6f-40a71a5758e8.aspx</guid>
		<description><![CDATA[As a child, I remember playing quite a lot in the sand by the coast in the summers. I don&#8217;t think I cared very much about sandboxes though, except maybe for growing stuff in. Anyway, that&#8217;s totally besides the point with regards to today&#8217;s topic, which is about N2D&#8217;s sandbox, used to test out a [...]]]></description>
			<content:encoded><![CDATA[<p>As a child, I remember playing quite a lot in the sand by the coast in the summers. I don&#8217;t think I cared very much about sandboxes though, except maybe for growing stuff in. Anyway, that&#8217;s totally besides the point with regards to today&#8217;s topic, which is about N2D&#8217;s sandbox, used to test out a project in development.</p>
<p>The problem, you see, is the fact that N2D is a <em>Designer</em>, running on top of a neural network, accessing it&#8217;s services.&#160; So when you are designing the network, it is also running.&#160; This means that all the stuff you type into the text-channels, will also be stored in the project. Something you don&#8217;t want while performing tests.</p>
<p>To overcome this issue, N2D can use a special directory as a sandbox in which it can copy projects that need testing. The sandbox project will be started in it&#8217;s own designer so you can play with it, with all of it&#8217;s features (including neuron streaming) without messing up the actual data.</p>
<p>To run the current project in a sandbox, use the &#8216;<em>Sandbox</em>&#8216; toolbar button or menu item <em>Debug/Sandbox</em>. This will save the project, copy it over to a temp directory (selectable in the &#8216;Tools/O<em>ptions</em>&#8216; window) and start a new session.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="254" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/Aboutsandboxes_F21B/image_thumb_2.png" width="671" border="0" /></p>
<p>When N2D is started in Sandbox mode, it will show this in the lower right corner, like so:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="74" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/Aboutsandboxes_F21B/image_thumb_1.png" width="181" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/17/about-sandboxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demos explained: Echo words</title>
		<link>http://janbogaerts.name/index.php/2009/03/12/demos-explained-echo/</link>
		<comments>http://janbogaerts.name/index.php/2009/03/12/demos-explained-echo/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 20:04:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[demos]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,75617674-4b23-47b3-99c4-0d7d4431c2b7.aspx</guid>
		<description><![CDATA[Most development tutorials start out with an &#8216;Hello world&#8216; type of application.&#160; This one doesn&#8217;t.&#160; The issue I had was the fact that a neural network is inherently a responsive system, that is, everything it does is a reaction to input.&#160; So, I figured, to illustrate this better, I could show a simple echo application.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Most development tutorials start out with an &#8216;<em>Hello world</em>&#8216; type of application.&#160; This one doesn&#8217;t.&#160; The issue I had was the fact that a neural network is inherently a <em>responsive system</em>, that is, everything it does is a reaction to input.&#160; So, I figured, to illustrate this better, I could show a simple echo application.&#160; It&#8217;s just as simple to make as a &#8216;Hello world&#8217; thingy, but actually does something:     <br />echo back everything sent to it.</p>
<p>To start the demo, go to <em>{Windows start}/N&#178;D/Demos/Echo words</em> if N&#178;D isn&#8217;t already running, otherwise, do <em>File/Open </em>and browse to the folder <em>{My documents}/NND/Demos/Echo</em>. Note that a project is opened by selecting a folder, not through a file (this might still change in the future, if required).&#160; If the project has already been opened, you can reopen it using <em>File/Recent projects</em>. Once opened, you should see something like this:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="511" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/DemosexplainedEcho_10CD0/image_thumb.png" width="610" border="0" /></p>
<p>Note that the echo channel (a text channel) is shown by default. This is because I saved the project with the channel opened: visibility of a channel is stored, not for other items at the moment.&#160; You can close this window by right clicking on the tab and selecting the <em>close</em> command. You can also control which channels are visible through the menu: <em>View/Communication Channels</em>. The designer will     <br />create a communication channel for each sensory interface in the network.</p>
<p>The Text channel contains the following items:</p>
<ul>
<li>In the bottom: a Text box to enter text you want to send to the network </li>
<li>with a toolbar on top of it containing
<ul>
<li>buttons to control the visibility of the top row items, </li>
<li>a toggle button for turning the speakers on/off, </li>
<li>a combo box to select the way the sin splits up the input strings into neurons </li>
<li>a button to send the text to the sin. </li>
</ul>
</li>
<li>in the middle is a list box containing the current conversation: all the text you sent interleaved with the answers of the network. </li>
<li>and finally the top row contains 2 listboxes which contain visualizations for the neurons that were processed as input by the sin (left one) and received for output (right part).&#160; Note: selecting a line in any of these 2 lists will also select the corresponding line in the <em>conversation section </em>and visa versa. </li>
</ul>
<p>If you make certain that &#8216;<em>Speaker</em>&#8216; is pressed and your loud speakers are turned on, you should here &#8216;Type here&#8217; once you press the &#8216;<em>send</em>&#8216; button (and haven&#8217;t changed the input text). Some items should also appear on the screen, something like:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="511" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/DemosexplainedEcho_10CD0/image_thumb_3.png" width="649" border="0" /></p>
<p>What just happened? Well, a whole lot really:</p>
<ul>
<li>The text channel displays the string &#8216;Type here&#8217; in the central dialog overview.&#160; This is done by the designer. </li>
<li>next, it sends the string to the Echo channel&#8217;s backing sensory interface which splits it up into 2 words: &#8216;type&#8217; and &#8216;here&#8217;.&#160; This is because it is in &#8216;Use Words&#8217; mode.&#160; There is another echo demo, called &#8216;echo letters&#8217; which is programmed to &#8216;Use letters&#8217; by the way.&#160; If you want, you can open this and try it to see the difference. In the &#8216;echo words&#8217; demo, the 2 words are converted into text neurons (by searching a dictionary of already created text neurons or by creating a new one, which is stored in the dictionary. These 2 text neurons are linked to a newly created neuron which represents the input event.&#160; This conversion is done by the sin itself. </li>
<li>The sin also raises an event to let the channel know about the neuron it just created as input value which is displayed in the top left list.&#160; A processor is created and the neuron representing the input event is pushed on it&#8217;s stack, which starts of the network. Up until now, we haven&#8217;t really used the neural network yet, everything was done using traditional code. This changes once the processor is started. </li>
<li>The processor &#8216;<em>executes</em>&#8216; the code attached to the links between the &#8216;input event&#8217; neuron and the text neurons (how this code gets there and how it looks like will be dealt with later).&#160; This is the neural network doing it&#8217;s thing which will eventually execute several &#8216;<em>Output</em>&#8216; instructions, sending neurons back to the sin. </li>
<li>When the sensory interface receives these neurons, it converts them back into a string and raises an event. And so we get back into the world of regular code. </li>
<li>The communication channel, which receives this event, displays the text in the conversation dialog and the neuron(s) that represent the string in the top right list box. </li>
</ul>
<p>Ok, but what exactly happened in the neural network itself? Truth is, not much as you will see. It&#8217;s time to show some code. If you select the &#8216;<em>Project</em>&#8216; tool-frame, you will notice 3 items: a mind map (more on that later) and 2 code items, each one is simply a reference to a neuron in the network. To open them, double click on the item.&#160; Let&#8217;s start with &#8216;<em>Code: ContainsWord(in)</em>&#8216;.</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2009/06/image.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="358" alt="image" src="http://janbogaerts.name/wp-content/uploads/2009/06/image-thumb.png" width="604" border="0" /></a> </p>
<p>Mmm, interesting. All GUI-like is probably the first thing you&#8217;ll notice. Indeed, there is currently no textual method for entering code, as more traditional development environments tend to use.&#160; I choose this way for 2 reasons: first, it&#8217;s faster to develop (at least, in WPF that is) and it lowers the entry barrier since you can visually put items together instead of having to conceptually create a peace of text in your mind, requiring a grater level of knowledge. In the long run though, this technique tends to be slower than writing code and it also somewhat limits the amount of code displayed, but be patient, there is a solution for this.</p>
<p>Lets first go over the 2 lower tabs.&#160; These represent the 2 different code lists that can be assigned to the neuron: the &#8216;<em>Rules</em>&#8216; and &#8216;<em>Actions</em>&#8216; list. Note that these lists are only created if there is code, for as long as you don&#8217;t drop any objects on the design surface, there isn&#8217;t actually a code list assigned to the neuron. The bottom tab-strip also has a context-menu which allows you to toggle wether this neuron is shown in the project tree (under the currently active folder, or the root if there is no folder). You can also create new code clusters from the sub toolbar, but remember these are code clusters (which can also point to code clusters), not neurons with code clusters assigned to them.</p>
<p>Both lists are called at different times, and serve a different purpose. Code in the <em>Rules</em> section, is called when this neuron is used as the meaning for a link that is currently being processed by the processor. The <em>Actions</em> code list is called by the processor when <strong>this</strong> neuron was processed by the processor and all other links have already been handled. Usually, you don&#8217;t program on the last tab (actions), it is provided to &#8216;view&#8217; the code that was attached to it by the sin that generated it (see further). Note that there are other tab possibilities, but these have no importance for now and will be explained later on.</p>
<p>So what does this actually mean for our example: well, the &#8216;<em>ContainsWord(in)</em>&#8216; neuron is used by the sin as the meaning for the link between the generated neuron and each word in the input string (this is pre defined), so for each word in the input text, it will call this little peace of code.</p>
<p>As you can see there are only 2 statements in this code list. The second statement calls an &#8216;Output&#8217; instruction which will send the content of the &#8216;<em>CurrentTo</em>&#8216; variable to the content of the &#8216;<em>CurrentSin</em>&#8216; variable, in other words, this is the actual echo. Both variables are system defined and are filled in by the processor, they can not be modified, unlike normal variables. You&#8217;ll notice that they appear to be multiple variables stacked on top of each other.&#160; This is to indicate that the same neuron is used in multiple places.&#160; It&#8217;s a visual cue to indicate if a code item is used somewhere else or not (ahh yes, unlike regular code, these are neurons, all linked to each other, there is nothing preventing you from literally using the same statement in different places). That&#8217;s it for doing the echo really.&#160; The rest of the code is simply to make certain that the sin will put all the words in 1 line with spaces in between them. This is spread out over 2 locations: the first statement and the &#8216;<em>Input actions</em>&#8216; code list of the sin.</p>
<p>The first one, is a &#8216;<em>Block</em>&#8216; statement, which can best be compared to a &#8216;Function call&#8217; except that there are no parameters or return value allowed. To view it&#8217;s content, use the drop down arrow for an inline visualization, or &#8216;<em>View code</em>&#8216;&#160; in the context menu to display the code in a new window. You should see something like this:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="458" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/DemosexplainedEcho_10CD0/image_thumb_2.png" width="868" border="0" /></p>
<p>Note that the code is located in the &#8216;<em>Statements</em>&#8216; tab this time if you opened a new view. That&#8217;s because a code block has an extra known code cluster attached to it: the code for the block.&#160; It can also have a rules and actions list, but these are not used in this example (and probably will rarely be used this way on code itself).</p>
<p>Ok, and what exactly does this code do? To explain that, perhaps a note first on how a text sin converts output data. Whenever it receives a neuron, it is converted to a string which is than sent as an event to the outside world.&#160; Off course, in our example, we don&#8217;t show each word on a separate row, instead, we show the entire input statement on a single line with spaces between the words.&#160; This can only be done if the sin knows where a sentence starts and where it ends, otherwise it simply sees a stream of output data. So to accomplish this, there are 2 special neurons that it recognizes: &#8216;<em>BeginTextBlock</em>&#8216; and &#8216;<em>EndTextBlock</em>&#8216;. When these are sent to a text-sin, they are not converted, but instead, BeginTextBlock will make it accumulate all the strings until the EndTextBlock neuron is received. So that&#8217;s what this little bit of code does: it checks if this is the first word being processed, if so, the &#8216;BeginTextBlock&#8217; neuron is sent and we store a switch so we know of this event.&#160; If it wasn&#8217;t the first one, we sent a space to the sin, so we don&#8217;t concatenate the words. The &#8216;EndTextBlock&#8217; is handled in a different way, we&#8217;ll get back to that later on.</p>
<p>First a bit about the different statements that were used in this little code block.&#160; The top most one is a conditional statement, set to &#8216;if&#8217;.&#160; N&#178;D takes conditional statements even further than <a href="http://users.telenet.be/GeneCompiler/Language_specification.html#Options">Gene</a> and     <br />completely unites all different conditionals into 1 and the same statement type, with an option to switch between them.&#160; So a Do-while, While-Until, For-Each, For, if, case, and case-loop (not possible in other languages) are all combined into 1 statement, with a single neuron that switches between the 2. This approach is taken because of it&#8217;s ease in coding: it becomes a lot easier to change an if statement to a loop with multiple if&#8217;s: simply make it a loop (yes, you can have multiple conditions in a while loop). To design this bit of code, you can simply drag a &#8216;Conditional statement&#8217; to the designer and drop &#8216;Conditional parts&#8217; in the &#8216;Children&#8217; area to the right. A conditional part forms a single trunk of the evaluation tree. It contains a list of code items (which can also be dropped on it&#8217;s respective &#8216;<em>Children</em>&#8216; drop area) and possibly a condition that determines if the part&#8217;s code is executed or not. This condition should evaluate to the &#8216;True&#8217; or &#8216;False&#8217; neurons.&#160; Usually this is done by a Boolean expression (as has been done in this example), but this is not required, it could just as well have been a result statement that returns &#8216;True&#8217; or &#8216;False&#8217;.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 15px 0px 0px; border-right-width: 0px" height="41" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/DemosexplainedEcho_10CD0/image_thumb_5.png" width="135" align="left" border="0" /> A word perhaps on the little arrows found on the variables to the right of the name.&#160; These allow you to assign a default value to the variables.&#160; In our example, we can&#8217;t use this cause all of them are system variables who&#8217;s values are controlled by the processor.&#160; Regular values however don&#8217;t have a value the first time they are accessed in the context of a processor.&#160; You can use this little drop target to assign a default value.&#160; This can be a constant, or another statement that can be resolved to one or more neurons. </p>
<p>Another important fact about these variables is that they can point to 1 or more neurons.&#160; They actually function as buckets.&#160; This is very useful in that there is only 1 known type: a list of neurons.&#160; This list can contain 1 item or more.&#160; Often times, you will use a split to resolve multiple values to 1.</p>
<p>The last part of this demo can be found in the &#8216;<em>Code: Echo channel</em>&#8216; Project item, which is actually a reference to the text sin.&#160; If you open the &#8216;Input actions&#8217; tab, you&#8217;ll see the final 2 statements for this demo. This tab represents a code cluster that the text-sin attaches to each input neuron that it generates so it can be executed after all other links have been.&#160; In our example, we do 2 things: let the sin know the sentence is closed so the string can be displayed and delete the input neuron, so we don&#8217;t let the network grow indefinitely. By default, all data is always stored, if you don&#8217;t want this, like in this example, you will need to manually delete the neuron.&#160; All of it&#8217;s links and stuff will be cleaned     <br />up automatically.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="344" alt="image" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/DemosexplainedEcho_10CD0/image_thumb_4.png" width="647" border="0" /></p>
<p>The notion that the code is spread out over different locations and called at different times is an important point: a neuron network can not be programmed in a monolithic fashion as a single code block. Code is always divided into small chunks, which run at different times, in an undetermined order.&#160; This is where a lot of it&#8217;s power comes from.&#160; Once you grasp this, you are a long way into designing something truly beautiful.</p>
<p>Gosh, dear all mighty, this was a climb indeed. I&#8217;m glad you were able to get till here, all the way to the end. Even though this is a small demo, it packs a punch when it comes to new ideas. There are plenty more areas to cover, but I am certain that once you become more familiar with the basic concepts explained in this demo, the rest of the ride will be downhill. More demo explanations to come soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/12/demos-explained-echo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neural network Designer: getting your feet wet</title>
		<link>http://janbogaerts.name/index.php/2009/03/09/nnd-getting-your-feet-wet/</link>
		<comments>http://janbogaerts.name/index.php/2009/03/09/nnd-getting-your-feet-wet/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 19:20:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Getting started]]></category>
		<category><![CDATA[N²D]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,46d967bb-edac-400b-aefd-c4a488cf2b9a.aspx</guid>
		<description><![CDATA[Despite it&#8217;s youth, N²D is already quite a large and rather complex application. Things like this tend to have a steep learning curve.  Off course, climbing a mountain is a lot easier if you have a map and proper control over your equipment.  I am working on the map, tools are up to you though.  [...]]]></description>
			<content:encoded><![CDATA[<p>Despite it&#8217;s youth, N²D is already quite a large and rather complex application. Things like this tend to have a steep learning curve.  Off course, climbing a mountain is a lot easier if you have a map and proper control over your equipment.  I am working on the map, tools are up to you though.  There are many ways you can play with the application without actually having to design a proper neural network. Here&#8217;s a short guide.</p>
<h4>Viewing and importing thesaurus data</h4>
<p>N²D has access to the English version of the <a href="http://www.ebswift.com/OpenSource/WordNetSQLServer/">WordNet</a> database through a sensory interface (input/output port). Apparently there are WordNet database for <a href="http://www.illc.uva.nl/EuroWordNet/">other languages</a>, but these are not yet available. To open the view for the WordNet data activate the menu item: <em>View/Communication Channels/WordNet </em>(note: opening for the first time can take a little time as the database needs to be opened, should get fixed somehow in the future).  This should show something similar to (although with less text):</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/NDgettingyourfeetwet_C728/image_thumb_2.png" border="0" alt="image" width="574" height="490" /></p>
<p>You can search for words in the database.  All known meanings will be displayed. You can also select to show a specific relationship type with the drop down list.  If &#8216;As Part&#8217; is pressed, all entries that contain the specified text will be shown.  You can either import a single meaning separately or the whole lot, including all the relationships (advised) and see the network grow.  The system should be able to do multiple imports at the same time (you&#8217;ll notice that a single import can take a long time, depending on how many relationships there are for the word). While the network is <em>learning, </em>the green box in the right bottom corner is filled.</p>
<p>You can browse through all the imported items from the thesaurus view.  You can select the type of relationship you want to see.  All root tree items represent root neurons for the specified relationship. With the text box, you can search for words in the tree. All neurons can be dragged to other locations (like mind maps for instance, see further).  It is also possible to add items to the tree by dropping them on the level they should reside.</p>
<h4>Creating Mind maps</h4>
<p>Mind maps allow you to <em>draw</em> neurons in a free form manner, similar like vector graphics. There are multiple ways to create new mind maps, you can:</p>
<ul>
<li>use the menu: Insert/Mind map</li>
<li>use the toolbar button (4th from left)</li>
<li>or when on the &#8216;Project&#8217; tool window, use the local toolbar button.  From here, you can also create sub directories, change the name of the project items (F2),&#8230;<br />
Note: Mind maps (and all other project items) are added to the currently selected folder or the folder that contains the currently selected item.</li>
</ul>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/NDgettingyourfeetwet_C728/image_thumb_4.png" border="0" alt="image" width="578" height="375" /></p>
<p>Most of the mind map commands are currently only accessible through it&#8217;s context menu. For creating new items, you can also use the toolbox. You can add different types of neurons or change them to another one.  Watch out with changing the type though, cause this might loose data sometimes (for instance, when you change a cluster into a regular neuron).</p>
<p>If you select a neuron, you can use different ways for showing &#8216;<em>related</em>&#8216; items, like children, incoming or outgoing links and clusters to which the selected item belongs. You can also manage to which clusters it belongs.  If you have multiple items selected, you can quickly create a cluster for them through the &#8216;<em>Make cluster</em>&#8216; command.</p>
<p>The easiest way to create a link between 2 items is by selecting them both (the first will be &#8216;<em>From</em>&#8216;, the second &#8216;<em>To</em>&#8216;) and activating the &#8216;<em>Link</em>&#8216; command. This will show a dialog with From and To already filled in, so you only have to select the meaning of the link.</p>
<p>As a side note, &#8216;<em>Sync with explorer</em>&#8216;: a very useful command, accessible from the main toolbar, allows you to quickly find the selected item in the explorer.  This can be used from most places in the designer (all items that have a neuron as backing).</p>
<h4>Drawing</h4>
<p>Yes, N²D is also a drawing application, although some further evolution is clearly needed in this area.  Drawing capability is provided so you can work with the visual sensory interfaces. To create a new image channel, activate the menu command <em>Insert/New Image channel</em>.</p>
<p>Perhaps a word about the difference between a sensory interface and a communication channel: the underlying network has sins, which are also just neurons and have no &#8216;<em>functionality</em>&#8216;. N²D, the designer, creates a &#8216;<em>communication channel</em>&#8216; for sins so you can work with them. If you use the network in a different application, the communication channel might look completely different, but the sin is still the same.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/NDgettingyourfeetwet_C728/image_thumb_5.png" border="0" alt="image" width="578" height="443" /></p>
<p>An image channel currently has 2 sections: the left part to manage/import multiple images (which is not yet fully functional) and a right part that will eventually contain 2 sections: an input and output section.  The output is currently not yet visible, but is supposed to function as the output part of the sin, so you can see images/videos that the network generates.</p>
<p>The input section works as an ink canvas, so you can use a pen table, and apply pen pressure (this can be toggled). The shape, size and color of the pen point can be selected. It is also possible to switch to a gum or selector.</p>
<h4>Commenting</h4>
<p>All neurons and some other types (like mind maps and frame editors) can have a description.  This is a FlowDocument (rich text format), so you format the text. Spell check is also provided. The description of the currently focused item is shown, you will have to make certain that the &#8216;Description&#8217; Tool window is visible.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/NDgettingyourfeetwet_C728/image_thumb_6.png" border="0" alt="image" width="578" height="452" /></p>
<p>Standard text editing functionality is present:</p>
<ul>
<li>Select the font type</li>
<li>and font size</li>
<li>Bold/Italic/underline and Outline</li>
<li>Bullets and numbering</li>
<li>Spell check</li>
</ul>
<p>As a side note: The selected item is a NeuronCluster, so it can have child neurons.  The explorer in this screenshot, is set to display it&#8217;s side panel which contains all the children of the selected cluster. Just like from the explorer, you are able to drag items from the left panel.  It&#8217;s also possible to drop neurons on the panel, which will add them as children to the selected cluster.</p>
<h4>Creating frames</h4>
<p>Frames are a form of compound objects (a group of neurons that form a single unit) which can be used to translate input from one form to another and to connect code to these compound objects. They are created in a similar way like mind maps, and can also be managed from within the project tool window.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/NDgettingyourfeetwet_C728/image_thumb_7.png" border="0" alt="image" width="579" height="481" /></p>
<p>To create a new frame, you basically push the toolbar buttons in sequence:</p>
<ul>
<li>The first one will create a new frame (a frame editor can contain multiple frames,usually they are related to each other somehow).</li>
<li>Next, you create a frame element for the selected frame (make certain there is one selected, there are still some bugs in this area). You can also drop items to be used as frame elements.</li>
<li>The third button creates a new frame evoker (all neurons in this list are put in a cluster &#8216;Evokers&#8217;, so you can easily do searches on them, more on that later). Like frame elements, you can also drop already existing items in there.</li>
<li>On the last tab, you can edit all the sequences for the frame.  Use the 4th toolbar button to add a new sequence, make certain it is selected and use the buttons to add/remove or move up and down the frame elements from the first tab to build a sequence.</li>
<li>The last toolbar button is used to display the &#8216;<em>Import from FrameNet</em>&#8216; dialog, with this frame editor already selected.</li>
</ul>
<h4>Importing frames</h4>
<p>If you don&#8217;t feel like creating your own frames, you can always see if they have already been included in <a href="http://framenet.icsi.berkeley.edu/">FrameNet</a>, which you can import, either from the menu <em>Tools/Import from FrameNet </em>or from the<br />
toolbar of a frame editor.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://bragisoft.com/blog/content/binary/WindowsLiveWriter/NDgettingyourfeetwet_C728/image_thumb_8.png" border="0" alt="image" width="643" height="522" /></p>
<p>You can search FrameNet using the textbox in the upper right corner. The first time you select a row in the upper list might take a little time, this is because he is loading the WordNet database (which takes a little time). This is required to provide a mapping between FrameNet and WordNet data (not provided by default). Some mappings have already been created but most still need to be defined.  Each time you display this dialog and change some mappings, these will be saved.</p>
<p>There are many more things to discover in the designer, but I&#8217;m all out of words for today, so I&#8217;ll continue this on another occasion.  In the mean time, lot&#8217;s of fun playing with your new toy.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/09/nnd-getting-your-feet-wet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System requirements</title>
		<link>http://janbogaerts.name/index.php/2009/03/07/system-requirements/</link>
		<comments>http://janbogaerts.name/index.php/2009/03/07/system-requirements/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 13:30:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[N²D]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,0ba48c15-0e3b-4bee-aae2-ae6511348eac.aspx</guid>
		<description><![CDATA[A note about the system requirements for N&#178;D. The installer is about 45 meg to download, but the app itself takes up over 440 MB and projects may also explode fairly fast so be prepared for a large peace of real estate usage on the hard disk.&#160; This is largely due to the WordNet and [...]]]></description>
			<content:encoded><![CDATA[<p>A note about the system requirements for <a href="http://www.janbogaerts.name/files/setup.exe">N&#178;D</a>. The installer is about 45 meg to download, but the app itself takes up over 440 MB and projects may also explode fairly fast so be prepared for a large peace of real estate usage on the hard disk.&#160; This is largely due to the <a href="http://www.ebswift.com/OpenSource/WordNetSQLServer/">WordNet</a> and <a href="http://framenet.icsi.berkeley.edu/">FrameNet</a> databases.</p>
<p>The whole thing is written in C#, the designer in WPF.&#160; So for the time being it is strictly windows stuff (XP or vista). The core neural network and sensory interface libraries should be portable to <a href="http://www.mono-project.com/Main_Page">Mono</a> but    <br />the designer will be a tat difficult. I don&#8217;t know yet how to tackle this one.</p>
<p>With regards to processors I can be simple: the more the better.&#160; This is a massively multi threaded application, so the more cores the faster it should run.&#160; I only have a dual core here, so I haven&#8217;t had the change yet to see it running on lots of threads simultaneously, but I would love to find out.&#160; As I am writing this, I am sure there will still be a lot of bugs to filter out.</p>
<p>So to recap:</p>
<p>OS: Win XPSP2/Vista   <br />Platform: .net/WPF    <br />Hard Disk: + 450 MB    <br />CPU Cores: as many as you can find <img alt="Tongue out" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/tongue_smile.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/07/system-requirements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intro: a birth</title>
		<link>http://janbogaerts.name/index.php/2009/03/05/intro-a-birth/</link>
		<comments>http://janbogaerts.name/index.php/2009/03/05/intro-a-birth/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 19:12:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,47778e50-3aaa-4c7e-92cc-495177850d71.aspx</guid>
		<description><![CDATA[Since every blog needs a first post, I thought I&#8217;d make the subject a little appropriate and start with the birth of the idea that eventually came to generate this blog. I guess this story starts about 2 years ago, round early 2006, just after doing my evening meditation exercises. This, by the way, tends [...]]]></description>
			<content:encoded><![CDATA[<p>Since every blog needs a first post, I thought I&#8217;d make the subject a little appropriate and start with the birth of the idea that eventually came to generate this blog. I guess this story starts about 2 years ago, round early 2006, just after doing my evening meditation exercises. This, by the way, tends to be one of my default thinking cap times (I usually also have one in the morning, afternoon and early evening). Ideas tend to come to me in flashes, heavy bright, very intense and just as short flashes.&#160; <br />This one was no exception.</p>
<p>I believe I wrote the idea down somewhere, as I usually do, in order not to forget it, just don&#8217;t ask me where that paper would be.&#160; I have always found it ironic that I am not able to remember any of my ideas if I don&#8217;t write them down, however once written, it is known and I usually don&#8217;t need to consult any papers again to remember, but if I forgo this, oh dear,&#8230;&#160; Very annoying at times (especially if there is no paper around). Anyway, ideas come in all shapes and forms, some are good, some bad, some are hard to tell.&#160; This one fell in the latter category: simple, elegant, but lets kid ourselves not: very far fetched.&#160; So for a long time, I focused on other things, things I new would work, things that are within reason.</p>
<p>At this point, I should note something about my health. you see, for the last couple of years this had slowly been going downhill. Back &amp; leg pain and fatigue had been plaguing me for the last couple of years, in crescendo ever since the age of 23-24.&#160; At the beginning, it was believed to originate from a back injury, but because of it&#8217;s persistency other paths were considered, but never fully acknowledged. So, for a long time, I simply struggled along, basically hoping for the pain to go away, which it did on occasion, giving me hope again to one day be able to pick up where I left off.&#160; So I maintained my programming skills, learned what needed learning and tried to find my way in this world.</p>
<p>Things took a turn though, somewhere round March of 2008 when I began to feel a nuisance in the stomach. After an initial endoscope, the doctor appeared somewhat concerned and didn&#8217;t immediately inform me of his findings but instead sent a letter to my local doctor explaining things and requesting some further observation.&#160; Apparently he had seen something that looked remarkably a lot like <a href="http://en.wikipedia.org/wiki/Crohn%27s_disease">Crohn&#8217;s disease</a>. Off course, as soon as that name was mentioned, I new,&#8230; If crohn was in play, all these years could simply have been the foreplay for <a href="http://en.wikipedia.org/wiki/Ankylosing_spondylitis">Bechterew&#8217;s</a>: <a href="http://en.wikipedia.org/wiki/FUBAR">FUBAR</a>.     <br />At that time, I panicked.</p>
<p>To properly explain my reaction, I should probably first tell you about my love for moving images in all shapes and sizes (preferably with some colors though). My humble gratitude goes out to <a href="http://www.kino.com/edison/d1.html">Edison</a>, <a href="http://en.wikipedia.org/wiki/John_Logie_Baird">Baird</a>, <a href="http://en.wikipedia.org/wiki/Vladimir_Zworykin">Zworykin</a>, <a href="http://en.wikipedia.org/wiki/Philo_T._Farnsworth">Farnsworth</a>, and so many others who helped to create this most wonderful of teaching instruments.&#160; With this little box, I was allowed to live a thousand different lives without having to suffer any of them. A most educating experience.&#160; (Note: I must admit, I don&#8217;t know yet how to judge it&#8217;s current evolutionary path.&#160; In some ways it&#8217;s probably good in others just crap.&#160; I do know though, that I watch a lot less lately, more perhaps on that later). Anyway, thanks to TV, I was allowed to discover my worst fear: dying, knowing I had the potential but not the guts to simply try. You see, my panic stemmed from the idea that if Crohn’s (or perhaps even Bechterew&#8217;s) is at play, I might not have that many useful typing years left, and from a <a href="http://users.telenet.be/GeneCompiler/">previous experience</a>, I knew how projects like this can horribly wonder out of there original time frame. </p>
<p>Decisions were made.</p>
<p>In order to achieve the most rapid development time possible, I decided to cut every corner I could.&#160; Basically this means I simply wrote the app in one go.&#160; I didn&#8217;t make any design papers, there isn&#8217;t a single test, nothing. The code is fairly well documented though, for my own sanity. Work schedule was simple: mornings to control the pain and get the machinery going, afternoons and early evenings coding, late evening meditating on tomorrows tasks so the next day could go as smooth as possible. This schedule only got interrupted for required events like family dinners and recovery periods (days I was not able to type or everything was just hurting to much for any sane thought to emerge).</p>
<p>To guide me through the code as design paper, I simply replayed the idea scene over and over again in the evenings so I could carefully observe all the details. How, as a thought, I was traveling over the links which were generated just in front of me.&#160; How all of a sudden I split up into many different paths, some growing thicker, some thinner, others simply dying out. How these splits could form loop backs and how they finally join again.</p>
<p>Somewhere round august, my doctor noted things weren&#8217;t improving at all and changed my medication to <a href="http://www.humira.com/CrohnsDisease/Default.aspx">Humira</a>. This was a life saver. Recovery periods got shorter and shorter, and farther in between.&#160; Up to the point that the last one must have been a couple of weeks ago now and only lasted a day.&#160; I&#8217;m not pain free yet and eating is still no fun. The back can also still let itself be known.&#160; But at least I am able to function somewhat again.&#160; So development speed picked up and as the whole thing slowly began to work, I realized this might actually be something. So I eventually decided to put together <a href="http://www.janbogaerts.name/files/a_new_neural_network.pdf">a paper</a> and <a href="http://www.janbogaerts.name/files/setup.exe">an installer</a> to find out what other people might think of it. For those of you brave enough to try out this beast, I feel a little warning is in order: as it is the very very first proto release, there are still some extreme rough edges.&#160; Some things aren&#8217;t working completely and others simply aren&#8217;t finished yet. Only 1 demo works fully, an other one almost. Things should improve rapidly over the next few weeks though, so bare with me.</p>
]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/05/intro-a-birth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
