<?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>depth first search &#187; computer science</title>
	<atom:link href="http://www.depthfirstsearch.net/blog/category/computer-science/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.depthfirstsearch.net/blog</link>
	<description>“We can only see a short distance ahead, but we can see plenty there that needs to be done.&#34;</description>
	<lastBuildDate>Sun, 05 Feb 2012 13:00:00 +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>Topics and Services in ROS</title>
		<link>http://www.depthfirstsearch.net/blog/2012/01/26/topics-and-services-in-ros/</link>
		<comments>http://www.depthfirstsearch.net/blog/2012/01/26/topics-and-services-in-ros/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 23:45:15 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[computing]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2623</guid>
		<description><![CDATA[As an exercise, I wrote some code to translate between ROS topics and services. Both directions turned out to be somewhat tricky. For example, I had to use a condition variable to coordinate updating data from the topic (which is taken care of behind the scenes in ROS using a provided callback) with calls to [...]]]></description>
			<content:encoded><![CDATA[<p>As an exercise, I wrote some <a href="https://github.com/stober/topic_service">code</a> to translate between ROS <a href="http://www.ros.org/wiki/ROS/Tutorials/UnderstandingTopics">topics</a> and <a href="http://www.ros.org/wiki/ROS/Tutorials/UnderstandingServicesParams">services</a>. Both directions turned out to be somewhat tricky. For example, I had to use a condition variable to coordinate updating data from the topic (which is taken care of behind the scenes in ROS using a provided callback) with calls to the service. I couldn&#8217;t figure out whether the way the callback is used under the hood is thread safe, so there may be some extraneous locking in my solution.</p>
<p>Going the other direction is complicated by the fact that service request and response objects, which walk and talk like messages, aren&#8217;t actually messages. So populating a call to a service and reading the response requires specifying some code in advance that knows how to translate a service response into a proper message. You can&#8217;t use the response object as a topic message type directly since it&#8217;s not actually a visible message type and roscore will complain that it can&#8217;t find the message definition.</p>
<p>In general, it would be nice if services and messages could be specified dynamically, but I suspect that the performance requirements of serialization require that these be specified in advance and compiled.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2012/01/26/topics-and-services-in-ros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Sorting Puzzle</title>
		<link>http://www.depthfirstsearch.net/blog/2011/12/01/a-sorting-puzzle/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/12/01/a-sorting-puzzle/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 17:57:05 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2606</guid>
		<description><![CDATA[Maybe I&#8217;m underthinking the puzzle here, but it seems like heap sort solves the problem. It&#8217;s certainly meets the time requirements, but I wonder about the space issue. Does the array representation of a binary heap require a log number of pointers? More importantly, if this was my answer, would I get a job at [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe I&#8217;m underthinking the puzzle <a href="http://jsaia.wordpress.com/2011/11/28/puzzle/">here</a>, but it seems like heap sort solves the problem. It&#8217;s certainly meets the time requirements, but I wonder about the space issue. Does the array representation of a binary heap require a log number of pointers?</p>
<p>More importantly, if this was my answer, would I get a job at Google?</p>
<p>UPDATE: I don&#8217;t know the linear time solution, but I feel like if I could grok <a href="http://en.wikipedia.org/wiki/Smoothsort">smoothsort</a> I could figure it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/12/01/a-sorting-puzzle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Normal</title>
		<link>http://www.depthfirstsearch.net/blog/2011/11/09/normal/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/11/09/normal/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 21:34:30 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2595</guid>
		<description><![CDATA[I wrote a Python class for manipulating normal distributions. I use it as part of some code for GMMs (https://github.com/stober/gmm). I was looking for code that supported conditioning and marginalization on arbitrary indices. There didn&#8217;t seem to be any out there so I wrote this to fill in the gap (at least for Python).]]></description>
			<content:encoded><![CDATA[<p>I wrote a Python class for manipulating normal distributions. I use it as part of some code for GMMs (<a href="https://github.com/stober/gmm">https://github.com/stober/gmm</a>). I was looking for code that supported conditioning and marginalization on arbitrary indices. There didn&#8217;t seem to be any out there so I wrote this to fill in the gap (at least for Python).</p>
<p><script src="https://gist.github.com/1353114.js?file=normal.py"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/11/09/normal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Research Blogging from ICDL</title>
		<link>http://www.depthfirstsearch.net/blog/2011/08/26/research-blogging-from-icdl/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/08/26/research-blogging-from-icdl/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 06:24:19 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[academics]]></category>
		<category><![CDATA[computer science]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2570</guid>
		<description><![CDATA[I attended an interesting talk yesterday at ICDL-EpiRob on how one key property of developmental learning is trying over and over again at difficult tasks (like learning to walk). The experimenters found that a sense of elation would drive repeated failed trials which often led to better policies in the end, suggesting that being immune [...]]]></description>
			<content:encoded><![CDATA[<p>I attended an interesting talk yesterday at ICDL-EpiRob on how one key property of developmental learning is trying over and over again at difficult tasks (like learning to walk). The experimenters found that a sense of elation would drive repeated failed trials which often led to better policies in the end, suggesting that being immune to discouragement has certain functional advantages during development. Here&#8217;s the program citation if you&#8217;re interested:</p>
<blockquote><p>Trying anyways: how ignoring the errors may help in learning new skills<br />
B Grzyb, Jaume I University; J Boedecker, M Asada, Osaka University;<br />
A del Pobil, Jaume I University; L Smith, Indiana University</p></blockquote>
<p>There was another interesting talk on how agents developed shared meanings even though agents had different bodies. You may think this is a sort of strange thing to study, but it turns out that we all have different bodies, and if studies of retinal variation are to be believed, we all likely experience color qualia in different ways, and yet we have a shared understanding of color concepts. The program citation:</p>
<blockquote><p>The development of shared meaning within different embodiments<br />
J De Greeff, T Belpaeme, University of Plymouth</p></blockquote>
<p>As a side note, this year&#8217;s conference seems to have much better branding/website design than any previous year. I wonder if the organizers decided to hire a designer for the conference. In any event, it&#8217;s a welcome change from some of the <em>geocities-esque</em> designs of the past.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/08/26/research-blogging-from-icdl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reintroducing Pyrouette</title>
		<link>http://www.depthfirstsearch.net/blog/2011/06/16/reintroducing-pyrouette/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/06/16/reintroducing-pyrouette/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 08:22:45 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2534</guid>
		<description><![CDATA[Awhile ago I took down my Pyrouette project on Google Code and moved it to Bitbucket. For the most part, the move has been a positive one, and has spurned a lot of work on my part improving the code. That work is nowhere near complete, but I&#8217;ve decided to make the repository public again. [...]]]></description>
			<content:encoded><![CDATA[<p>Awhile ago I took down my Pyrouette project on Google Code and <a href="http://www.depthfirstsearch.net/blog/2011/04/21/google-codes-for-failure/">moved it</a> to Bitbucket. For the most part, the move has been a positive one, and has spurned a lot of work on my part improving the code. That work is nowhere near complete, but I&#8217;ve decided to make the repository public again. I&#8217;ve also decided to use GitHub for publicly hosted code, primarily because my gists already reside at GitHub and the social coding prospects seem better with that service.</p>
<p>As I mention in the project readme, <a href="https://github.com/stober/pyrouette">pyrouette</a> is meant as a lightweight Pythonic framework for exploring the implementation of machine learning algorithms. The goal is more pedagogical than research oriented, and the project (whose genesis was my own habit of implementing algorithms as I learned about them) will hopefully compliment more framework heavy and feature complete projects like <a href="http://pybrain.org/">Pybrain</a>, <a href="http://mdp-toolkit.sourceforge.net/">MDP</a>, and <a href="http://scikit-learn.sourceforge.net/">Scikits.learn</a>.</p>
<p>To the extent possible, individual algorithms (in alg/) are as self-contained as possible, depending where necessary on readily available numpy and scipy packages. In many cases, more feature complete versions of these algorithms can be found elsewhere. If you have a similar habit of implementing algorithms in Python and would like to share, let me know!</p>
<p>UPDATE: Some experiments don&#8217;t work out. I find it is easier to put individual learning algorithms on gist or in individual repositories rather than trying to develop a learning algorithm framework. Check out my gists or repos on GitHub if you are looking for something that was formerly part of Pyrouette.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/06/16/reintroducing-pyrouette/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rediscovered</title>
		<link>http://www.depthfirstsearch.net/blog/2011/06/15/rediscovered/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/06/15/rediscovered/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 17:21:32 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2531</guid>
		<description><![CDATA[I have a rather, ahem, ad hoc system for organizing the files on my computer and in my daily life. I&#8217;ve also been pursuing a hobby of actually trying to implement algorithms that I read about in textbooks and papers. Combine all these with a middling memory and I often find myself wondering whether I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I have a rather, ahem,  <em>ad hoc system</em> for organizing the files on my computer and in my daily life. I&#8217;ve also been pursuing a hobby of actually trying to implement algorithms that I read about in textbooks and papers. Combine all these with a middling memory and I often find myself wondering whether I&#8217;ve implemented something before. I was having a discussion today about implementing a simple GMM (part of an effort to port <a href="http://infoscience.epfl.ch/record/149355/">SEDS</a> to <a href="http://www.ros.org/wiki/">ROS</a>). </p>
<p>When I sat down to start coding I realized I had to implement a multivariate Gaussian pdf and all of a sudden things started looking very familiar. A couple of Google desktop queries led me to the following (written in 2008!). You&#8217;ll need this file of <a href='http://www.depthfirstsearch.net/blog/wp-content/uploads/2011/06/faithful.txt'>old faithful data</a> to run the script, as well as <a href="http://matplotlib.sourceforge.net/">matplotlib</a> for the visualization.</p>
<p><script src="https://gist.github.com/1027563.js?file=gmm.py"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/06/15/rediscovered/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Bandits with Many Arms</title>
		<link>http://www.depthfirstsearch.net/blog/2011/05/14/on-bandits-with-many-arms/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/05/14/on-bandits-with-many-arms/#comments</comments>
		<pubDate>Sat, 14 May 2011 00:56:52 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2500</guid>
		<description><![CDATA[I was reviewing a paper recently that involved a new approach to solving n-armed bandit problems. Because I&#8217;m a diligent reviewer I spent some time refreshing my memory on what algorithms are used to solve these kinds of problems, and I thought I&#8217;d share a simple example here. An n-armed bandit is a kind of [...]]]></description>
			<content:encoded><![CDATA[<p>I was reviewing a paper recently that involved a new approach to solving n-armed bandit problems. Because I&#8217;m a diligent reviewer I spent some time refreshing my memory on what algorithms are used to solve these kinds of problems, and I thought I&#8217;d share a simple example here.</p>
<p>An n-armed bandit is a kind of interactive optimization problem where an agent plays a game that involves &#8220;pulling&#8221; one of n arms. Just like in a casino, the agent then gets some kind of reward after each pull. The problem the agent has to solve is to figure out what choice of arm is best (e.g. will return the most reward) after repeated trials. This choice is complicated by the fact that the reward for pulling each arm is not fixed, but is instead distributed according to some unknown (but usually fixed) distribution.</p>
<p>The problem may seem either somewhat trivial or too abstract, depending on your particular disposition and knowledge, but in fact this problem provides a natural framework for thinking about what is known as the <em>exploration-exploitation</em> dilemma. At each iteration of the game, an agent can either go with the action that the agent thinks is best, or try to collect new data that may result in the agent discovering an even better solution.</p>
<p>One surprisingly effective and simple strategy is to just be greedy. Unfortunately, just being greedy can cause problems if you end up thinking the wrong arm is optimal early on in your experience playing the game. To address this issue, agents can adopt what&#8217;s known as an <img src='http://s.wordpress.com/latex.php?latex=%5Cepsilon&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\epsilon' title='\epsilon' class='latex' />-greedy strategy where the agent spends some small percentage of moves just randomly exploring other actions. This kind of policy comes up a lot in reinforcement learning (a more general class of problems of which n-armed bandits are one type), but this policy is particularly concise when expressed in code for solving just these kinds of simple bandit problems.</p>
<p><script src="https://gist.github.com/971547.js"> </script></p>
<p>The only thing you would need to specify to run this code is the bandit itself, which would have one method (run) that returns a (possibly stochastic) reward for each action (arm pulled).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/05/14/on-bandits-with-many-arms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reversing a Dictionary</title>
		<link>http://www.depthfirstsearch.net/blog/2011/05/10/reversing-a-dictionary/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/05/10/reversing-a-dictionary/#comments</comments>
		<pubDate>Tue, 10 May 2011 18:19:10 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2491</guid>
		<description><![CDATA[For some reason the code I&#8217;m writing requires a lot of mappings between different kinds of values, and I find myself trying to manipulate dictionaries in many ways. I wrote a simple function that reverses a dictionary: Then I remembered the setdefault method and was able to create a more concise function: Of course if [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason the code I&#8217;m writing requires a lot of mappings between different kinds of values, and I find myself trying to manipulate dictionaries in many ways. I wrote a simple function that reverses a dictionary:</p>
<p><script src="https://gist.github.com/965024.js"> </script></p>
<p>Then I remembered the setdefault method and was able to create a more concise function:</p>
<p><script src="https://gist.github.com/965019.js"> </script></p>
<p>Of course if your dictionary is 1-1, you probably don&#8217;t want to introduce sets into the reverse version, so I created a function that composes nicely with the previous function:</p>
<p><script src="https://gist.github.com/965026.js"> </script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/05/10/reversing-a-dictionary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Research in Comic Form</title>
		<link>http://www.depthfirstsearch.net/blog/2011/03/24/my-research-in-comic-form/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/03/24/my-research-in-comic-form/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 20:12:21 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[pictures]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2455</guid>
		<description><![CDATA[This comic will now appear at the beginning of every talk I give between now and the end of time.]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://xkcd.com/876/"><img class="aligncenter" title="Trapped" src="http://imgs.xkcd.com/comics/trapped.png" alt="xkcd_trapped" width="444" height="189" /></a></center></p>
<p>This comic will now appear at the beginning of every talk I give between now and the end of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/03/24/my-research-in-comic-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Suggested Reading</title>
		<link>http://www.depthfirstsearch.net/blog/2011/03/23/a-suggested-reading/</link>
		<comments>http://www.depthfirstsearch.net/blog/2011/03/23/a-suggested-reading/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 20:22:15 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[philosophy]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=2452</guid>
		<description><![CDATA[Prompted in part by a talk I went to yesterday, let me suggest that potential cognitive science/language researchers should probably read Chomsky&#8217;s review of Skinner&#8217;s Verbal Behavior very closely and carefully.]]></description>
			<content:encoded><![CDATA[<p>Prompted in part by a talk I went to yesterday, let me suggest that potential cognitive science/language researchers should probably read Chomsky&#8217;s <a href="http://www.chomsky.info/articles/1967----.htm">review</a> of Skinner&#8217;s <em>Verbal Behavior</em> very closely and carefully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2011/03/23/a-suggested-reading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/48 queries in 8.645 seconds using disk: basic
Object Caching 627/725 objects using disk: basic

Served from: www.depthfirstsearch.net @ 2012-02-09 03:21:33 -->
