<?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; flow recoginition</title>
	<atom:link href="http://janbogaerts.name/index.php/tag/flow-recoginition/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>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>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>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[N²D]]></category>
		<category><![CDATA[flow recoginition]]></category>
		<category><![CDATA[flows]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,53baa899-23c8-4710-90eb-3970277d27f3.aspx</guid>
		<description><![CDATA[Note: Deprecated! 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 [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note: Deprecated</strong></em>!</p></blockquote>
<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 &#8216;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 very 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><a href="http://janbogaerts.name/wp-content/uploads/2010/08/image9.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/08/image_thumb9.png" width="259" height="303" /></a> </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><a href="http://janbogaerts.name/wp-content/uploads/2010/08/image10.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/08/image_thumb10.png" width="664" height="993" /></a> </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 <em>(update: Oh boy, was I wrong with this one <img src='http://janbogaerts.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  )</em>, 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>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=37" width="1" height="1" style="display: none;" />]]></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>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[N²D]]></category>
		<category><![CDATA[flow recoginition]]></category>
		<category><![CDATA[flows]]></category>

		<guid isPermaLink="false">http://bragisoft.com/blog/PermaLink,guid,ec819077-366f-4a55-ab7d-ad514d9a0a05.aspx</guid>
		<description><![CDATA[Note: Deprecated! 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 it [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note: Deprecated</strong></em>!</p></blockquote>
<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><a href="http://janbogaerts.name/wp-content/uploads/2010/08/image8.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/08/image_thumb8.png" width="524" height="334" /></a> </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 border="0" cellspacing="0" cellpadding="2" width="633">
<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 &#8216;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>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=38" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2009/03/31/update-floweditor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

