Low or no cost distributed evolutionary computation
Fortunately, everybody's got cycles to spare
How many computers do you have on you?
The browser is the new operating system
A long time ago, browser was for browsing
Let's do Javascript!
Menu → developer → console
(Might vary depending on browser)
Say hello to these nice folks!
console.log('Dobrodošli')
Or the much more annoying
alert('Dobro jutro!');
This is an object. That, too.
console.log('Dobrodošli'.length)
Arrays are objects, and the other way round
console.log(['Dobro jutro','Dober dan','Dober večer'].pop())
Chromosomes and fitness
var chromosome = '1001100110011';
var fitness_of = new Object;
fitness_of[chromosome] = chromosome.match(/1/g).length;
var rr = function (chromosome) {
var fitness = 0;
for (var i = 0; i < chromosome.length; i+=4 ) {
var ones = (chromosome.substr(i, 4).match(/1/g) || []).length;
fitness += ( ones == 0 || ones == 4 );
}
return fitness;
};
JavaScript is:
Standard, (reasonably) fast and
Everywhere
Yes, also in your PS4
(Almost) forget about loops
function do_ea() {
eo.generation();
generation_count++;
if( (eo.fitness_of[eo.population[0]] < traps*conf.fitness.b )
&& ( generation_count*conf.population_size < conf.max_evaluations)) {
setTimeout(do_ea, 5);
} else {
console.log( "Finished ", log );
}
}
A whole algorithm/application in a browser
The browser is the new operating system
But I said that already, right?
From Adriaan Bloem flic.kr/p/8NDCRh
And why not in the server too?
var eo = new nodeo.Nodeo( { population_size: population_size,
chromosome_size: chromosome_size,
fitness_func: utils.max_ones } );
do {
eo.generation();
console.log( eo.population[0] );
} while ( eo.fitness_of[eo.population[0]] < chromosome_size );
Servers can be in the clouds
And you can use it right now
Using Dropbox-shared folders for distribution. Easy as saving a file.
Including development environments
koding is a collaborative online development environment
With a virtual machine you can use from the browser!
Ajax, a standard browser-server communication framework
HTTP petitions from a standard object in the browser.
Asynchronous!
IaaS have free tiers
But it generally is pay-as-you-go
Great if you do smail amounts of computation
But then there's freemium PaaS
Three steps to have your own little free simulation
- Client-server application with JavaScript
- Host it using Heroku/OpenShift
- Tell people in Twitter!
What does that buy you?
It's not really a free lunch
But it's pretty darn close to it
And all the technologies you need use are already there:
JavaScript, browsers and Ajax.
Detaching population from operations
Chromosomes are taken from a persistent pool and brought back after evaluation, mutation, crossover
1. Self-organizing clients
2. Fully asynchronous
3. Persistent population
The island model can also use the pool
But it will have to rely on it for communications
The performance of your free system will depend
on your karma/mojo
Lose a follower, downgrade your volunteer computer
system
The power is in the network
As well as possible security holes
Creates a link between persons and tribes
== distributed system!
Potlatch arose from big resource surpluses
You only give what you've got to spare
Scientists give access to knowledge
Open source your science!
Engage community from inception.
Citizen gives attention
And computing resources!
What are you giving back?
Interpretation, participation, engagement, support,
know-how for startups...
And play the lab-coat clad villain in movies
Losers can't be chosers
You have to deal with
- (Almost) Unpredictable infrastructure
- Ephemeral contributions: single seconds
- Complex socio-technical system
Take-home messages
- Cloud is the new (grid|cluster)
- Computing resources can be used (mostly) for free
- JavaScript, best way to tap them
- New ways of exploring spontaneous, ad-hoc networks for
EC
- The social network plays a role in the performance of
the system
Thanks a lot for your attention
Any question?
Download/fork this presentation from git.io/t-ppsn