Archive for the ‘source code’ tag
PDL (“Perl Data Language”) gives standard Perl the ability to compactly store and speedily manipulate the large N-dimensional data arrays which are the bread and butter of scientific computing.
PDL turns Perl in to a free, array-oriented, numerical language similar to (but, we believe, better than) such commerical packages as IDL and MatLab. One can write simple perl expressions to manipulate entire numerical arrays all at once. Simple interactive shells, pdl2 and perldl, are provided for use from the command line along with the PDL module for use in Perl scripts.
Pyevolve was developed to be a complete genetic algorithm framework written in pure python, the main objectives of Pyevolve is:
* written in pure python, to maximize the cross-platform issue;
* easy to use API, the API must be easy for end-user;
* see the evolution, the user can and must see and interact with the evolution statistics, graphs and etc;
* extensible, the API must be extensible, the user can create new representations, genetic operators like crossover, mutation and etc;
* fast, the design must be optimized for performance;
* common features, the framework must implement the most common features: selectors like roulette wheel, tournament, ranking, uniform. Scaling schemes like linear scaling, etc;
* default parameters, we must have default operators, settings, etc in all options;
* open-source, the source is for everyone, not for only one.
Yet another year, yet another dozen languages. Some times it seems as if all my time gets sapped up learning new languages. R is growing rapidly in popularity making news on Slashdot and the NYT late last year.
R provides a graphics package for visualizing your data, a data editor, data manipulation and has C/C++ interfaces. When R is open it provides a set of windows allowing you to interact with your data. The instruction manuals, tutorials, source code for Linux, OSX and Windows are available for free at the R Project site
R is also the name of a popular programming language used by a growing number of data analysts inside corporations and academia. It is becoming their lingua franca partly because data mining has entered a golden age, whether being used to set ad prices, find new drugs more quickly or fine-tune financial models. Companies as diverse as Google, Pfizer, Merck, Bank of America, the InterContinental Hotels Group and Shell use it.
But R has also quickly found a following because statisticians, engineers and scientists without computer programming skills find it easy to use.
“R is really important to the point that it’s hard to overvalue it,” said Daryl Pregibon, a research scientist at Google, which uses the software widely. “It allows statisticians to do very intricate and complicated analyses without knowing the blood and guts of computing systems.”
It is also free. R is an open-source program, and its popularity reflects a shift in the type of software used inside corporations. Open-source software is free for anyone to use and modify. I.B.M., Hewlett-Packard and Dell make billions of dollars a year selling servers that run the open-source Linux operating system, which competes with Windows from Microsoft. Most Web sites are displayed using an open-source application called Apache, and companies increasingly rely on the open-source MySQL database to store their critical information. Many people view the end results of all this technology via the Firefox Web browser, also open-source software. R, the software, finds fans in data analysts read more . . .
@RStats tips and examples
An Introduction to R
The R Project for Statistical Computing
Revolutions: How R is disrupting a billion dollar market
The iGraph Library for Complex Network Research
SPOT: An R Package for Automatic and Interactive Tuning of Optimization Algorithms by Sequential Parameter Optimization (Download SPOT)
The SantaFe Trail is a textbook beginner’s problem in genetic programming. The ants are allowed to turn right or left or to move forward. Ants can see food if it is directly in front of them. The Trail is the one in the image above and it is also in the source code.
Ants follow two finite state machines, one if it sees food, another if it does not see food. Optimally the see food machine would only have move forward. But we let nature decide that.
Ants are created, given a random set of instructions and move one instruction each cycle. Then entire swarm moves a given number of cycles, then a new generation is born. The top half of the food finders in the generation mate. One mate contributes the ‘see food’ states, one the ‘doesn’t see food states’ and one move is randomly changed in each string of moves. The population is kept at a constant number.
Santa Fe Ants ( Java )
I am finishing up my reading of ‘The Magic Machine: A Handbook of Computer Sorcery‘ and there were only two programs left to write. I thought I’d wipe the first one out in a day. Heh, it took three.
In a chapter of the book the author discusses early attempts at genetically evolving artificial life. He gives a rough algorithm and states he had all kinds of critters running around in just a few hundred generations. I loosely wrote a program based on his algorithm. 150,000+ cycles, and 36 hours on my computer later, no evolution. I don’t know how he did it? I couldn’t get the algorithm in the book to produce any interesting results.
I did today get a program that has bugs that learn to stay on and follow food lines drawn in the window. It takes about 1500 days ( cycles ) for them to achieve this universally. The source code is linked to below.
Here’s what I learned in my attempts at a very simple genetic program.
If you place food randomly there is nothing to learn. You just end up with a population of stupid bugs. Adjusting the food nutrient content worked better than adjusting the amount of food for controlling population levels and for evolution. Creating more food to meet the population just created lots of stupid bugs. ( I wonder if there is a real life lesson in that? )
If you adjust the bugs DNA when they find food, not just their energy levels they learn much faster.
I hope to do some more complex and interesting evolution programs soon.