GENOMICONrss

rss

The Crowd-Sourcing of Intelligent-Design

genetic algorithms

Flittering Fluttering Things

They cometh

This is exactly the sort of thing I like the most.

It’s a tiny 3d printed helicopter, the design for which was arrived at using genetic algorithms.

Absolutely brilliant – machines that can design themselves using inner-simulations. Almost. There’s nothing to say that a “machine” shouldn’t have appendages that aren’t actually attached to the brain… we’re just used to creatures being “one-piece”. I think it’s a whole lot more likely that robotic creatures are actually thin-client.

Like we are… now that we can no longer cope without having 24/7 access to the web.

Mesh Wars : How to make Skynet

Ok – bit of a weird one today – a mishmashed collection of various tech bits that more or less revolve around a theme. It’s a concept-link-latte. I’m not sure what the theme is, but it’s something like

“What the fuck are we building here?” or
“How to make Skynet in 5 easy lessons”

1) Genetic Algorithms again.

Genetic algorithms are simple little programs that simulate evolution by (re)combining groups of actions, keeping the ones that works best, ditching the rest, then recombining again. They can arrive quite quickly at solutions to complex problems.

Here’s a fairly remarkable video where a simulation of a person teaches itself to walk

2) “Situational Awareness

O how I love it when my hysterical bug-eyed predictions come true.

Some Australians have spent a mere million dollars and invented a thing which stitches together all of their CCTV camera feeds so you can walk around in them like doom. You could use augmented reality to turn the homeless people into Zombies so you don’t feel bad about killing them.

These are using existing CCTVs… but you could just as easily (in fact more easily) achieve the same thing using

3) Perch and Stare bots

perchandshoot

So you just fly a bunch of these things into an area and position them such that you can create a 3D map of the place… with proper depth-perception (as is on Darpa’s shopping list) maybe.

I learned how to use these

xb2

last week – they’re little mesh-networking things… cheap as chips with a line-of-site range of about a mile… works through walls etc to a more limited extent. I saw one this morning that had a range of 40 miles… which is… miles!.

I’m not sure that these would have the bandwidth to transmit real-time video (my ones run at 38400 baud)… but you get the idea. It’s not entirely outside the bounds of possibility to drop a cluster bomb of CCTV cameras over an area and operate them from another country. They’re so cheap though that you and I could probably do it.

4) Automated Kill Zones


As being set up by the Israelis.

Accompanied of course by flying drones, and flotillas of euphemisms designed to obscure the fact that what’s actually happening here is that people’s Dads, Brothers, Sons, Daughters, Husbands, Wives, Mums… are being killed.

Still as long as they’re not controlled by n’ n’ n’ nineteen year olds, what could possibly go wrong?

Anyway… enough about that… back to the warm, touchy-feelyness of

5) a plane that looks like a dolphin

smartfish1

The cool thing about these, is that they’ve actually made them, and they actually go… quite well.

It’s electric – hydrogen fuel-cell powered. Lots of specs and whatnot on the site, though right now they’re just tinkering with the toy-sized version – the skin of which is made with a CNC milled mold… which is used to shape fibre-glass.

smartfish2

Something well within the abilities of 5th generation repraps in other words… something largely creatable from a direct digital->physical process in other words.

So maybe you wouldn’t have to drop a cluster-bomb filled with Perch-and-Stare drones, but a single reprap with a load of vitamin parts.

A way to go yet of course. I’m still of the opinion that humans are the ultimate vitamin part… and whatever emerges, it will be a human/machine symbiote, rather than a machine takeover.

I mean in a way we’ve already got this – except that the machine, isn’t a physical object… it’s a set of formulas, laws and conditions – it’s debt-based currency and corporatism, with it’s grotesque and alien offspring… “defence” industries, privatised prisons, privatised water/food/health systems, derivative colonialism etc etc.

We’ve actually already got the monster. Skynet is just something that will flex its muscles in the sunlight (one bright morning), several sheddings-of-skin into the future.

The Thinking Man’s Einstein

A robot using what looks suspiciously like Genetic Algorithms to learn how to make facial expressions. Might not be of course – but Genetic Algorithms are so simple and produce good results blindingly quickly… that’s how I would do it.

I think this is the future of Robotics – creating machines that start out not knowing what they look like, then learning to use their own hardware… and then a bio-link being created so a machine can learn how to control a living organism. There have already been small stumbling steps in this direction that I’ve gone on about elsewhere – this Einstein Robot is a movement in that direction.

One of the advantages of this approach is that you can de-couple software and hardware. The software that’s used to control a combine-harvestor can be the same as that which controls a daddy-longlegs. You don’t need to reprogram specifically for each new device – which means machine-evolution can be faster.

What looks like another movement in this direction is the recent creation of the long-predicted “Memristor” – a device that takes charge and creates magnetic flux, which I must confess I barely understand – but it looks like a missing link, and a mechanism widely used in nature to allow smart-reactions from organisms that don’t actually have brains… and, according to the article, what modern tech basically does with hundreds of chips, is to simulate the workings of a single memristor.

Deathbug 2020

Here’s some insane person’s fantasy about using robotic bugs to spy on and kill people. The voice-over is flirting with that whole hollywood macho tone – an indication that they’re living in movie-land rather than the real world. Just like Ronald Reagan – who had an alarming habit of telling anecdotes about his life which were actually from movies, and they named a battleship after him. I’m talking about The US Air Force.

Some other people, equally demented have seen Terminator and instead of trying to kill off the inventor of Skynet before he managed to do any damage, they’ve set up a thing where AI systems can compete with each other to see who’s best at killing off the human race.

AI1

So anyway, robotic insects. Marvelous. I followed all the links from the BotJunkie post above, and spent a morning perusing for others etc…

It flies, it crawls, it gives me the creeps. It’s got that whole scrabbly bat-bug vibe going on.

(from)

Then there’s this one:

robobug1

The The DelFly Micro, (from), with photo/vid of it’s older sibling here.

Another, prettier one here…

So what do these all have in common.

1) they’re all little flying robots that look a bit like bugs
2) they all employ first-personism
3) they’re all evil. Either for spying or killing people – apart from the last one maybe. Or any of the other ones.

4) they’re all a bit rubbish.

I mean no offence etc, they’re a lot better than I could do – I can barely tie my shoelaces, but if you compare them to an actual insect… they’re crap. Take a proper hornet for example. It can :

  • fly : really accurately. Straight through holes the same size that it is without hesitation.
  • walk : like the clappers, up walls, upside down on the ceiling, all limbs individually sensored and controlled.
  • see / smell / feel / hear / taste? and god knows what else
  • fight.
  • cope with being waterlogged.
  • 3D print using locally sourced materials (their nests are 3d printed)
  • self-fuel using locally sourced materials.
  • reproduce itself from locally sourced materials, with sexual selection and variation so evolution happens.
  • work/live/fight/build communally.

Now that, my friends is quite a feat of engineering. Think of the best flying machine we have today… a stealth bomber? It doesn’t come close to what a simple wasp can achieve.

So I’m guessing that we’re going to learn to make “brains” that learn how to use alien systems faster than we’re going to learn how to build robots that actually manage to do what mad-scientists want them to. I’m guessing that the biotech revolution is going to merge with and eclipse all the others – robotics, nanotech etc… they’re not going to be like they are in sci-fi movies because it’s easier (and a lot more potent) to program/adapt existing creatures than it is to make them from scratch.

It’s a question of interface… and there have been movements in that direction of late. Rat brains controlling robots, synthetic cells making electronics, protein making cell machinery etc etc. There was a talk on TED a couple of years ago where someone had programmed a machine to “learn how to walk”…

…to be honest, I can’t see any other approach working as system complexity increases. Genetic Algorithms etc.

Make a hardware problem a software problem. That’s my advice. Machines that learn. Then we’re really in trouble.

Stirling Sunflowers : Solar Electric Things

If you go to any high place on the planet that isn’t a desert of some sort, and look out at the view, chances are you’ll see a lot of green… still. As far as the eye can see, it will be mostly green.

That green is a million billion illion willion squillion leaves, and each one is almost certainly a little flat thing that’s been specially evolved and angled to aim at the sun, and quite a lot of them follow the sun across the sky. This is not an accident, and it’s not Mother Nature trying to tell us something… although…

This turned up on the TED rss a couple of days ago:

It’s Bill Gross going on about a couple of things for which I have a tangential fascination – genetic algorithms and Stirling Engines … and solar energy obviously. Everyone loves solar energy. Except amature nuke shill morons who are probably suffering from some sort of authority-worship/obedience complex. I blame the parents.

Unfortunately it’s from 2003, and the only things I can find that point to which direction this thing went in, are boring looking arrays of mirrors and fresnel lenses… though I daresay they’re still better than I could do. They’ve gone for the money. They’ve gone for centralisation.

Still, if it works…

I do like the initial design though – and the philosophy… something decentralised and cheap enough for anyone.

Other than that of course… this thing just looks… right.

sunflower

It is it’s own built in marketing. Sometimes something just looks so cool, you’ve got to get one whether it works 100% or not.

Genetic Algorithms and Evolution

I spent all day to day tinkering with the genetic algorithm software I wrote yesterday. I’ve tweaked the mutations so it’s pretty fast. I think what’s interesting about it is that the same software (with a few tweaks) can be thrown at a huge number of different problems.

Anyway, here’s a video where someone uses it to make hypothetical watches, and argue with hypothetical creationists.

One of the things that is interesting about this is the rapidity of the transitions between stages. This kindof reflects on the DIYbio-engineering thing I was on about a couple of days back. When a new more competative species gets into an ecosystem, conditions change very very rapidly.

Genetic Algorithms explained…

There’s a really good example/explanation of genetic algorithms over here

These are the things that were used to make the image I was going on about here a while back. A cool way of getting from A to B with particular relevence to robotics etc.

Anyway, if anyone’s interested I’ve had a first hacky go at putting a PHP version together. It’s not terribly optimised code, and I’m not sure if I’ve got it 100% right because I’m not fluent in Python, which is what the original was written in… but it does seem to work. A fair bit of tweakage can be done with the mutation rates etc, but… well, c’mon. It’s 4am.

If you want to download it, there’s a zip here

(edit) : there’s a streamlined (and far more efficient) version here


/*
|----------------------------------------------------------------------------------------------------------------------------------
| genetic Algorithm
|----------------------------------------------------------------------------------------------------------------------------------
|
|	First hacky attempt at a genetic Algorithm, based upon :
|	http://lethain.com/entry/2009/jan/02/genetic-algorithms-cool-name-damn-simple/
|
|	nick@tangerineworks.com :: 04/01/2009 
|	http://www.genomicon.com
|	http://www.tangerineworks.com
|
*/




$g=new geneticAlgorithm();

$population=$g->makePopulation();
$history=array($g->grade($population));

for ($i=0; $i<100 ;$i++){

	$population=$g->evolve($population);
	$grade=$g->grade($population);
	
	$history[]=$g->grade($population);

	if (!$grade) break;
}


print_r($history);

foreach($population as $i){
	print implode(',',$i).'='.array_sum($i).'
'; } /* |---------------------------------------------------------------------------------------------------------------------------------- | class : geneticAlgorithm |---------------------------------------------------------------------------------------------------------------------------------- | | */ class geneticAlgorithm{ var $target=200; // number we're trying to get the genes to add up to var $len=5; // number of genes in an individual var $minVal=0; // the range of values a gene can be var $maxVal=99; var $populationSize=20; // population size var $numToRetain=5; // this must be smaller than the population var $mutateChancePercent=10; // percentage chance of a mutation var $randomSelectChancePercent=5; // percentage chance of a non-optimal shag /* |---------------------------------------------------------------------------------------------------------------------------------- | initialise |---------------------------------------------------------------------------------------------------------------------------------- | | */ function geneticAlgorithm(){ srand(time()); } /* |---------------------------------------------------------------------------------------------------------------------------------- | makeIndividual |---------------------------------------------------------------------------------------------------------------------------------- | | */ function makeIndividual(){ for ($i=0; $i<$this->len ;$i++){ $individual[]=rand($this->minVal,$this->maxVal); } return $individual; } /* |---------------------------------------------------------------------------------------------------------------------------------- | makePopulation |---------------------------------------------------------------------------------------------------------------------------------- | | */ function makePopulation(){ for ($i=0; $i<$this->populationSize ;$i++){ $population[]=$this->makeIndividual(); } return $population; } /* |---------------------------------------------------------------------------------------------------------------------------------- | mutate |---------------------------------------------------------------------------------------------------------------------------------- | | */ function mutate($individual){ if (rand(1,100)<=$this->mutateChancePercent) { $individual[rand(0,$this->len-1)]=rand($this->minVal,$this->maxVal); } return $individual; } /* |---------------------------------------------------------------------------------------------------------------------------------- | breed |---------------------------------------------------------------------------------------------------------------------------------- | | breeds a couple, with a chance of a random mutation | */ function breed($father, $mother){ // if ($father==$mother) return false; // this was causing timeouts because sometimes they're al the same. for ($i=0; $imutate($child); return $child; } /* |---------------------------------------------------------------------------------------------------------------------------------- | test |---------------------------------------------------------------------------------------------------------------------------------- | | tests an individual against the the target | */ function test($individual){ return abs($this->target-array_sum($individual)); } /* |---------------------------------------------------------------------------------------------------------------------------------- | grade |---------------------------------------------------------------------------------------------------------------------------------- | | grades an entire population | */ function grade($population){ foreach($population as $individual){ $summed=$summed+$this->test($individual); } $average=round($summed/count($population),1); return $average; } /* |---------------------------------------------------------------------------------------------------------------------------------- | evolve |---------------------------------------------------------------------------------------------------------------------------------- | | evolves an entire population | */ function evolve($population){ // sort according to fittest $n=1; foreach($population as $individual) { $key=$this->test($individual) . (0.001*$n++); $graded[$key]=$individual; } ksort($graded); // choose the fittest $n=1; foreach($graded as $individual){ $parents[]=$individual; $newGeneration[]=$individual; if ($n++>=$this->numToRetain) break; } // randomly add remaining individuals to promote genetic diversity (every dog has his day) krsort($graded); $n=count($population)-1; foreach($graded as $individual){ if (rand(1,100)<=$this->randomSelectChancePercent){ $parents[]=$individual; $newGeneration[]=$individual; } if ($n--<$this->numToRetain) break; } // go get the new generation while(count($newGeneration)breed($parents[rand(0,count($parents)-1)],$parents[rand(0,count($parents)-1)]); if ($shag!=false) $newGeneration[]=$shag; } return $newGeneration; } } ?>

What this particular example does is to try to find a group of number-lists that add up to 200, by choosing lists of random numbers and “breeding” them, then selecting the ones that work best. What you end up with is something that looks like this:

(accuracy of each iteration)
Array
(
[0] => 60.6
[1] => 40.7
[2] => 28.9
[3] => 11.8
[4] => 8.4
[5] => 5.3
[6] => 1.9
[7] => 0.2
[8] => 0.2
[9] => 0.1
[10] => 0
)
(final result)
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200
33,27,59,64,17=200

I haven’t set it up to chose different lists so it’s zeroing on on the same one… it doesn’t always do this though. In this example it’s taken 10 steps to get to its target… the top list represents the accuracy of the attempt… with 0 being 100% right. You can tweak the values for mutation, mortality etc.

Seems like a daft thing to want to do, but imagine if you’re trying to do something really complex like getting an auto-piloted plane to fly level… it’s a hell of a lot easier to do something like this, and I have a feeling you’ll wind up with a far more adaptable and faster bit of code.

So there you go. This is an example of a fairly complex meme spreading… leaping from one language to another in a matter of hours… and as I said in the previous post on this subject, it’s of particular interest because it is a codified example of artificial natural selection. Machine learning and all that.

A single snowflake in the fractal explosion of technology

Clay Shirky‘s observation that when someone sees something on the web, they think “I could do that too”, is more than just a casual plaything for idle minds… it’s a fundamental human behaviour with a complex of very powerful drivers behind it.

It’s not just teenagers lip-synching, or happy-slapping, or this year’s harvest of ra-ra skirts. It’s something that appears to be happening in every single sphere and niche of human endevour… and it’s creating this fractal pattern of innovation.

I particularly like the following example because it involves a “genetic learning algorithm” which uses trial-and-error to do a job… and at latest count, around 167 people have replied, asking for the source code so they can participate in some trial-and-erroring of their own – copy->morph->copy->morph->copy->morp etc. It’s a little snapshot of an evolving evolution machine… and is a microcosm I suspect, of this thing that we’re currently calling the web, as a whole.

from Roger Alsing : Genetic Programming: Evolution of Mona Lisa

,

An ode to Cognitive Surplus.

A celebration of the inventive backwaters of the human spirit... a celebration of people who would appear to have far too much time on their hands...


A celebration of laterality.


If you come they will build it.


By knowledge shall the spheres be filled.


Golden Mean Calipers