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

<channel>
	<title>Neural Network Design blog &#187; AI</title>
	<atom:link href="http://janbogaerts.name/index.php/tag/ai/feed/" rel="self" type="application/rss+xml" />
	<link>http://janbogaerts.name</link>
	<description>My take on neural networks, AI and more</description>
	<lastBuildDate>Thu, 15 Dec 2011 18:43:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Complete the sequence</title>
		<link>http://janbogaerts.name/index.php/2011/08/21/complete-the-sequence/</link>
		<comments>http://janbogaerts.name/index.php/2011/08/21/complete-the-sequence/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 18:51:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[code editor]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[screencasts]]></category>
		<category><![CDATA[sequences]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2011/08/21/complete-the-sequence/</guid>
		<description><![CDATA[Check out this first ‘AI’ feature that can be done using only 1 rule and, if needed, some thesaurus lookups. I’ve been having a huge smile on my face all day For the interested, here’s a screenshot of the rule that enables this trick (click to enlarge): The important bit is the :complete after the [...]]]></description>
			<content:encoded><![CDATA[<p>Check out this first ‘AI’ feature that can be done using only 1 rule and, if needed, some thesaurus lookups.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:23fe3611-3a56-4d5f-a4c2-89cfdb3d7461" class="wlWriterEditableSmartContent">
<div id="3a266003-6e95-417d-bc23-e240a45fe015" style="margin: 0px; padding: 0px; display: inline;">
<div><a href="http://www.youtube.com/watch?v=fG9MfdKOhes&amp;hd=1&amp;fs=1" target="_new"><img src="http://janbogaerts.name/wp-content/uploads/2011/08/videoef38c5df47b83.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('3a266003-6e95-417d-bc23-e240a45fe015'); downlevelDiv.innerHTML = &quot;&lt;div&gt;&lt;object width=\&quot;448\&quot; height=\&quot;252\&quot;&gt;&lt;param name=\&quot;movie\&quot; value=\&quot;http://www.youtube.com/v/fG9MfdKOhes?hl=en&amp;hd=1\&quot;&gt;&lt;\/param&gt;&lt;embed src=\&quot;http://www.youtube.com/v/fG9MfdKOhes?hl=en&amp;hd=1\&quot; type=\&quot;application/x-shockwave-flash\&quot; width=\&quot;448\&quot; height=\&quot;252\&quot;&gt;&lt;\/embed&gt;&lt;\/object&gt;&lt;\/div&gt;&quot;;" alt=""></a></div>
</div>
</div>
<p>I’ve been having a huge smile on my face all day <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-laughingoutloud" alt="Laughing out loud" src="http://janbogaerts.name/wp-content/uploads/2011/08/wlEmoticon-laughingoutloud.png" /></p>
<p>For the interested, here’s a screenshot of the rule that enables this trick (click to enlarge):</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2011/08/Capture.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Capture" border="0" alt="Capture" src="http://janbogaerts.name/wp-content/uploads/2011/08/Capture_thumb.jpg" width="553" height="89" /></a></p>
<p>The important bit is the <em>:complete</em> after the variable $ToComp which performs the calculation.</p>
<p>Here’s another screencast that shows what’s happening behind the scenes (basically, it’s a walkthrough of the neural code in the designer):</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:cc68f9f7-e5e1-4d8c-b663-69cff35ba00d" class="wlWriterEditableSmartContent">
<div id="947237f8-5554-411f-8eb9-c00912acab47" style="margin: 0px; padding: 0px; display: inline;">
<div><a href="http://www.youtube.com/watch?v=JKx3JWLj3S4&amp;hd=1&amp;fs=1" target="_new"><img src="http://janbogaerts.name/wp-content/uploads/2011/08/video49ca0469f5584.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('947237f8-5554-411f-8eb9-c00912acab47'); downlevelDiv.innerHTML = &quot;&lt;div&gt;&lt;object width=\&quot;448\&quot; height=\&quot;252\&quot;&gt;&lt;param name=\&quot;movie\&quot; value=\&quot;http://www.youtube.com/v/JKx3JWLj3S4?hl=en&amp;hd=1\&quot;&gt;&lt;\/param&gt;&lt;embed src=\&quot;http://www.youtube.com/v/JKx3JWLj3S4?hl=en&amp;hd=1\&quot; type=\&quot;application/x-shockwave-flash\&quot; width=\&quot;448\&quot; height=\&quot;252\&quot;&gt;&lt;\/embed&gt;&lt;\/object&gt;&lt;\/div&gt;&quot;;" alt=""></a></div>
</div>
</div>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=631" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2011/08/21/complete-the-sequence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On flows</title>
		<link>http://janbogaerts.name/index.php/2010/11/02/on-flows/</link>
		<comments>http://janbogaerts.name/index.php/2010/11/02/on-flows/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 14:03:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[AICI]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[Structures]]></category>
		<category><![CDATA[flow recoginition]]></category>
		<category><![CDATA[flows]]></category>
		<category><![CDATA[parsing]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/11/02/on-flows/</guid>
		<description><![CDATA[Note: Deprecated! An introduction In short, a flow is a template definition of recognizable data. It is used to transform a stream of neurons into another stream of neurons (doesn’t sound very useful, but trust me, it is).  To get a visual image on how a flow works, you can perhaps think of those toddler [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note: Deprecated</strong></em>!</p></blockquote>
<h3>An introduction</h3>
<p>In short, a flow is a template definition of recognizable data. It is used to transform a stream of neurons into another stream of neurons (doesn’t sound very useful, but trust me, it is).  To get a visual image on how a flow works, you can perhaps think of those toddler toys where the child needs to fit different types of blocks into different types of wholes (see image).</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/11/babys-first-blocks.jpg"><img style="margin: 0px auto; display: block; float: none; border-width: 0px;" title="babys first blocks" src="http://janbogaerts.name/wp-content/uploads/2010/11/babys-first-blocks_thumb.jpg" border="0" alt="babys first blocks" width="275" height="275" /></a></p>
<p>Well, a Flow is the yellow filter at the top of the box. As the blocks pass along, a flow tries to find a set that fits it’s filter. When it finds one, it collects this set, tags it, and stores it for further use. This process is done by the <em>flow recognition algorithm</em>.</p>
<blockquote><p>A flow is a template definition, used to recognize sequences of data in a stream.</p></blockquote>
<h3>flow items</h3>
<p>So, what is this filter that’s supposed to recognize the data, actually constructed of? Well, flow definitions are very (mmm, perhaps not so very) similar to <a href="http://en.wikipedia.org/wiki/Coco/R" target="_blank">Coco/R</a> definitions. In short, you use constants, other (nested) flows, loops and options to build up a definition. Here’s a short example:<br />
<a href="http://janbogaerts.name/wp-content/uploads/2010/11/image.png"><img style="margin: 5px auto; display: block; float: none; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/11/image_thumb.png" border="0" alt="image" width="121" height="34" /></a> This flow can recognize the sequence: <em>Agent verb</em> possibly followed by a <em>not</em>. It’s actually the definition for the <em>simple past tense</em> (there’s an extra hidden filter on ‘verb’ which I’m not showing yet for this example). ‘Agent’ is underscored, indicating that it is another flow, <em>verb</em> is not, so it’s a static, like <em>not</em>. Which is surrounded by strait brackets, indicating that it’s optional. So basically, this flow can recognize statements like: <em>I swam, you dug, the brown men found not</em>,… Without the filter (like here), sentences like: <em>I fish, they eat not,…</em> would also be recognized.</p>
<h4>Statics and nested flows</h4>
<p>Most of the items in a flow definition tend to be statics and other, nested flows. This forms the meat, the data that can be found in the input stream itself. When 2 statics are declared in sequence, the same sequence needs to be found in the input, without anything in between.</p>
<p>Nested flows can easily be recognized. They are underlined. If you double-click on them, you will jump automatically to the flow (you can navigate back and forward between the selected flows using the navigation commands). Behavior-wise, nested flows are the same as statics. If you declare 2 nested flows in sequence, the input stream should contain the data for the 2 flows in the same sequence.</p>
<h4>Floating flows</h4>
<p>A floating flow is a special type of flow that can be recognized anywhere in the stream without having to be specifically declared in any other flows. They are mostly used for things like spaces and newlines. You usually don’t integrate them into other flows, as nested.</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/11/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/11/image_thumb1.png" border="0" alt="image" width="186" height="86" /></a></p>
<p>Floating flows can be destructive or not. When a destructive flow is found, it will break up the recognition of other data in the stream. So this type of flow can not be found between 2 statics, but can be between 2 nested flows or between options, loops or conditional parts (see further). If you need to have a floating flow between 2 statics, it needs to be non destructive. The type of flow can be assigned from a context menu on the flows: you can select for normal flows (not floating), floating (visualized by a green bar in front of the flow) and non destructive floating (displayed using a blue bar).</p>
<p>You can also specify if the data that a floating flow finds is discarded or not. Discarding the data can be useful in cases where you are really not interested in it, like for empty space. This is also selected from the context menu on the flows and is visualized by using an extra bar at the end of the flow.</p>
<h4>Options</h4>
<p>With an option you can define a number of different paths, from which 1 can or has to be selected. The following example of options defines the ‘can’ verb:<a href="http://janbogaerts.name/wp-content/uploads/2010/11/Capturecan.jpg"><img style="margin: 5px auto; display: block; float: none; border-width: 0px;" title="Capturecan" src="http://janbogaerts.name/wp-content/uploads/2010/11/Capturecan_thumb.jpg" border="0" alt="Capturecan" width="211" height="126" /></a>A blue block (also called ‘conditional part’) represents a single path. If the frontal bracket of the options contains a vertical line, 1 path has to be selected, if there is no line, no path has to be selected but 1 can be. The content of a conditional has to be recognized in the same sequence as the way that it is defined and can consist of statics, flows, loops and other options, but no conditional parts. The option itself can only contain conditional parts.</p>
<p>Just like statics and nested flows, you can also reuse the same option in different places. In fact, the more you can do this, the more processing power can be saved. The same goes for the conditional parts (the blue blocks). These can also be shared by different options (and loops). This can be done by drag and drop from within the editor.</p>
<h4>Loops</h4>
<p>Loops are very similar to options, they also consist of conditional parts and they can also be defined with a vertical line in front, indicating that 1 path has to be selected or not. The main difference with options is that a loop can recognize 0, 1 or more of it’s conditional parts in sequence. They are declared using curly brackets, like in the following example:<a href="http://janbogaerts.name/wp-content/uploads/2010/11/CaptureIntDef.jpg"><img style="margin: 0px auto; display: block; float: none; border-width: 0px;" title="CaptureIntDef" src="http://janbogaerts.name/wp-content/uploads/2010/11/CaptureIntDef_thumb.jpg" border="0" alt="CaptureIntDef" width="75" height="32" /></a> This loop simply declares a sequence of digits, with at least 1 required digit. In other words, it’s the definition for an integer.</p>
<p>Loops can have some more lines in the front to declare extra info. If there is a green line present, to the right of the black one, it means there can’t be a floating flow in between 2 conditional parts, otherwise this is allowed (see floating flows). A red line to the left of the black one, indicates exactly the opposite: 2 conditionals need to have a floating flow in between them for a valid parse (not often used).</p>
<p>As a final example, here’s the entire scanner definition which is used to recognize words, numbers (integer and doubles), signs and spaces:</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/11/image2.png"><img style="margin: 0px auto; display: block; float: none; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/11/image_thumb2.png" border="0" alt="image" width="479" height="348" /></a></p>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=489" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/11/02/on-flows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objects and assets: abstract and concrete</title>
		<link>http://janbogaerts.name/index.php/2010/07/12/objects-and-assets-abstract-and-concrete/</link>
		<comments>http://janbogaerts.name/index.php/2010/07/12/objects-and-assets-abstract-and-concrete/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 16:54:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[AICI]]></category>
		<category><![CDATA[Structures]]></category>
		<category><![CDATA[assets]]></category>
		<category><![CDATA[objects]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/07/12/objects-and-assets-abstract-and-concrete/</guid>
		<description><![CDATA[Today, I’d like to write a little bit about some of the internal data structures used by aici. More specifically, how it stores abstract and concrete knowledge or in other words, the structures used to make a difference between general understanding and concrete, recorded data. For instance, the abstract can be ‘a house’ while the [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I’d like to write a little bit about some of the internal data structures used by aici. More specifically, how it stores <em>abstract</em> and <em>concrete</em> knowledge or in other words, the structures used to make a difference between general understanding and concrete, recorded data.</p>
<p>For instance, the abstract can be ‘a house’ while the concrete is ‘The house that I live in,… my house. Aici needs a way to distinguish the 2 and be able to find relationships between both. This is done through the use of different data structures.</p>
<h4>Objects</h4>
<p>Lets start with the objects, these are the simplest. They represent abstract knowledge. Every interpretation of every word is represented by an object. For instance, ‘house’ can mean the house that you live in, but could also refer to a musical style. So there is an object for each interpretations of the word. Furthermore some words can have synonyms, words that have the same meaning. For instance, ‘house’ and ‘home’ could be considered as synonyms, or house and ‘house music’. With ‘house music’ being a compound word: 2 words joined together to form a new meaning. Other examples of compound words are: car factory, fire hose, film studio,…</p>
<p>Another bit of information that can be useful to know about a word, is how it should be interpreted in the context of a sentence: can it be a noun, verb, adjective,…. Sometimes, a word can have multiple interpretations, while being used as the same sentence type (like house), sometimes multiple sentence types are allowed for a single meaning (colors for instance can be used as adjectives or nouns: ‘my eyes are blue’, ‘that blue is pretty’ ). As a speed optimization, we group all the objects together that have the same part of speech, but with different meanings in ‘Pos-groups’, though this is not required.</p>
<p>As a visual example, let’s take the objects ‘hello’ and ‘goodbye’ (as in a greeting). Both are nouns (it’s <em>an</em> hello and <em>a</em> goodbye). Both have multiple synonyms: hi, howdy, bye,..&#160; So here’s how this would look like:</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/07/image3.png"><img style="border-right-width: 0px; margin: 0px auto; display: block; float: none; 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/07/image_thumb3.png" width="672" height="235" /></a></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/07/image4.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" align="left" src="http://janbogaerts.name/wp-content/uploads/2010/07/image_thumb4.png" width="332" height="265" /></a> <a href="http://janbogaerts.name/wp-content/uploads/2010/07/image5.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" align="right" src="http://janbogaerts.name/wp-content/uploads/2010/07/image_thumb5.png" width="332" height="240" /></a></p>
<h5></h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>&#160;</h5>
<h5>Relationships between objects: the Thesaurus</h5>
<p>Objects are stored in a thesaurus like structure to indicate relationships between them. For instance, both ‘aici’ and ‘jan’ are names, so&#160; this could be expressed in a thesaurus relationship like in the 2 images below:</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/07/image6.png"><img style="border-right-width: 0px; margin: 0px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://janbogaerts.name/wp-content/uploads/2010/07/image_thumb6.png" width="136" height="145" /></a></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/07/image7.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/07/image_thumb7.png" width="428" height="285" /></a></p>
<p>Notice (to the left) that the ‘noun’ filter was selected in the thesaurus together with the ‘is a’ relationship. To the right, you can see how this is represented internally: <em>Name</em> points to an ‘is a’ cluster, which contains all the related objects. So the ‘Noun filter works by only displaying objects that point to ‘noun’ or are clustered by a ‘noun’ pos-group while the ‘is a’ relationship will filter out all but the clusters attached to the roots using this ‘is a’ neuron.</p>
<p>Sometimes a root object doesn’t have any children (as in cluster-children, not in the thesaurus). This makes the object a dummy, a placeholder that shouldn’t be used for input or output directly, but only for filtering. Some examples of these dummies can be seen when the ‘pronouns’ are selected.</p>
<p>The thesaurus relationships can be used in frames to filter the input in a general way and to perform lookups by the actions. For instance, the ‘be name’ frame (in the ‘names’ editor) has an ‘object flow’ element that filters on ‘name’ through the ‘is a’ relationship, as seen in the image below.</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/07/image8.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/07/image_thumb8.png" width="781" height="259" /></a></p>
<p>This means that the frame is only selected when the input contains the result of an object flow that is the child of an ‘is a’ cluster, attached to &#8216;name’ or one of it’s thesaurus children (so multiple levels are allowed).</p>
<blockquote><p>To create this type of filter by the way, you simply drag ‘name’ from the thesaurus to the filter area.</p>
</blockquote>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/07/image9.png"><img style="border-right-width: 0px; margin: 0px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://janbogaerts.name/wp-content/uploads/2010/07/image_thumb9.png" width="238" height="488" /></a>Actions also make use of these thesaurus relationships in a very similar way. For instance, an action could check if an object&#160; is allowed to/can be the name of something (‘my name is Jan’). Or, in sentences like: ‘<em>this is blue</em>’, the thesaurus is used to find out what ‘blue’ actually is: a color (I’m jumping here, keep with me, It will become clear very soon).</p>
<p>An object can also be the child of multiple items in a thesaurus. For instance, ‘blue’ is both the child of ‘colorful’ and ‘sad’ (child of ‘emotional’). Note that these are all adjectives, hence we say ‘colorful’ instead of ‘color’. To find out which relationship to take, we can make use of a log of previously made statements or a list of focused objects. The most important usage of either color(ful) or emotion(al) in this log, triggers it for the new input. <em>Most important</em> can be interpreted very <a href="http://janbogaerts.name/wp-content/uploads/2010/07/image10.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/07/image_thumb10.png" width="233" height="352" /></a>broadly: it could be ‘newest log item’, or ‘most talked about’,… If it is impossible to solve this, a question needs to be asked.</p>
<p>Anyway, once you have figured out which path to take in the thesaurus: colorful, we still have an adjective. If the same logical concept/idea can be expressed in multiple parts of speech, using different words (like color-colorful) and you want to be able to jump between the 2, you need to have a relationship between them. As I already stated, we interpret ‘blue’ as a ‘color’, not ‘colorful’. Why, will become more clear when we talk about the assets, for now lets just take it that we need to change from adjective or verb to noun. As you can see in the image, the thesaurus has a special section to define this type of relationship: the left part of the table contains the link meaning, the right section is the ‘from’ part of the link.</p>
<p>The same can be done for verb conjugations. In English, a verb usually has 3 different conjugational forms, other languages have others, so the thesaurus allows you to define this type of relationship free form, much like the part of speech relationships. When you create a new verb though, the designer will try to fill in all the conjugations (if it finds neurons titled ‘present particle’, ‘past particle’ and ‘third person present’. It’s always best to check them before storing the default though, since it doesn’t know about irregular verbs and sometimes it/I may simply goof up.</p>
<p>The verb conjugations, compared to the part-of-speech relationships, are used a bit differently. These serve their purpose while parsing the input and generating output. Some flow elements try to search for conjugation relationships while filtering (in the ‘FilterCode’ tab) in order to get the correct parse. For instance, in the ‘model verbs flow’, this is used to make certain that a verb is the present particle. The same goes for generating output: when a verb is used in certain situations (ex: ‘what’ contains a verb instead of a noun), we need to generate it’s present particle form (or another, depending on the exact situation).</p>
<h4>Assets</h4>
<p>Up until now, all relationships were between objects, so between abstract knowledge only. To record a network’s experiences (the data that it records), we use <em>assets</em> and <em>asset relationships</em>.</p>
<p>At it’s core, an asset is a cluster with meaning ‘<em>asset</em>’ (we’re very original here), which contains a number of child neurons that represent property-value pairs for that asset. This is done through links to objects and/or other assets, using the meanings: <a href="http://janbogaerts.name/wp-content/uploads/2010/07/image11.png"><img style="border-right-width: 0px; margin: 5px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://janbogaerts.name/wp-content/uploads/2010/07/image_thumb11.png" width="477" height="532" /></a> attribute, value, amount,… From this basic structure, we can start to play and create meaningful relationships.</p>
<p>As usual, a picture says a thousand words, so to the left, I’ve displayed a debug view of the ‘text channel’ neuron (the text input channel of AICI). Why this neuron? If you look closely, it has a link that points to an ‘asset’ cluster, using the meaning ‘Pr:You’. So with this image, I’ve got 2 birds with 1 stone: the asset and how to find the asset that AICI is using for the person on the other side of the channel <img src='http://janbogaerts.name/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p><em><em class="callout">A text channel stores a reference to the asset that represents the entity it is communicating with using a link with meaning ‘Pr:you.</em></em></p>
<p>As a side note, linking ‘you’ to the text channel, allows the system to talk to multiple users at the same time: each on their own channel.</p>
<p>So what’s stored in this asset anyway? As you can see, there are 2 child neurons in the asset, so 2 data items: the first has an attribute (property) of ‘entity’ and a (property) value of ‘animate entity’. The second asset-child&#160; points to ‘eye’ for the attribute, the value is another asset and it has a general <em>amount</em> of ‘plural’.</p>
<p>Note that the attribute should always be a noun. Having a fixed transformation point facilitates the search.&#160; Why a noun: well, all adjectives and action-verbs can be converted to a noun, but not the other way round. This conversion can be done using the part of speech relationships that were previously described.</p>
<p>The ‘entity’ property is how AICI tries to classify assets: is it an object, animate, animal, human,… If you look at the thesaurus (in the designer), ‘entity’ is a noun-root and the asset-child’s value is one of it’s children. This is a rule: when the value is an object, it must have a thesaurus relationship with the attribute. This type of child asset represents the ‘x is an y’ type of relationship. Here, it is ‘I am an animate entity’, an other example could be:&#160; ‘I am a human’, which would/should map to the same asset-child.</p>
<blockquote><p>- An asset-child with an object as value represents an ‘x is an y’ sentence structure.     <br />- In this case, the value must have a thesaurus relationship with the attribute. This relationship can span multiple levels.</p>
</blockquote>
<p>AICI at the moment,&#160; presumes that an ‘entity’ that is able to communicate through a text channel, must be animate (mammal, AI,…). So, even if this information is not yet provided, it is presumed to be the case. This is done cause the property and value play a role in other parts of the network.</p>
<p>The second asset-child has another asset as value. This type of relationships represents the ‘x has an y’ sentence structure. More specifically, in this example we said: ‘I have blue eyes’. This also explains the undefined ‘plural’ amount: eyes is plural and was converted into a single value, but since we don’t know exactly how many, we keep a ref to the multiple. The sub asset also has it’s own child-asset, which defines the ‘color-blue’ part of the example sentence. Through this nesting, it is possible to describe complex entities that consist out of multiple parts of knowledge.</p>
<blockquote><p>An asset-child that references another asset as value, represents an ‘x has an y’ sentence structure.<a href="http://janbogaerts.name/wp-content/uploads/2010/07/image12.png"><img style="border-right-width: 0px; margin: 10px 0px 0px 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/07/image_thumb12.png" width="434" height="413" /></a></p>
</blockquote>
<h5>Objects referencing assets</h5>
<p>Assets aren’t exactly islands, independent of everything else. No, they too are referenced in many different ways. We already saw 2: assets attached to child-assets, and to the text-channels.&#160; There’s one more reference worth mentioning at this moment: objects that reference assets. Yes, assets don’t just reference objects, it can also go the other way round. This is used to represent general knowledge about general things, like: ‘a human has hands’, as depicted in the image to the right. The same thing is also valid for statements like ‘an x is a y’: they are represented as assets, linked from objects.</p>
<p>Note: I did a bit of recycling with regards to the meaning of the link from the object: it also uses ‘asset’, which is the same as the meaning for the cluster.</p>
<blockquote><p>An object that references an asset cluster, using ‘asset’ as meaning for the link, is used to represent statements of the form: ‘an x is/has a y’</p>
</blockquote>
<p>The important difference between stand alone assets and assets that are linked to objects, are the information that they represent about the agent of a sentence: stand alone assets represent concrete agents: I, you, the book,… while object referenced assets represent abstract agents: a book, a human,…</p>
<p>These 2 data structures: objects and assets, are simple, but, I believe, flexible enough to represent a whole world of information. It is not as much the the querying and reshaping of the data as it will, in the end, be the automatic creation of these structures which I believe will ultimately be the truly interesting thing. With a query, we can retrieve data, reshaping it allows us to find truths, fallacies and falsities in the data, but a correct automatic creation of a new, complex asset, is in fact, a new entity.</p>
<blockquote><p>In the end, all is just structure.</p>
</blockquote>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=331" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/07/12/objects-and-assets-abstract-and-concrete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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[N²D]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/03/04/debugging-networks-split-paths/</guid>
		<description><![CDATA[Note: Deprecated! 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 [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note: Deprecated</strong></em>!</p></blockquote>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image4.png"><img style="margin: 0px 0px 0px 5px; display: inline; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb4.png" alt="image" width="362" height="323" align="right" border="0" /></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><span style="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. </span></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="margin: 0px 10px 0px 0px; display: inline; border: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb6.png" alt="image" width="400" height="246" align="left" border="0" /></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  algorithm. (see picture below).</p>
<p><em><span style="color: #808080;">Put breakpoints on ‘Add split result’ instructions to find </span></em><em><span style="color: #808080;">invalid split paths.</span></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>’.  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  possible to actually use the path anyway. <a href="http://janbogaerts.name/wp-content/uploads/2010/03/image2.png"><img style="margin: 0px 0px 5px 10px; display: inline; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb2.png" alt="image" width="383" height="91" align="right" border="0" /></a></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image5.png"><img style="margin: 5px 0px 0px; display: inline; border: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/03/image_thumb5.png" alt="image" width="294" height="310" align="left" border="0" /></a>So, finally we can start using the data to debug our network. The basic idea is to  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><em><span style="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.</span></em></p>
<p>&nbsp;</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/03/image2.png"> </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>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=205" width="1" height="1" style="display: none;" />]]></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>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[General]]></category>
		<category><![CDATA[N²D]]></category>
		<category><![CDATA[Programming]]></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 [...]]]></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>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=186" width="1" height="1" style="display: none;" />]]></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>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[N²D]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[AICI]]></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[Note: Deprecated! Intro Time for the second demo overview: the Scanner.  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).  It’s probably going to be a lengthy piece so I’m thinking of cutting it [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note: Deprecated</strong></em>!</p></blockquote>
<h4>Intro</h4>
<p>Time for the second demo overview: the Scanner.  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).  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 style="display: inline; margin: 0px 0px 5px 10px; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb.png" border="0" alt="image" width="606" height="419" align="right" /></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 style="display: inline; margin: 0px 0px 0px 10px; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb1.png" border="0" alt="image" width="105" height="98" align="right" /></a>The different types of  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 of 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 style="display: inline; margin: 0px 0px 0px 10px; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb2.png" border="0" alt="image" width="114" height="108" align="left" /></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 style="display: inline; margin: 0px 0px 0px 10px; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2009/10/image_thumb3.png" border="0" alt="image" width="145" height="110" align="right" /></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.  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.  This cluster is linked to one of 3 static neurons: <em>Digit</em>, <em>Alpha or</em> <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  the start of the ‘flow recognition’ algorithm, called ‘<em>Stage 1.1</em>’ and put the result cluster back on the stack.  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  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  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 global. Only after the last link of the last item on the stack has  been processed, are all the result clusters put back on the stack, with links for the next stage.  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.  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  split for the processor it ran on.  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  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  (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>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=168" width="1" height="1" style="display: none;" />]]></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>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[N²D]]></category>
		<category><![CDATA[AI]]></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[Note: Deprecated! 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, [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note: Deprecated</strong></em>!</p></blockquote>
<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 &#8216;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>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=82" width="1" height="1" style="display: none;" />]]></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>
	</channel>
</rss>

