<?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>Limina.Log &#187; Learning Bit by Bit</title>
	<atom:link href="http://log.liminastudio.com/category/itp/learning-bit-by-bit/feed" rel="self" type="application/rss+xml" />
	<link>http://log.liminastudio.com</link>
	<description>Research &#38; Development at Limina.Studio</description>
	<lastBuildDate>Sun, 15 Jan 2012 21:25:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Implementing the Perceptron Rule</title>
		<link>http://log.liminastudio.com/itp/implementing-the-perceptron-rule</link>
		<comments>http://log.liminastudio.com/itp/implementing-the-perceptron-rule#comments</comments>
		<pubDate>Sat, 17 Apr 2010 21:41:52 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Learning Bit by Bit]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thesis]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Neural Networks]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=586</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://log.liminastudio.com/itp/implementing-the-perceptron-rule' addthis:title='Implementing the Perceptron Rule '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>A perceptron is one of the simplest forms of neural networks: a linear classifier.  It is a method of associating input patterns with output patterns, with the advantage that it is forgiving of noise in the input. The network consists of an input and output layer (and optional &#8220;hidden&#8221; layers in between) with weighted connections [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://log.liminastudio.com/itp/implementing-the-perceptron-rule' addthis:title='Implementing the Perceptron Rule '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>A <a href="http://en.wikipedia.org/wiki/Perceptron">perceptron</a> is one of the simplest forms of neural networks: a <a href="http://en.wikipedia.org/wiki/Linear_classifier">linear classifier</a>.  It is a method of associating input patterns with output patterns, with the advantage that it is forgiving of noise in the input.</p>
<p>The network consists of an input and output layer (and optional &#8220;hidden&#8221; layers in between) with weighted connections between all of them.  To train a perceptron, you present an input pattern and the output pattern it should learn to output.  Then you step through each pair of neurons in each pair of layers and modify their weights with this equation:</p>
<p>∆w<sub>i</sub> = c (d &#8211; sign( ∑x<sub>i</sub>w<sub>i</sub>)) x<sub>i</sub></p>
<p>&#8230;where w<sub>i</sub> is the ith weight (real-valued), c is the learning constant (i.e. 0.1), d is the desired output for this node (1 or -1), and x<sub>i</sub> is the input activation (1 or -1).  The input activation term indicates that the input node in question &#8220;contributes&#8221; to the output or &#8220;inhibits&#8221; it.  sign() is given by:</p>
<p>sign(x) = 1 if x ≥ 0, else -1</p>
<p>Here&#8217;s a C++ implementation from my <a href="http://github.com/virgildisgr4ce/Neuroduino">Neuroduino</a> Arduino library:</p>
<pre>int Neuroduino::signThreshold(double sum){
	if (sum &gt;= _net.Theta) {
		return 1;
	} else {
		return -1;
	}
}

double Neuroduino::weightedSum(int l, int node){
	// calculates input activation for a particular neuron
	int i;
	double currentWeight, sum = 0.0;

	for (i=0; i&lt;_net.Layer[l-1]-&gt;Units; i++) {
		currentWeight = _net.Layer[l]-&gt;Weight[node][i];
		sum += currentWeight * _net.Layer[l-1]-&gt;Output[i];
	}

	return sum;
}

void Neuroduino::adjustWeights(int trainArray[]){
	int l,i,j;
	int in,out, error;
	int activation;	// for each "rightmost" node
	double delta;

	for (l=1; l&lt;_numLayers; l++) {
		// cycle through each pair of nodes
		for (i=0; i&lt;_net.Layer[l]-&gt;Units; i++) {
			// "rightmost" layer
			// calculate current activation of this output node
			activation = signThreshold(weightedSum(l,i));
			out = trainArray[i];	// correct activation
			error = out - activation;	// -2, 2, or 0

			for (j=0; j&lt;_net.Layer[l-1]-&gt;Units; j++) {
				// "leftmost" layer

				in = _net.Layer[l-1]-&gt;Output[j];

				delta = _net.Eta * in * error;
				_net.Layer[l]-&gt;Weight[i][j] += delta;
			}
		}
	}
}

void Neuroduino::simulateNetwork(){
	/*****
	 Calculate activations of each output node
	 *****/
	int l,j;

	for (l=_numLayers-1; l&gt;0; l--) {
		// step backwards through layers
		// TODO: this will only work for _numLayers = 2!
		for (j=0; j &lt; _net.Layer[l]-&gt;Units; j++) {
			_output[j] = signThreshold(weightedSum(1, j));
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/itp/implementing-the-perceptron-rule/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing the Enpersonator</title>
		<link>http://log.liminastudio.com/itp/developing-the-enpersonator</link>
		<comments>http://log.liminastudio.com/itp/developing-the-enpersonator#comments</comments>
		<pubDate>Tue, 02 Mar 2010 14:31:50 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[ITP]]></category>
		<category><![CDATA[Learning Bit by Bit]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Generative Text]]></category>
		<category><![CDATA[N-Grams]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=554</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://log.liminastudio.com/itp/developing-the-enpersonator' addthis:title='Developing the Enpersonator '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Using blog corpora from The Blog Authorship Corpus and the Political Blog Corpora, I have begun developing a simple blog-post generator for Enpersonator, the identity-creating software part of Automenon, an artwork in progress with Sofy Yuditskaya. See Enpersonator in action here: http://soniayuditskaya.tumblr.com/ Enpersonator is in development here: http://github.com/virgildisgr4ce/Enpersonator.  It requires the Python Tumblr library, which [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://log.liminastudio.com/itp/developing-the-enpersonator' addthis:title='Developing the Enpersonator '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Using blog corpora from <a href="http://u.cs.biu.ac.il/~koppel/BlogCorpus.htm">The Blog Authorship Corpus</a> and the <a href="http://www.ark.cs.cmu.edu/blog-data/">Political Blog Corpora</a>, I have begun developing a simple blog-post generator for Enpersonator, the identity-creating software part of Automenon, an artwork in progress with Sofy Yuditskaya.</p>
<p>See Enpersonator in action here: <a href="http://soniayuditskaya.tumblr.com/">http://soniayuditskaya.tumblr.com/</a></p>
<p>Enpersonator is in development here: <a href="http://github.com/virgildisgr4ce/Enpersonator">http://github.com/virgildisgr4ce/Enpersonator</a>.  It requires the Python <a href="http://code.google.com/p/python-tumblr/">Tumblr library</a>, which requires <a href="http://www.djangoproject.com/download/">Django</a> for its utilities.  The Markov Generator is modified from <a href="decontextualize.com/teaching/dwwp/topics-n-grams-and-markov-chains/">Adam Parrish&#8217;s</a>.</p>
<p>The current version uses all 5 of the blogs in the Political Blog Corpora, comprising 133,953 tokens.  Not too shabby, but still not enough to avoid lots of wholesale reproductions.</p>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/itp/developing-the-enpersonator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

