<?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>Xavier Llorà &#187; genetic algorithms</title>
	<atom:link href="http://www.xavierllora.net/tag/genetic-algorithms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xavierllora.net</link>
	<description>A notebook on data-intensive computing, genetics-based machine learning &#38; more.</description>
	<lastBuildDate>Sun, 08 Jan 2012 19:39:15 +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>Parallel and Distributed Computational Intelligence book is out for pre-order</title>
		<link>http://www.xavierllora.net/2010/09/13/parallel-and-distributed-computational-intelligence-book-is-out/</link>
		<comments>http://www.xavierllora.net/2010/09/13/parallel-and-distributed-computational-intelligence-book-is-out/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 04:17:35 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Publications]]></category>
		<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[distributed computing]]></category>
		<category><![CDATA[Estimation of Distribution Algorithms]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[parallel programming]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=710</guid>
		<description><![CDATA[&#8220;Parallel and Distributed Computational Intelligence&#8221; edited by Francisco Fernández de Vega &#038; Erick Cantú-Paz and published by Springer is out for pre-order. The first chapter &#8220;When Huge is Routine: Scaling Genetic Algorithms and Estimation of Distribution Algorithms via Data-Intensive Computing&#8221; of the book was written together with coauthors Abhishek Verma, Roy Campbell, and David E. [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/05/22/zookeeper-and-orchestrating-distributed-applications/' rel='bookmark' title='ZooKeeper and distributed applications'>ZooKeeper and distributed applications</a></li>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
<li><a href='http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/' rel='bookmark' title='Scaling Genetic Algorithms using MapReduce'>Scaling Genetic Algorithms using MapReduce</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.springer.com/engineering/book/978-3-642-10674-3">&#8220;Parallel and Distributed Computational Intelligence&#8221;</a> edited by Francisco Fernández de Vega &#038; Erick Cantú-Paz and published by Springer is out for pre-order. The first chapter <em>&#8220;When Huge is Routine: Scaling Genetic Algorithms and Estimation of Distribution Algorithms via Data-Intensive Computing&#8221;</em> of the book was written together with coauthors Abhishek Verma, Roy Campbell, and David E. Goldberg describing how data-intensive computing can help push the size of problems that GAs and EDAs can address. You may find the abstact of the book below.</p>
<p><strong>Abstract:</strong></p>
<blockquote><p>The growing success of biologically inspired algorithms in solving large and complex problems has spawned many interesting areas of research. Over the years, one of the mainstays in bio-inspired research has been the exploitation of parallel and distributed environments to speedup computations and to enrich the algorithms. From the early days of research on bio-inspired algorithms, their inherently parallel nature was recognized and different parallelization approaches have been explored. Parallel algorithms promise reductions in execution time and open the door to solve increasingly larger problems. But parallel platforms also inspire new bio-inspired parallel algorithms that, while similar to their sequential counterparts, explore search spaces differently and offer improvements in solution quality.</p>
<p>The objective in editing this book was to assemble a sample of the best work in parallel and distributed biologically inspired algorithms. The editors invited researchers in different domains to submit their work. They aimed to include diverse topics to appeal to a wide audience. Some of the chapters summarize work that has been ongoing for several years, while others describe more recent exploratory work. Collectively, these works offer a global snapshot of the most recent efforts of bioinspired algorithms’ researchers aiming at profiting from parallel and distributed computer architectures—including GPUs, Clusters, Grids, volunteer computing and p2p networks as well as multi-core processors. This volume will be of value to a wide set of readers, including, but not limited to specialists in Bioinspired Algorithms, Parallel and Distributed Computing, as well as computer science students trying to figure out new paths towards the future of computational intelligence.</p></blockquote>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/05/22/zookeeper-and-orchestrating-distributed-applications/' rel='bookmark' title='ZooKeeper and distributed applications'>ZooKeeper and distributed applications</a></li>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
<li><a href='http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/' rel='bookmark' title='Scaling Genetic Algorithms using MapReduce'>Scaling Genetic Algorithms using MapReduce</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2010/09/13/parallel-and-distributed-computational-intelligence-book-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaling Genetic Algorithms using MapReduce</title>
		<link>http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/</link>
		<comments>http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 15:51:19 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[Estimation of Distribution Algorithms]]></category>
		<category><![CDATA[Publications]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Technical Reports]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[map-reduce]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=634</guid>
		<description><![CDATA[Below you may find the abstract to and the link to the technical report of the paper entitled &#8220;Scaling Genetic Algorithms using MapReduce&#8221; that will be presented at the Ninth International Conference on Intelligent Systems Design and Applications (ISDA) 2009 by Verma, A., Llorà, X., Campbell, R.H., Goldberg, D.E. next month. Abstract:Genetic algorithms(GAs) are increasingly [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2010/04/08/scaling-ecga-model-building-via-data-intensive-computing/' rel='bookmark' title='Scaling eCGA Model Building via Data-Intensive Computing'>Scaling eCGA Model Building via Data-Intensive Computing</a></li>
<li><a href='http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/' rel='bookmark' title='Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre'>Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre</a></li>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Below you may find the abstract to and the link to the technical report of the paper entitled <em>&#8220;Scaling Genetic Algorithms using MapReduce&#8221;</em> that will be presented at the <a href="">Ninth International Conference on Intelligent Systems Design and Applications (ISDA) 2009</a> by Verma, A., Llorà, X., Campbell, R.H., Goldberg, D.E. next month. </p>
<p><strong>Abstract:</strong>Genetic algorithms(GAs) are increasingly being applied to large scale problems. The traditional MPI-based parallel GAs do not scale very well. MapReduce is a powerful abstraction developed by Google for making scalable and fault tolerant applications. In this paper, we mould genetic algorithms into the the MapReduce model. We describe the algorithm design and implementation of GAs on Hadoop, the open source implementation of MapReduce. Our experiments demonstrate the convergence and scalability upto 105 variable problems. Adding more resources would enable us to solve even larger problems without any changes in the algorithms and implementation.</p>
<p>The draft of the paper can be downloaded as <a href="http://www.illigal.uiuc.edu/pub/papers/IlliGALs/2009007.pdf">IlliGAL TR. No. 2009007</a>. For more information see the <a href="http://www.illigal.uiuc.edu/web/technical-reports/2009/10/09/scaling-genetic-algorithms-using-mapreduce/">IlliGAL technical reports web site</a>.</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2010/04/08/scaling-ecga-model-building-via-data-intensive-computing/' rel='bookmark' title='Scaling eCGA Model Building via Data-Intensive Computing'>Scaling eCGA Model Building via Data-Intensive Computing</a></li>
<li><a href='http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/' rel='bookmark' title='Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre'>Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre</a></li>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>From Galapagos to Twitter: Darwin, Natural Selection, and Web 2.0</title>
		<link>http://www.xavierllora.net/2009/09/18/from-galapagos-to-twitter-darwin-natural-selection-and-web-2-0/</link>
		<comments>http://www.xavierllora.net/2009/09/18/from-galapagos-to-twitter-darwin-natural-selection-and-web-2-0/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 18:14:05 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[DISCUS]]></category>
		<category><![CDATA[Meandre]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Charles Darwin]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[human-based genetic algorithms]]></category>
		<category><![CDATA[interactive genetic algorithms]]></category>
		<category><![CDATA[meandre]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=590</guid>
		<description><![CDATA[Yesterday I was visiting Monmouth College to participate on the Darwinpalooza which commemorates the 200th anniversary of Charles Darwin&#8217;s birth and the 150th anniversary of the publication of On the Origin of Species. After scratching my head about about what to present, I came out with quite a mix. You will find the abstract of [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2006/12/18/challenging-lectures-on-line-at-ted/' rel='bookmark' title='Challenging lectures on-line at TED'>Challenging lectures on-line at TED</a></li>
<li><a href='http://www.xavierllora.net/2009/04/02/meandre-overview-slides/' rel='bookmark' title='Meandre overview slides'>Meandre overview slides</a></li>
<li><a href='http://www.xavierllora.net/2009/02/16/revamping-my-twitter-accounts/' rel='bookmark' title='Revamping my Twitter accounts'>Revamping my Twitter accounts</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was visiting <a href="http://www.monm.edu/">Monmouth College</a> to participate on the <a href="http://department.monm.edu/nineteenth-century/pdf/darwin-flyer.pdf">Darwinpalooza</a> which commemorates the 200th anniversary of Charles Darwin&#8217;s birth and the 150th anniversary of the publication of On the Origin of Species. After scratching my head about about what to present, I came out with quite a mix. You will find the abstract of the talk below, as well as the slides I used.</p>
<p><strong>Abstract:</strong> One hundred and fifty years have passed since the publication of Darwin&#8217;s world-changing manuscript &#8220;The Origins of Species by Means of Natural Selection&#8221;. Darwin&#8217;s ideas have proven their power to reach beyond the biology realm, and their ability to define a conceptual framework which allows us to model and understand complex systems. In the mid 1950s and 60s the efforts of a scattered group of engineers proved the benefits of adopting an evolutionary paradigm to solve complex real-world problems. In the 70s, the emerging presence of computers brought us a new collection of artificial evolution paradigms, among which genetic algorithms rapidly gained widespread adoption. Currently, the Internet has propitiated an exponential growth of information and computational resources that are clearly disrupting our perception and forcing us to reevaluate the boundaries between technology and social interaction. Darwin&#8217;s ideas can, once again, help us understand such disruptive change. In this talk, I will review the origin of artificial evolution ideas and techniques. I will also show how these techniques are, nowadays, helping to solve a wide range of applications, from life science problems to twitter puzzles, and how high performance computing can make Darwin ideas a routinary tool to help us model and understand complex systems.</p>
<iframe src="http://www.slideshare.net/slideshow/embed_code/2019013" width="425&type=s" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2006/12/18/challenging-lectures-on-line-at-ted/' rel='bookmark' title='Challenging lectures on-line at TED'>Challenging lectures on-line at TED</a></li>
<li><a href='http://www.xavierllora.net/2009/04/02/meandre-overview-slides/' rel='bookmark' title='Meandre overview slides'>Meandre overview slides</a></li>
<li><a href='http://www.xavierllora.net/2009/02/16/revamping-my-twitter-accounts/' rel='bookmark' title='Revamping my Twitter accounts'>Revamping my Twitter accounts</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/09/18/from-galapagos-to-twitter-darwin-natural-selection-and-web-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre</title>
		<link>http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/</link>
		<comments>http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 04:15:51 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[Estimation of Distribution Algorithms]]></category>
		<category><![CDATA[Meandre]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Publications]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[meandre]]></category>
		<category><![CDATA[parallel programming]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=563</guid>
		<description><![CDATA[Below you may find the slides I used during GECCO 2009 to present the paper titled &#8220;Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using Meandre&#8221;. An early preprint in form of technical report can be found as an IlliGAL TR No. 2009001 or the full paper at the ACM digital library Related posts: [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
<li><a href='http://www.xavierllora.net/2008/11/15/meandre-semantic-driven-data-intensive-flows-in-the-clouds/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flows in the Clouds'>Meandre: Semantic-Driven Data-Intensive Flows in the Clouds</a></li>
<li><a href='http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/' rel='bookmark' title='Scaling Genetic Algorithms using MapReduce'>Scaling Genetic Algorithms using MapReduce</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Below you may find the slides I used during <a href="http://www.sigevo.org/gecco-2009/">GECCO 2009</a> to present the paper titled <em>&#8220;Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre&#8221;</em>. An early preprint in form of technical report can be found as an <a href="http://www.illigal.uiuc.edu/web/technical-reports/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/">IlliGAL TR No. 2009001</a> or the full paper at the <a href="http://portal.acm.org/">ACM digital library</a></p>
<iframe src="http://www.slideshare.net/slideshow/embed_code/1717843" width="425&type=s" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
<li><a href='http://www.xavierllora.net/2008/11/15/meandre-semantic-driven-data-intensive-flows-in-the-clouds/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flows in the Clouds'>Meandre: Semantic-Driven Data-Intensive Flows in the Clouds</a></li>
<li><a href='http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/' rel='bookmark' title='Scaling Genetic Algorithms using MapReduce'>Scaling Genetic Algorithms using MapReduce</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Squeezing for cycles</title>
		<link>http://www.xavierllora.net/2009/04/01/squeezing-for-cycles/</link>
		<comments>http://www.xavierllora.net/2009/04/01/squeezing-for-cycles/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 01:55:24 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[profiling]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=491</guid>
		<description><![CDATA[Sometimes thinking a bit helps to rush decisions that may lead to weird places. Today I was going over a simple genetic algorithm for numeric optimization written in C. The code is nothing special, tournament selection without replacement, SBX crossover operator, and polynomial mutation. To the point, I was running a simple OneMax-like problem (in [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2005/11/27/evaluation-consistency-in-igas-user-contradictions-as-cycles-in-partial-ordering-graphs/' rel='bookmark' title='Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs'>Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs</a></li>
<li><a href='http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/' rel='bookmark' title='Fast mutation implementation for genetic algorithms in Python'>Fast mutation implementation for genetic algorithms in Python</a></li>
<li><a href='http://www.xavierllora.net/2006/07/07/analyzing-active-interactive-genetic-algorithms-using-visual-analytics/' rel='bookmark' title='Analyzing active interactive genetic algorithms using visual analytics'>Analyzing active interactive genetic algorithms using visual analytics</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Sometimes thinking a bit helps to rush decisions that may lead to weird places. Today I was going over a simple genetic algorithm for numeric optimization written in C. The code is nothing special, tournament selection without replacement, SBX crossover operator, and polynomial mutation. To the point, I was running a simple OneMax-like problem (in this case, minimize the value of the sum of all the genes), and I was quite surprised the guy was taking so long for. </p>
<pre>
$time ./GATest
----------------------- GA parameters ------------------------------------
Seed: 69
Lower/upper bounds: [1.000000,0.000000]
Genes: 18
Population size: 2000
Iterations: 30
Tournament size: 6
Crossover: pc=0.900000, gwp=0.500000, etaC=10.000000
Mutation: pm=0.100000, etaM=20.000000
----------------------- Evolution Statistics -----------------------------
4.663210	8.974190	13.158102
3.351912	7.405489	11.619360
2.285005	5.375426	9.531691
1.326318	3.711156	7.178203
0.767981	2.432192	4.790854
0.392001	1.543097	3.223604
0.279961	0.977706	2.308249
0.173406	0.600002	1.335702
0.092746	0.359343	0.877080
0.044705	0.216218	0.533978
0.029053	0.130256	0.315306
0.022827	0.078331	0.172908
0.013641	0.047317	0.105886
0.007370	0.028098	0.066994
0.004320	0.016787	0.038499
0.002807	0.010254	0.025155
0.001604	0.006238	0.014528
0.001007	0.003799	0.008883
0.000708	0.002212	0.005627
0.000343	0.001305	0.003263
0.000211	0.000781	0.002025
0.000131	0.000468	0.001155
0.000085	0.000280	0.000774
0.000054	0.000168	0.000392
0.000031	0.000100	0.000243
0.000017	0.000061	0.000144
0.000010	0.000037	0.000083
0.000006	0.000022	0.000054
0.000003	0.000013	0.000035
0.000002	0.000008	0.000020
0.000002	0.000005	0.000011
----------------------- Final outcome ------------------------------------
Min:	(0.000002)	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000
Max:	(0.000011)	0.000000	0.000001	0.000000	0.000000.000001	0.000000	0.000000	0.000001	0.000000	0.000000.000000	0.000003	0.000000	0.000000	0.000000	0.000000.000002	0.000001	

real	0m6.748s
user	0m6.228s
sys	0m0.088s
</pre>
<p>Yup, after turning on all the possible compiler optimizations I could think of, 6.7 seconds was the best I could do on a first generation MacBook Pro. I was wondering if I should spend the time writing a simple multithreaded evaluation. As I said, before making something simple complicated, I decided to put grab <a href="http://developer.apple.com/tools/performance/optimizingwithsystemtrace.html">Shark</a> (Mac&#8217;s free profiler) and get a better picture of what was going. Oh boy! Intuition looking at the wrong place! The outcome: 45% of time spend on tournament selection and 31% generating random number. Mmh, digging a bit further almost all time of tournament selection was spent shuffling an array to guarantee tournaments without replacements.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/** Runs tournament selection without replacement to create a new population
 * 
 * popDest: The destination population
 * popInit: The original population
 * fita: The fitness of the initial populaiton
 * iSize: Tournament size
 * iIndividuals: The population size
 * iGenes: The number of genes of an individual
 */</span>
<span style="color: #993333;">void</span> ga_tournament_selection <span style="color: #009900;">&#40;</span> Population popDest<span style="color: #339933;">,</span> Population popInit<span style="color: #339933;">,</span> Fitness <span style="color: #339933;">*</span> fita<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSize<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iIndividuals <span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iGenes <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> piaShuffle<span style="color: #009900;">&#91;</span>iSize<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> j <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> iIndTmp <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> iIndWin <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	Fitness fitWin <span style="color: #339933;">=</span> DBL_MAX<span style="color: #339933;">;</span>
	Fitness fitTmp <span style="color: #339933;">=</span> DBL_MAX<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>iIndividuals <span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #808080; font-style: italic;">/* Initialization for the current tournament */</span>
		fitWin  <span style="color: #339933;">=</span> DBL_MAX<span style="color: #339933;">;</span>
		iIndWin <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
		genrand_shuffle <span style="color: #009900;">&#40;</span>piaShuffle<span style="color: #339933;">,</span>iIndividuals<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> j<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> j<span style="color: #339933;">&lt;</span>iSize <span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// A new randomly drawn individual</span>
			iIndTmp <span style="color: #339933;">=</span> piaShuffle<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			fitTmp  <span style="color: #339933;">=</span> fita<span style="color: #009900;">&#91;</span>piaShuffle<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// If it is the first is the winner</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> iIndWin<span style="color: #339933;">==-</span><span style="color: #0000dd;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				iIndWin  <span style="color: #339933;">=</span> iIndTmp<span style="color: #339933;">;</span>
				fitWin <span style="color: #339933;">=</span> fitTmp<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #666666; font-style: italic;">// If not, chack the fitness (Minimize)</span>
			<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> fitWin<span style="color: #339933;">&gt;</span>fitTmp <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				iIndWin  <span style="color: #339933;">=</span> iIndTmp<span style="color: #339933;">;</span>
				fitWin <span style="color: #339933;">=</span> fitTmp<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		population_copy_individual<span style="color: #009900;">&#40;</span>popDest<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>popInit<span style="color: #009900;">&#91;</span>iIndWin<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>iGenes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It was <code>genrand_shuffle</code> (see below) the one that took most of the time. Also if you take a close inspection you will see that it is also the one to blame for calling calling too many times <code>genrand_int31</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> genrand_shuffle <span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span> pia<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSize <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i<span style="color: #339933;">,</span> iOther<span style="color: #339933;">;</span>
	<span style="color: #993333;">register</span> <span style="color: #993333;">int</span> iTmp<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> iRndMax <span style="color: #339933;">=</span> iSize<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Initialize</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>iSize<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// shuffle</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>iRndMax<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    iOther <span style="color: #339933;">=</span> genrand_int31<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span>iSize<span style="color: #339933;">;</span>
	    iTmp <span style="color: #339933;">=</span> pia<span style="color: #009900;">&#91;</span>iOther<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	    pia<span style="color: #009900;">&#91;</span>iOther<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	    pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> iTmp<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This inherited implementation of tournament selection works well for small populations, but as you increase the population size, each tournament requires shuffling a number proportional to the population size. If you make the numbers, that leads to a quadratic implementation of tournament selection without replacement. Mmh, really needed? Definitely not. The only thing you need to guarantee to provide a tournament selection without replacement is that you provide different individuals for the tournaments (avoiding repetition). If that selection can be done quickly, you can take the complexity of the implementation down to linear. So there I went, and modified the shuffling function as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> genrand_shuffle_fast <span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span> pia<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSize<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSlots <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> j <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
	pia<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> genrand_int31<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span>iSize<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> i<span style="color: #339933;">&lt;</span>iSlots <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> genrand_int31<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span>iSize<span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> j<span style="color: #339933;">=</span>i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">;</span> j<span style="color: #339933;">&gt;=</span><span style="color: #0000dd;">0</span> <span style="color: #339933;">&amp;&amp;</span> j<span style="color: #339933;">&lt;</span>i <span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> pia<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> 
				<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> j<span style="color: #339933;">==</span>i <span style="color: #009900;">&#41;</span> i<span style="color: #339933;">++</span> <span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Tournaments sizes are usually much much smaller than population sizes (e.g. s=6 for the pop_size=2,000 individuals population used above). Thus, if random numbers are generated, the chances of repeating it are quite small. Also if you also make sure it is not there (and if it is, you generate a new out), basically your are set. (This implementation will only work efficiently if s&lt;&lt;pop_size, otherwise the cost of checking and generated new numbers will be even worst than the original version).</p>
<p>So there I went. I modified the original inherited version of the tournament selection without replacement, and rerun the simple time measures. </p>
<pre>
$ time ./GATest
----------------------- GA parameters ------------------------------------
Seed: 69
Lower/upper bounds: [1.000000,0.000000]
Genes: 18
Population size: 2000
Iterations: 30
Tournament size: 6
Crossover: pc=0.900000, gwp=0.500000, etaC=10.000000
Mutation: pm=0.100000, etaM=20.000000
----------------------- Evolution Statistics -----------------------------
4.663210	8.974190	13.158102
3.350933	7.401935	11.503243
1.964580	5.461794	9.246779
1.297656	3.819533	7.364562
0.810695	2.512797	5.142622
0.478789	1.603199	3.652348
0.305106	0.999304	2.138109
0.191904	0.602315	1.336870
0.108593	0.361237	0.869652
0.060862	0.219145	0.502403
0.040076	0.136125	0.307478
0.028629	0.084893	0.191327
0.016301	0.052274	0.115169
0.009433	0.032699	0.071849
0.003934	0.020275	0.047970
0.002762	0.012328	0.031204
0.001405	0.007259	0.019575
0.001043	0.004280	0.010909
0.000790	0.002550	0.005799
0.000404	0.001530	0.003566
0.000287	0.000950	0.002406
0.000198	0.000600	0.001390
0.000127	0.000386	0.000818
0.000068	0.000245	0.000599
0.000045	0.000153	0.000377
0.000026	0.000093	0.000206
0.000020	0.000058	0.000125
0.000011	0.000035	0.000095
0.000007	0.000022	0.000049
0.000004	0.000014	0.000029
0.000002	0.000009	0.000018
----------------------- Final outcome ------------------------------------
Min:	(0.000002)	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000
Max:	(0.000018)	0.000001	0.000000	0.000000	0.000000.000000	0.000000	0.000001	0.000001	0.000000	0.000000.000004	0.000000	0.000001	0.000001	0.000002	0.000000.000001	0.000001	

real	0m0.258s
user	0m0.246s
sys	0m0.006s
</pre>
<p>Yup. That simple change yielded a speedup of 26.15. Mmh, as I said, a little bit of thinking helped to avoid going down some crazy path in a rushing code fever for the wrong reasons. Yup, the threading will be very useful if the cost of the evaluation is expensive (as most of the real world optimization are), but for this silly OneMax, no need to make it more complicated than it need <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2005/11/27/evaluation-consistency-in-igas-user-contradictions-as-cycles-in-partial-ordering-graphs/' rel='bookmark' title='Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs'>Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs</a></li>
<li><a href='http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/' rel='bookmark' title='Fast mutation implementation for genetic algorithms in Python'>Fast mutation implementation for genetic algorithms in Python</a></li>
<li><a href='http://www.xavierllora.net/2006/07/07/analyzing-active-interactive-genetic-algorithms-using-visual-analytics/' rel='bookmark' title='Analyzing active interactive genetic algorithms using visual analytics'>Analyzing active interactive genetic algorithms using visual analytics</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/04/01/squeezing-for-cycles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</title>
		<link>http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/</link>
		<comments>http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 19:36:25 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Publications]]></category>
		<category><![CDATA[Technical Reports]]></category>
		<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[eCGA]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[meandre]]></category>
		<category><![CDATA[ZigZag]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=421</guid>
		<description><![CDATA[by Llorà, X. IlliGAL technical report 2009001. You can download the pdf here. More information is also available at the Meandre website as part of the SEASR project. Abstract: Data-intensive computing has positioned itself as a valuable programming paradigm to efficiently approach problems requiring processing very large volumes of data. This paper presents a pilot study about how to apply the [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/' rel='bookmark' title='Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre'>Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre</a></li>
<li><a href='http://www.xavierllora.net/2010/04/08/scaling-ecga-model-building-via-data-intensive-computing/' rel='bookmark' title='Scaling eCGA Model Building via Data-Intensive Computing'>Scaling eCGA Model Building via Data-Intensive Computing</a></li>
<li><a href='http://www.xavierllora.net/2008/04/18/meandre-semantic-driven-data-intensive-flow-engine/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flow Engine'>Meandre: Semantic-Driven Data-Intensive Flow Engine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div>
<p><em>by</em> Llorà, X.</p>
<p><a href="http://www.illigal.uiuc.edu/pub/papers/IlliGALs/2009001.pdf">IlliGAL technical report 2009001</a>. You can download the pdf <a href="http://www.illigal.uiuc.edu/pub/papers/IlliGALs/2009001.pdf">here</a>. More information is also available at the <a href="http://seasr.org/meandre">Meandre website</a> as part of the <a href="http://seasr.org/">SEASR project</a>.</p>
<p><strong>Abstract: </strong>Data-intensive computing has positioned itself as a valuable programming paradigm to efficiently approach problems requiring processing very large volumes of data. This paper presents a pilot study about how to apply the data-intensive computing paradigm to evolutionary computation algorithms. Two representative cases&#8212;selectorecombinative genetic algorithms and estimation of distribution algorithms&#8212;are presented, analyzed, discussed. This study shows that equivalent data-intensive computing evolutionary computation algorithms can be easily developed, providing robust and scalable algorithms for the multicore-computing era. Experimental results show how such algorithms scale with the number of available cores without further modification.</div>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/' rel='bookmark' title='Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre'>Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre</a></li>
<li><a href='http://www.xavierllora.net/2010/04/08/scaling-ecga-model-building-via-data-intensive-computing/' rel='bookmark' title='Scaling eCGA Model Building via Data-Intensive Computing'>Scaling eCGA Model Building via Data-Intensive Computing</a></li>
<li><a href='http://www.xavierllora.net/2008/04/18/meandre-semantic-driven-data-intensive-flow-engine/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flow Engine'>Meandre: Semantic-Driven Data-Intensive Flow Engine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protect yourself from genetic algorithms&#8217; surprises</title>
		<link>http://www.xavierllora.net/2009/01/23/protect-yourself-of-genetic-algorithms-surprises/</link>
		<comments>http://www.xavierllora.net/2009/01/23/protect-yourself-of-genetic-algorithms-surprises/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 13:01:16 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[fitness function]]></category>
		<category><![CDATA[genetic algorithms]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=416</guid>
		<description><![CDATA[I just ran into the comic strip below at xkcd. I am still laughing now. Fitness functions are tricky. Once somebody told me that genetic algorithms always get their target; the main problem is to explain what the target is. If you want to learn a &#8220;fountain pen&#8221;, you better be accurate defining it or [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/' rel='bookmark' title='Fast mutation implementation for genetic algorithms in Python'>Fast mutation implementation for genetic algorithms in Python</a></li>
<li><a href='http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/' rel='bookmark' title='Scaling Genetic Algorithms using MapReduce'>Scaling Genetic Algorithms using MapReduce</a></li>
<li><a href='http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/' rel='bookmark' title='Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre'>Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I just ran into the comic strip below at <a href="http://xkcd.com/">xkcd</a>. I am still laughing now. Fitness functions are tricky. Once somebody told me that genetic algorithms always get their target; the main problem is to explain what the target is. If you want to learn a &#8220;fountain pen&#8221;, you better be accurate defining it or you may end up getting an unexpected all-terrain &#8220;pencil&#8221;. Yes, I know the example is quite solution free, but still has some truth to it. How many times have you end up getting something you did not expect, only because evolution find a better fitted crack in your description? Anyway, it is fun what you end running into on the Internet <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p> </p>
<p><a href="http://xkcd.com/534/"><img class="aligncenter" title="Genetic algorithms @ xkcd" src="http://imgs.xkcd.com/comics/genetic_algorithms.png" alt="" width="492" height="207" /></a></p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/' rel='bookmark' title='Fast mutation implementation for genetic algorithms in Python'>Fast mutation implementation for genetic algorithms in Python</a></li>
<li><a href='http://www.xavierllora.net/2009/10/09/scaling-genetic-algorithms-using-mapreduce/' rel='bookmark' title='Scaling Genetic Algorithms using MapReduce'>Scaling Genetic Algorithms using MapReduce</a></li>
<li><a href='http://www.xavierllora.net/2009/07/13/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre-2/' rel='bookmark' title='Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre'>Data-Intensive Computing for  Competent Genetic Algorithms:  A Pilot Study using Meandre</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/01/23/protect-yourself-of-genetic-algorithms-surprises/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dusting my Ph.D. thesis off</title>
		<link>http://www.xavierllora.net/2008/12/30/dusting-my-phd-thesis-off/</link>
		<comments>http://www.xavierllora.net/2008/12/30/dusting-my-phd-thesis-off/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 10:11:00 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Learning Classifier Systems]]></category>
		<category><![CDATA[Publications]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[data mining]]></category>
		<category><![CDATA[GALE]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[genetics-based machine learning]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=354</guid>
		<description><![CDATA[After attending Albert Orriols&#8217;s Ph.D. thesis defense, I ended wondering how many of the question I posted in mine have not been solved. The answer, quite a bit. So, I just decided to dig it up, and put it up here. Yes, the thesis was not written in English (in those days my fellowship had [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2005/11/29/probabilistic-models-of-text-and-images/' rel='bookmark' title='Probabilistic models of text and images'>Probabilistic models of text and images</a></li>
<li><a href='http://www.xavierllora.net/2008/12/12/join-me-congratulating-albert-orriols/' rel='bookmark' title='Join me congratulating Albert Orriols, Ph.D.'>Join me congratulating Albert Orriols, Ph.D.</a></li>
<li><a href='http://www.xavierllora.net/2006/05/10/gale-is-back/' rel='bookmark' title='GALE is back!'>GALE is back!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After attending <a title="Albert Orriols Ph.D. defense" href="http://www.xavierllora.net/2008/12/12/join-me-congratulating-albert-orriols/">Albert Orriols&#8217;s Ph.D. thesis defense</a>, I ended wondering how many of the question I posted in mine have not been solved. The answer, quite a bit. So, I just decided to dig it up, and put it up here. Yes, the thesis was not written in English (in those days my fellowship had some strings attached), but math formulation, graphs, and results are readable in any language <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Also, <a href="http://www.xavierllora.net/2006/05/10/gale-is-back/">GALE</a> was written and documented in english, and is <a href="http://www.xavierllora.net/2006/05/10/gale-is-back/">available here</a>.</p>
<p><strong>Abstract:</strong><br />
This thesis combines different ideas provided by machine learning, evolutionary computation (genetics-based machine learning), and artificial life. The aim of this work is to create a data mining model that satisfies certain guidelines. The first one deals with the type of attributes that can be used in the model. The second one focuses on the goal that the model has to independent of the knowledge representation used. Finally, the model must exploit massive parallelism. Artificial Life can be very useful dealing with parallelism models.This thesis combines different ideas provided by machine learning, evolutionary computation (genetics-based machine learning), and artificial life. The aim of this work is to create a data mining model that satisfies certain guidelines. The first one deals with the type of attributes thatcan be used in the model. The second one focuses on the goal that the model has to independent of the knowledge representation used. Finally, the model must exploit massive parallelism. Artificial Life can be very useful dealing with parallelism models.</p>
<p>
<p id="embedded_flash" style="text-align: center;"><a href="http://www.scribd.com">Scribd</a></p>
<script type="text/javascript">iPaper(3836792, 'key-35vxegpmvwcx3ldxpq3', 400, 550);</script>
</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2005/11/29/probabilistic-models-of-text-and-images/' rel='bookmark' title='Probabilistic models of text and images'>Probabilistic models of text and images</a></li>
<li><a href='http://www.xavierllora.net/2008/12/12/join-me-congratulating-albert-orriols/' rel='bookmark' title='Join me congratulating Albert Orriols, Ph.D.'>Join me congratulating Albert Orriols, Ph.D.</a></li>
<li><a href='http://www.xavierllora.net/2006/05/10/gale-is-back/' rel='bookmark' title='GALE is back!'>GALE is back!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2008/12/30/dusting-my-phd-thesis-off/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fast mutation implementation for genetic algorithms in Python</title>
		<link>http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/</link>
		<comments>http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 05:31:52 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=312</guid>
		<description><![CDATA[The other day I was playing to see how much I could squeeze out of a genetic algorithm written in Python. The code below shows the example I used. The first part implements a simple two loop version of a traditional allele random mutation. The second part is coded using numpy 2D arrays. The code [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/07/01/efficient-storage-for-python/' rel='bookmark' title='Efficient storage for Python'>Efficient storage for Python</a></li>
<li><a href='http://www.xavierllora.net/2008/01/10/profiling-python-code/' rel='bookmark' title='Profiling Python Code'>Profiling Python Code</a></li>
<li><a href='http://www.xavierllora.net/2005/11/24/genetic-algorithms-tools/' rel='bookmark' title='Genetic algorithms tools'>Genetic algorithms tools</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The other day I was playing to see how much I could squeeze out of a genetic algorithm written in Python. The code below shows the example I used. The first part implements a simple two loop version of a traditional allele random mutation. The second part is coded using <code>numpy</code> 2D arrays. The code also measures the time spent on both implementations using <code>cProfile</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> numpy <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
pop_size = <span style="color: #ff4500;">2000</span>
l = <span style="color: #ff4500;">200</span>
z = zeros<span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>pop_size,l<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> mutate <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> :
        <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span>pop_size<span style="color: black;">&#41;</span>:
                <span style="color: #ff7700;font-weight:bold;">for</span> j <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span>l<span style="color: black;">&#41;</span> :
                        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">random</span>.<span style="color: #dc143c;">random</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">0.5</span> :
                                z<span style="color: black;">&#91;</span>i,j<span style="color: black;">&#93;</span> = <span style="color: #dc143c;">random</span>.<span style="color: #dc143c;">random</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> cProfile
cProfile.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'mutate()'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> mutate_matrix <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> :
        r = <span style="color: #dc143c;">random</span>.<span style="color: #dc143c;">random</span><span style="color: black;">&#40;</span>size=<span style="color: black;">&#40;</span>pop_size,l<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">0.5</span>
        v = <span style="color: #dc143c;">random</span>.<span style="color: #dc143c;">random</span><span style="color: black;">&#40;</span>size=<span style="color: black;">&#40;</span>pop_size,l<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        k = r<span style="color: #66cc66;">*</span>v + logical_not<span style="color: black;">&#40;</span>r<span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span>z
&nbsp;
cProfile.<span style="color: black;">run</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'mutate_matrix()'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>If you run the code listed above you may get something similar to</p>
<pre>
$ python scan.py
         599933 function calls in 0.857 CPU seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.857    0.857 <string>:1(<module>)
        1    0.615    0.615    0.857    0.857 scan.py:7(mutate)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
   599930    0.242    0.000    0.242    0.000 {method 'random_sample' of 'mtrand.RandomState' objects}

         3 function calls in 0.082 CPU seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.002    0.002    0.082    0.082 <string>:1(<module>)
        1    0.080    0.080    0.080    0.080 scan.py:16(mutate_matrix)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
</pre>
<p>Also if you make the simple math, the numpy-based version is 10.45 times faster than a simple loop-based implementation. Yup, sometimes the easy way out is not the best, and giving it some thought helps <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/07/01/efficient-storage-for-python/' rel='bookmark' title='Efficient storage for Python'>Efficient storage for Python</a></li>
<li><a href='http://www.xavierllora.net/2008/01/10/profiling-python-code/' rel='bookmark' title='Profiling Python Code'>Profiling Python Code</a></li>
<li><a href='http://www.xavierllora.net/2005/11/24/genetic-algorithms-tools/' rel='bookmark' title='Genetic algorithms tools'>Genetic algorithms tools</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

