Neural Network Creatures Simulation

Community Forums/Showcase/Neural Network Creatures Simulation

Nate the Great(Posted 2009) [#1]
This is a little example of using evolution to simulate neural networks "learning"


The readme.txt...

After running neuralnetworkcreatures.bmx, you should see an 800x600 screen full of little blue creatures and green dots. The green dots represent food that the little blue creatures eat. If they over or under eat, they will die. Their "fullness" is demonstrated by a bar above them. As it shrinks they are becoming hungry, as it grows they are becoming full.

This simulates the evolution of the creatures through natural selection. The 10 Creatures of the 20 original creatures that last the longest are duplicated with mutations for the next generation. Each generation is more competitive for food and survival than the last and eventually by about generation 30, the creatures will show signs of reasoning and decision making based on how full they are and where the food is.

So how do they work? Each creature is controlled by a neural network. Each neural network has 4 inputs. Fullness, Left antenna smell, Right antenna smell (determined by distance from food), and heartbeat. The heartbeat neuron beats at a steady pulse, once every 20 simulation steps. The neural networks are randomly generated at first but evolve every generation.

Controls:

Just sit and watch if you want. If you want it to go faster press the spacebar once and it will stop rendering. Press it again to allow it to render again. Click on a creature to see its neurons. (connections are not shown at the moment)


Other notes:

The number on each creature is the generation its brain structure was created.
Enjoy


heres a download: http://naillproductions.synthasite.com/resources/NeuralNetworkCreatures/NeuralNetworkCreatures.zip

screenies




edit: here is the code, its hard for me to upload things atm no images required


enjoy


jhocking(Posted 2009) [#2]
this is really cool


slenkar(Posted 2009) [#3]
its quite disturbing watching the little b'stards wander about in a biological fashion, I will check out the source tomorrow

good job!


Nate the Great(Posted 2009) [#4]
this is really cool


thanks, I was wondering what are the similarities/differences between this and the memes simulation on your website?

its quite disturbing watching the little b'stards wander about in a biological fashion, I will check out the source tomorrow

good job!



thanks, and it was disturbing to me too at first... when I simulated to generation 50 it was really just too much for me. lol the reasoning they develop is astounding. It is based off of the neurons in our brains and how they work so I guess its proof it works :)


slenkar(Posted 2009) [#5]
the randomness of new fish is created through the create_mistake function?


Nate the Great(Posted 2009) [#6]
yeah, it cycles through all of the neurons and connections and has a certain perecent chance of changing them randomly. These simulate mutations.


Jerome Squalor(Posted 2009) [#7]
the link seems to be broken here.


jhocking(Posted 2009) [#8]
I was wondering what are the similarities/differences between this and the memes simulation on your website?


They look similar, that's about it. The creatures in memetics simulation no. 1 don't survive or die based on how good they are at finding food, it's based on which ones people click on (which is basically random.)


Htbaa(Posted 2009) [#9]
Very nice example. I'm currently at generation 34 :-)


Mark Tiffany(Posted 2009) [#10]
Fascinating.

I'd like to see (may look at code and try to add) some stuff to see "aggression" and "self-preservation". e.g. left/right sensors like those for food to "see" proximity/direction of other creatures, and a health penalty for striking each other. Would probably also need some "genes" in there, too, e.g. a mutating "hardness" gene that slows them down but also makes them less susceptible to collisions...


Htbaa(Posted 2009) [#11]
Ok I stopped at generation 56. As expected with neural nets, every generation takes longer and longer to evolve.

Do you plan on saving state so that you can later load these to have your generated A.I. do it's magic, or perhaps even evolve further?


Mark Tiffany(Posted 2009) [#12]
Saving state would be great so you can keep going and/or picking the "best so far" neural net to export / import.

Rummaging in the cod, it seems the structure of the neural net itself is fixed and doesn't mutate (it's just the threshold & weightings that change in "makemistake"). I know very little about neural nets, but is that type of mutation something that could / should be added (or not?) Suspect in most instances will make a "freak" creature?


Nate the Great(Posted 2009) [#13]
the link seems to be broken here.



hmm could you test it again?

They look similar, that's about it. The creatures in memetics simulation no. 1 don't survive or die based on how good they are at finding food, it's based on which ones people click on (which is basically random.)



oh so looking at it more closesly I see its more about social interactions than genetics right? or is that just experiment 2

Fascinating.

I'd like to see (may look at code and try to add) some stuff to see "aggression" and "self-preservation". e.g. left/right sensors like those for food to "see" proximity/direction of other creatures, and a health penalty for striking each other. Would probably also need some "genes" in there, too, e.g. a mutating "hardness" gene that slows them down but also makes them less susceptible to collisions...



yeah, im adding/changing the simulation at the moment to have more features but with a small brain they are limited to how much info they can process and bigger brains means exponentially more time to evolve :/ Im thinking about having random mutations such as random connections forming and neurons being created as well... this could make them have potentially huge brains lol

Ok I stopped at generation 56. As expected with neural nets, every generation takes longer and longer to evolve.

Do you plan on saving state so that you can later load these to have your generated A.I. do it's magic, or perhaps even evolve further?



yeah im on 75 right now... dang they live for at least 200,000 cycles, I think ill stop right here lol

and I definitely plan on making it possible to load and save neural nets and the simulation, or maybe put the top survivors of each generation all against eachother? lol


Saving state would be great so you can keep going and/or picking the "best so far" neural net to export / import.

Rummaging in the cod, it seems the structure of the neural net itself is fixed and doesn't mutate (it's just the threshold & weightings that change in "makemistake"). I know very little about neural nets, but is that type of mutation something that could / should be added (or not?) Suspect in most instances will make a "freak" creature?



yeap im experimenting to see if I can make their brains bigger but bigger brains mean slower reaction time so my guess is it will balance out

edit: on another note, I have been studying their brains individually, like simulating them myself via pen and paper and im really amazed lol it just doesnt seem impossible to "compress" that much logic in that small of a brain... nature never ceases to amaze us with its cool systems... if anyone wants to try this to "print" the brain of a fish in the ide, just use the neuralnet.printnnet(n:neuralnet) function to print out all of the connections, thresholds and weights

and I am quite surprised I havent gotten flamed about this as its controversial ethicly, I guess thats a good sign about this community, I tried to show it to my family (all non programmers) and they started going on about how it wasnt right and all this cuz they think im tryin to "make life and play God" which of course isnt true, its just a fun experiment that mimics natural systems... (evolution and neurons)


Nate the Great(Posted 2009) [#14]
well here are some very interesting results:

I added 2 input neurons that smelled how close the creatures were to other creatures and at about the 50th generation, the creatures almost never go though eachother, somehow it is advantagous not to go looking for food by going through another creature because it has most likely cleared out the food from its path. It is also not advantagous to follow another creature as they avoid this as well. Interestingly though it doesnt take much longer for them to evolve these traits despite the increase in neurons and connections that have to be solved. I still have not implemented new neurons and connections in the makemistake function


Mark Tiffany(Posted 2009) [#15]
Cool. I guess the fact it doesn't take as long suggests that each generation is always likely to last about the same amount of time? Probably true of early generations, and it may well be that the biggest evolutionary steps occur early on, with later generations "just" refining?

In terms of the neural net, it looks like 3 neurons in the "brain", in addition to the 4 inputs and 2 outputs (left / right). What's the extra one (var nc1)? Why 3 neurons - just to keep it simple? Or is there some logic? (Feel free to point me at some reading material!)

I also wondered about environmental stimulus, although I take your point that adding more will probably generate a very slow process, so maybe being able to play with "connected" inputs. For example :

- warm / cold regions (in colder regions you get hungry quicker)
- light / dark for "cold-blooded" creatures (dark = get cold = die quicker)
- water as well as food, but go too far into deep water & die (probably a bit too lethal with the number in the simulation!)

What would be equally neat would be to allow the user to draw the above at the start / change during run time. I wonder what would happen if the creatures could also "see" your mouse - would they become "god" fearing creatures if you keep being nasty? Or "god-botherers" if you are too nice? ;-)


Mark Tiffany(Posted 2009) [#16]
And at the risk of creating lazy creatures, should you get hungrier the faster you move? Might see some interesting balances of "sleeping" after a meal, followed by quick search for food, then slow down again???


Nate the Great(Posted 2009) [#17]
Cool. I guess the fact it doesn't take as long suggests that each generation is always likely to last about the same amount of time? Probably true of early generations, and it may well be that the biggest evolutionary steps occur early on, with later generations "just" refining?



yeah thats pretty much what ive observed so far.


In terms of the neural net, it looks like 3 neurons in the "brain", in addition to the 4 inputs and 2 outputs (left / right). What's the extra one (var nc1)? Why 3 neurons - just to keep it simple? Or is there some logic? (Feel free to point me at some reading material!)



its funny you mention reading material, I actually had trouble finding much useful material, with the exception being google talks of youtube. the "brain" is made of 4 neurons n1-3 and nc1 the center neuron, it is distinguished because it is not connected to the heart or the hunger neurons or any of the other control/sensor neurons. It simply allows for another level of complexity. The more neurons the more complex. There is no reason for 4 neurons to be the brain, it just seemed reasonable...

I also wondered about environmental stimulus, although I take your point that adding more will probably generate a very slow process, so maybe being able to play with "connected" inputs. For example :

- warm / cold regions (in colder regions you get hungry quicker)
- light / dark for "cold-blooded" creatures (dark = get cold = die quicker)
- water as well as food, but go too far into deep water & die (probably a bit too lethal with the number in the simulation!)



those would be fun to add, I plan on making the simulation area much bigger too so it can accomodate more variation in creatures and the environment.

What would be equally neat would be to allow the user to draw the above at the start / change during run time. I wonder what would happen if the creatures could also "see" your mouse - would they become "god" fearing creatures if you keep being nasty? Or "god-botherers" if you are too nice? ;-)




yeah I think if you mess with it too much it would screw up the evolutionary process but it would still be fun :)

And at the risk of creating lazy creatures, should you get hungrier the faster you move? Might see some interesting balances of "sleeping" after a meal, followed by quick search for food, then slow down again???




hmm yeah I think ill add that too. Right now they seem to be doing that anyway. They eat, slow down, quick search for food, eat, slow down etc...
thanks


Mark Tiffany(Posted 2009) [#18]
Tried hacking in the hungry / fast thing (simply by increasing hunger quicker if over a certain speed), and it seems to just limit them to that speed.

One thing that seems odd is that they always do this funny move & stop, move & stop thing. It is presumably a reaction to the heartbeat, but I don't get why that would happen, and almost wonder if there's a bug in there (or something in there to prevent positive feedback from sending them into a spiral?).

I'm also fairly sure that I've seen creatures with nice big green bars get food and suddenly die.

the "brain" is made of 4 neurons n1-3 and nc1 the center neuron, it is distinguished because it is not connected to the heart or the hunger neurons or any of the other control/sensor neurons. It simply allows for another level of complexity. The more neurons the more complex. There is no reason for 4 neurons to be the brain, it just seemed reasonable...

Hmm, that wasn't how I read the code : nc1 seems to just be connected as a "to" neuron from each of the other 3, not a central neuron? There's no connection from nc1 "to" anywhere? How can it "do" anything?

So would you increase the size of the brain by adding in 4's and linking together somehow? Or do avoid imposing structure in the design and simply connect an extra however many nodes and connect them all to each other, leaving it up to the weightings / thresholds to evolve how much of a connection is in place?

Final thought : instead of random mutations (or as well as), should you create the next generation based on those that survived? And harking back to the earlier post about seeing each other, mutate / merge those that touch? ;-)


GIB3D(Posted 2009) [#19]
Is there a reason why they prefer turning left almost 95% of the time? It's pretty funny to watch, including when they start spazzing out as they starve.


Mark Tiffany(Posted 2009) [#20]
Here's a quick hack to speed up the simulation: as the last 10 survivors always get carried over to the next generation, there is no need to continue the simulation past the last 10. (at least, I don't think there is!) There's possibly a better way to do this, maybe make it optional too.

In the main While loop, find and add this:




_Skully(Posted 2009) [#21]
This is really interesting stuff Nate


Nate the Great(Posted 2009) [#22]
... double post

This is really interesting stuff Nate



thanks


Nate the Great(Posted 2009) [#23]
One thing that seems odd is that they always do this funny move & stop, move & stop thing. It is presumably a reaction to the heartbeat, but I don't get why that would happen, and almost wonder if there's a bug in there (or something in there to prevent positive feedback from sending them into a spiral?).
at generation 135 I dont see nearly as much stop and go motion :) but yeah its still there. I have developed a much faster way to simulate it, I stop the sim when there are 10 left so not all of them have to die for the next generation to be born.


I'm also fairly sure that I've seen creatures with nice big green bars get food and suddenly die.

you saw right, thats overfeeding :)


Hmm, that wasn't how I read the code : nc1 seems to just be connected as a "to" neuron from each of the other 3, not a central neuron? There's no connection from nc1 "to" anywhere? How can it "do" anything?


well theres lotss of neurons in your brain that arent directly connected to your eyes or your ears or your heart or your stomach but without them your brain wouldnt have as much potential, it basicly just gives the brain more flexibility.

Or do avoid imposing structure in the design and simply connect an extra however many nodes and connect them all to each other, leaving it up to the weightings / thresholds to evolve how much of a connection is in place?

those are my thoughts if the connections are useless they will be set to 0 and become meaningless so the brain will organize itself.


Final thought : instead of random mutations (or as well as), should you create the next generation based on those that survived? And harking back to the earlier post about seeing each other, mutate / merge those that touch? ;-)


well the top 10 survivors are basicly doubled with a (very)few random mutations among them. Without these mutations eventually every creature would become the same and they would only have as much potential as the best creature in the first generation did.

On another not, I am simulating asexual reproduction, sexual reproduction (involving 2 partners) complicates things, ill experiment with that when it comes time... no pun intended LOL

Is there a reason why they prefer turning left almost 95% of the time? It's pretty funny to watch, including when they start spazzing out as they starve.



try running it again, they dont do the same thing every time. I have a group that turns right on my screen lol... but I think it might be just like the right/left handed thing in society, most of the people in the world are right handed... why? im not sure but this simulation backs up reality in that eventually the creatures start acting very similar.. ei turning the same direction

Here's a quick hack to speed up the simulation: as the last 10 survivors always get carried over to the next generation, there is no need to continue the simulation past the last 10. (at least, I don't think there is!) There's possibly a better way to do this, maybe make it optional too.



haha funny thing is I just got done adding that flexibility to my program, it goes much faster thanks for the feedback

eidt: new code




_PJ_(Posted 2009) [#24]
well the top 10 survivors are basicly doubled with a (very)few random mutations among them. Without these mutations eventually every creature would become the same and they would only have as much potential as the best creature in the first generation did.


This is true of reality to an extent. Subtle mutations are introduced thanks to external radiation sources (cosmic rays) and viral RNA. These subtle differences can be either beneficial or not, but when environmental factors are equivalent, these subtle changes are greatly responsible for mutations and variations.
The inclusion of random variations in the code seems like an excellent way to represent this :)


Who was John Galt?(Posted 2009) [#25]
Interesting thread, Nate! I haven't yet got to my 'Blitz machine' to give it a try.

Here's an idea for your simulation- use it or lose it. Understimulated neurons in the brain could be removed and perhaps randomly rewired in the next evolution step.

Stimulants and depressants- foods that speed up or slow down the heartbeat.

The 'heartbeat' neuron is an interesting idea. Why/how did you come up with it? Can 'working' creatures be evolved without a heartbeat?


Virtech(Posted 2009) [#26]
This is so amazing! I've been looking for good neuralnet source code for quite some time now. Your code helps tremendously.

Please, keep up the excellent work :)

Many thanks.


Nate the Great(Posted 2009) [#27]
This is true of reality to an extent. Subtle mutations are introduced thanks to external radiation sources (cosmic rays) and viral RNA. These subtle differences can be either beneficial or not, but when environmental factors are equivalent, these subtle changes are greatly responsible for mutations and variations.
The inclusion of random variations in the code seems like an excellent way to represent this :)



yeah, it is, I figured nature does it why not try it, and actually *most* of all mutations are destructive but very very few are constructive, however the constructive ones stick out because the last much longer :)


Interesting thread, Nate! I haven't yet got to my 'Blitz machine' to give it a try.

Here's an idea for your simulation- use it or lose it. Understimulated neurons in the brain could be removed and perhaps randomly rewired in the next evolution step.


Yeah I have an idea of what im gunna do after thinking about it, and thats not too far off...


The 'heartbeat' neuron is an interesting idea. Why/how did you come up with it? Can 'working' creatures be evolved without a heartbeat?



well about a year ago I vaguley remember seeing a vid on youtube about some ai animals they looked kinda like mine too, and the author had the ingenious idea to put in a heart (inspired by nature lol) to provide background noise for the neural network to feed off of, I have searched and searched for that video but I think it has been removed. and without "jumpstarting" neural networks (like a car), I dont know how a neural network could work without a "heart" or a constant source of energy or something lol... I mean nobody really has figured out exactly how our brain works so we all just have to throw out ideas and hope for the best at the moment.

This is so amazing! I've been looking for good neuralnet source code for quite some time now. Your code helps tremendously.

Please, keep up the excellent work :)

Many thanks.



thanks, glad I could help. And before I started this, I searched the web and couldnt find any neural network source code to base mine off of anywhere... it was quite frusturating.

I hope I can figure out how to make this into an easy to use mod/include so people could use this in games, I think it would really spice things up.


_Skully(Posted 2009) [#28]
I think our brain is event driven which is why boredom makes us sleepy


Nate the Great(Posted 2009) [#29]
I think our brain is event driven which is why boredom makes us sleepy



what do you mean by that?

are you saying my creatures are bored because of their lack of variety so I should give them more to do?? lol!


Virtech(Posted 2009) [#30]

thanks, glad I could help. And before I started this, I searched the web and couldnt find any neural network source code to base mine off of anywhere... it was quite frusturating.

I hope I can figure out how to make this into an easy to use mod/include so people could use this in games, I think it would really spice things up.



I was aware of youre previous neuralnet source code entry in the archives. But without a "realworld" example I couldn't easely figure out how to setup the network correctly for my needs.

This example application made all the difference! :)

Are you planning to extend this code with a Save-Function for the current state of the neuralnet?

If so, would it then be possible to either:
- Resume training at a later time
- Include trained data for loading in games

Thanks


Nate the Great(Posted 2009) [#31]
Are you planning to extend this code with a Save-Function for the current state of the neuralnet?

If so, would it then be possible to either:
- Resume training at a later time
- Include trained data for loading in games




yes, yes, and yes

right now im experimenting a bit more with ways of using neural networks and training stuff


Virtech(Posted 2009) [#32]
yes, yes, and yes


Great!!

I feel the bionet got rewarded! A little bit like one of those blue creatures when it just grabbed a bite and steps back (G>30) to chill out lol:-)


Nate the Great(Posted 2009) [#33]
I feel the bionet got rewarded! A little bit like one of those blue creatures when it just grabbed a bite and steps back (G>30) to chill out lol:-)


lol yeah I thought that was odd how they like to chill whenever they get food, its probly cuz they die if they overeat tho.


Nate the Great(Posted 2009) [#34]
well it turns out there is a bug in the way I was simulating neural nets although it seemed to work fine to me :) anyway, if a neuron was charged to .5 and had a threshold of 1 then the .5 charge was dropped to 0 whoops, I think I was using an old version of my neural net thing cuz I remember fixing that same exact bug and testing for it :) now its fixed and the creatures seem to be having seizures lol... maybe their brain needs to be different now that I changed the engine...


Mark Tiffany(Posted 2009) [#35]
updated code with bug fix? ;-)


Htbaa(Posted 2009) [#36]
That's a bit of a downside with neural nets. Once you edited or expand its capabilities all your test data can be thrown away and you need to rerun the simulations again. Hoping to get good and useful data :-).


Nate the Great(Posted 2009) [#37]
updated code with bug fix? ;-)




not yet, soon though, im trying to add features...

That's a bit of a downside with neural nets. Once you edited or expand its capabilities all your test data can be thrown away and you need to rerun the simulations again. Hoping to get good and useful data :-).



yeah :( Ive run this program at least a million times... anyway with what I have now, they can gain neurons/connections and the bug is fixed... Ill post the new code in the first post in a minute just one more test run

edit: updated the code! (not the uploaded version im still having trouble uploading atm)

note: the creatures now need mannny more generations to evolve any advanced reasoning :( but it is more accurate


SpaceTW(Posted 2009) [#38]
I have a suggestion. What if the food was ot just immoble and waiting to be eaten, but instead moving as an independent neural network? For example, mae it a big fish eats small fish sort of thing, where each one evolves. It may be hard to implement, but I think it would be much more interesting, even if only one could be trained at a time.


GIB3D(Posted 2009) [#39]
You could then make a thing like the game
Fishy - http://www.learn4good.com/games/online/play_fishy_online.htm
where you play as a little fish, and you have to eat smaller fish than yourself and you grow. Only it would be completely AI/Neural Network driven. Smaller fish try.. TRY... to avoid bigger fish and bigger fish try to eat the smaller ones if they get hungry.


Mark Tiffany(Posted 2009) [#40]
Here's an initial stab at an improved routine to draw the neural net including connections. Doesn't cope with added neurons yet, but does handle all connections. Not 100% happy, but kind of interesting to see what's going on.

Replace drawnet in Type Fish with the method & function below.




Mark Tiffany(Posted 2009) [#41]
Nate,

I think there's possibly something up with the simulation, as it always seems to slow down with each generation. I realise each generation could now be more complex, but...while looking to see if I could help optimise in any way to get through the generations faster...

I commented out ff.mistake when copying - so each generation should essentially be the same. I then timed the neuralnet.update() call, and initially this takes less than a millisec, but by generation 15 or so it's up to 2 millisecs, and by generation 37 it's hitting 5 millisecs.

Not a lot, but suspect there's some kind of leak - maybe not killing all the neurons / connections in dead fish each generation? Maybe only applies if not going to last survivor?

Or is there a good reason it slows down that I'm missing?


schilcote(Posted 2009) [#42]
Interesting game. They stopped developing new behaviors at about generation 30 or so.


Nate the Great(Posted 2009) [#43]
I think there's possibly something up with the simulation, as it always seems to slow down with each generation. I realise each generation could now be more complex, but...while looking to see if I could help optimise in any way to get through the generations faster...
yeah its because I forgot to add code for deleting the neural nets so its updating more and more and more neural nets every generation...



Interesting game. They stopped developing new behaviors at about generation 30 or so.



not quite true, they just slow down development a lot, if you let them evolve to generation 200 they gain new abilities albeit very slowly.


Virtech(Posted 2009) [#44]
Hi Nate,

How is your work progressing?

Btw, how much data does the neural net generate? And how much of it is it required to save for later resuming?


slenkar(Posted 2009) [#45]
im guessing here, but I think the neural networks are about the same size, its just a bunch of threshold numbers that are different from fish to fish.


Mark Tiffany(Posted 2009) [#46]
For anyone else wanting to fix the leak that slows each generation down, replace fish.remove() with this:
	Method remove()
		brain.remove()
		fishlist.remove(Self)
	End Method

and replace neuralnet.remove() with this:
	Method remove()
		neuralnetlist.remove(Self)
		For Local n:neuron = EachIn neuronlist
			n.remove()
		Next		
		For Local c:connection = EachIn connectionlist
			c.remove()
		Next		
	End Method

I also made a minor update to the drawnet routine in the post higher up the thread.


Nate the Great(Posted 2009) [#47]
Hi Nate,

How is your work progressing?

Btw, how much data does the neural net generate? And how much of it is it required to save for later resuming?



well its really actually coming together nicely on paper lol I tried to just program it like I normally do just doing what is logical but it got way too complicated and i kept forgettting things/messing up... so its all on paper until i solve the logical flaws and figure it out :)

im guessing here, but I think the neural networks are about the same size, its just a bunch of threshold numbers that are different from fish to fish.




yeah, generally every hundred generations they gain about 3 to 4 neurons and about 5 connections...

For anyone else wanting to fix the leak that slows each generation down, replace fish.remove() with this:



sorry about the leak, I will get rid of it in the next update...

edit: updated code in my first post...


Nate the Great(Posted 2009) [#48]
well I got quite a shocker with my new code, I ran it to generation 1000, it took a few hours... and then I printed one of the fish brains that was most successful... this is the result.....

neuron: heart Energy: 1.00000000 Threshold: -0.843166649
neuron: hunger Energy: -0.0230184477 Threshold: -1.00000000
neuron: n1 Energy: -51.6441269 Threshold: -0.925994992
neuron: n2 Energy: 0.376940936 Threshold: 0.221370786
neuron: n3 Energy: -6.08626032 Threshold: -0.617243409
neuron: left Energy: -0.0499181822 Threshold: -0.578703642
neuron: right Energy: -0.00622200780 Threshold: -0.989880860
neuron: foodlft Energy: 0.000000000 Threshold: -0.0629188567
neuron: foodrgt Energy: 0.000000000 Threshold: 0.0728934705
neuron: c1 Energy: 0.0216781199 Threshold: -0.916729033
neuron: enemyrgt Energy: 0.000000000 Threshold: -0.641174853
neuron: enemylft Energy: 0.000000000 Threshold: -0.923968971
neuron: x Energy: 0.0106154177 Threshold: 0.807013750
neuron: x Energy: 0.000000000 Threshold: -0.584276378
neuron: x Energy: -1.77894878 Threshold: 0.542351067
neuron: x Energy: -0.179877162 Threshold: 0.577651918
neuron: x Energy: 0.787415445 Threshold: 0.708863080
neuron: x Energy: -0.209173471 Threshold: 0.00328878872
neuron: x Energy: -0.00508732814 Threshold: -0.0603123643
neuron: x Energy: -0.0109821716 Threshold: 0.305416197
neuron: x Energy: 0.796777606 Threshold: 0.956379533
neuron: x Energy: -0.00612331554 Threshold: 0.427821189
neuron: x Energy: -2.62955618 Threshold: 0.595003366
neuron: x Energy: 0.000000000 Threshold: -0.823830545
neuron: x Energy: 0.000000000 Threshold: -0.853409529
neuron: x Energy: 0.00738620758 Threshold: 0.651361346
neuron: x Energy: 0.243370816 Threshold: 0.149051502
neuron: x Energy: -0.000744468474 Threshold: 0.987581015
neuron: x Energy: 0.0946245044 Threshold: 0.893354058
neuron: x Energy: -0.000937606907 Threshold: 0.649790168
neuron: x Energy: 0.0159956645 Threshold: -0.163555235
neuron: x Energy: -17.6201878 Threshold: 0.450390548
neuron: x Energy: 0.00861619692 Threshold: 0.801571012
neuron: x Energy: 0.770703137 Threshold: 0.741306305
neuron: x Energy: -0.000528282835 Threshold: 0.819585323
neuron: x Energy: 0.000000000 Threshold: -0.218049198
neuron: x Energy: 0.000000000 Threshold: -0.851829052
neuron: x Energy: 0.198255062 Threshold: 0.146502212
neuron: x Energy: 0.000000000 Threshold: -0.367736697
neuron: x Energy: 0.000000000 Threshold: -0.104228437
neuron: x Energy: -0.138963923 Threshold: -0.387862533
neuron: x Energy: 0.700860262 Threshold: -0.107238322
neuron: x Energy: -0.000730241882 Threshold: 0.151955426
neuron: x Energy: -0.0198532473 Threshold: -0.891672134
neuron: x Energy: 0.000000000 Threshold: -0.0875981376
neuron: x Energy: 0.000000000 Threshold: 0.634875298
neuron: x Energy: 0.000000000 Threshold: -0.824704409
neuron: x Energy: 0.000000000 Threshold: -0.101259090
neuron: x Energy: -1.06844056 Threshold: -0.0413851030
neuron: x Energy: 0.000000000 Threshold: 0.0473240726
neuron: x Energy: -3.24183105e-007 Threshold: 0.926985979
neuron: x Energy: 0.000000000 Threshold: -0.811743855
neuron: x Energy: -3.72673092e-008 Threshold: 0.286615342
neuron: x Energy: 0.000000000 Threshold: -0.279880762
connection from heart to n1 Weight: -0.974932373
connection from heart to n2 Weight: 0.400736690
connection from heart to n3 Weight: -0.0386097617
connection from hunger to n1 Weight: -0.800172210
connection from hunger to n2 Weight: 0.990728319
connection from hunger to n3 Weight: 0.776845276
connection from n1 to n2 Weight: 0.355776548
connection from n2 to n1 Weight: -0.635035932
connection from n2 to n3 Weight: 0.161264464
connection from n3 to n2 Weight: 0.522288084
connection from n1 to n3 Weight: -0.676239431
connection from n3 to n1 Weight: 0.323400378
connection from foodlft to n1 Weight: -0.264297545
connection from foodlft to n2 Weight: -0.352528691
connection from foodrgt to n3 Weight: -0.113690190
connection from foodrgt to n1 Weight: 0.0699122399
connection from n1 to left Weight: 0.540153027
connection from n2 to left Weight: -0.132778704
connection from n3 to right Weight: -0.137051567
connection from n1 to right Weight: 0.184592530
connection from n1 to c1 Weight: -0.765005827
connection from n2 to c1 Weight: -0.209908441
connection from n3 to c1 Weight: -0.223515972
connection from enemyrgt to n1 Weight: -0.0532780364
connection from enemyrgt to n3 Weight: 0.820966303
connection from enemylft to n1 Weight: -0.672941566
connection from enemylft to n2 Weight: -0.731621146
connection from enemyrgt to x Weight: 0.963847399
connection from x to n3 Weight: -0.223660216
connection from n3 to foodrgt Weight: 0.879390538
connection from foodlft to x Weight: 0.00533412769
connection from x to foodrgt Weight: 0.975737214
connection from enemyrgt to left Weight: -0.0461192355
connection from foodrgt to enemyrgt Weight: -0.742978632
connection from x to enemyrgt Weight: 0.455103815
connection from hunger to x Weight: 0.488390297
connection from x to foodlft Weight: -0.584960520
connection from n1 to x Weight: -0.629624307
connection from x to n1 Weight: -0.736866474
connection from heart to x Weight: 0.786754668
connection from x to n1 Weight: -0.962282240
connection from left to x Weight: 0.210350886
connection from x to enemyrgt Weight: -0.757080674
connection from x to n1 Weight: 0.107109748
connection from x to x Weight: -0.169936627
connection from x to x Weight: -0.131175339
connection from enemyrgt to n1 Weight: 0.138057619
connection from c1 to x Weight: 0.00666878326
connection from x to n1 Weight: -0.559858322
connection from x to x Weight: 0.934035718
connection from x to n3 Weight: 0.932102323
connection from n3 to x Weight: -0.484932810
connection from x to x Weight: 0.0576935261
connection from hunger to n3 Weight: 0.949952662
connection from right to x Weight: -0.529925704
connection from enemylft to n1 Weight: 0.945479214
connection from x to x Weight: 0.709615767
connection from x to enemyrgt Weight: 0.467866719
connection from foodlft to x Weight: -0.678679287
connection from x to heart Weight: -0.741682947
connection from x to x Weight: 0.613302112
connection from x to foodrgt Weight: 0.931344151
connection from foodlft to x Weight: -0.788960040
connection from x to foodlft Weight: 0.949736834
connection from x to x Weight: 0.544486284
connection from n3 to x Weight: 0.738403320
connection from x to foodrgt Weight: -0.987292409
connection from x to x Weight: 0.893017590
connection from x to hunger Weight: 0.180875391
connection from left to x Weight: -0.961156249
connection from x to x Weight: 0.952815831
connection from enemylft to x Weight: 0.172236234
connection from enemylft to heart Weight: 0.367797405
connection from x to x Weight: 0.797092199
connection from x to x Weight: 0.628482878
connection from x to foodrgt Weight: 0.320382684
connection from left to x Weight: -0.321284324
connection from x to right Weight: -0.390011370
connection from x to heart Weight: 0.207373366
connection from foodlft to x Weight: 0.152873918
connection from x to x Weight: -0.531450212
connection from n2 to foodrgt Weight: 0.688478172
connection from x to x Weight: 0.318053335
connection from x to x Weight: 0.318049967
connection from x to x Weight: -0.784032524
connection from x to x Weight: 0.0177661516
connection from x to x Weight: -0.520436943
connection from x to x Weight: -0.679846108
connection from x to x Weight: -0.597568810
connection from x to x Weight: 0.0259763226
connection from n2 to x Weight: 0.647348523
connection from x to x Weight: 0.146361634
connection from x to x Weight: -0.377294511
connection from x to x Weight: -0.196204230
connection from x to c1 Weight: -0.217642069
connection from x to x Weight: -0.139541343
connection from x to x Weight: 0.816773832
connection from x to x Weight: -0.689394057
connection from x to x Weight: 0.589423239
connection from x to x Weight: 0.211054653
connection from x to n1 Weight: -0.391950667
connection from x to foodrgt Weight: -0.479286820
connection from x to x Weight: 0.583130300
connection from x to n1 Weight: -0.333588988
connection from x to x Weight: 0.682459176
connection from foodrgt to x Weight: 0.414838284
connection from x to x Weight: -0.572505414
connection from x to x Weight: 0.0919271708
connection from x to x Weight: 0.890084207
connection from x to x Weight: -0.767583966
connection from heart to hunger Weight: 0.254254490
connection from x to x Weight: -0.907078266
connection from x to x Weight: -0.690980375
connection from x to x Weight: -0.409700900
connection from x to x Weight: 0.978783786
connection from x to c1 Weight: 0.695432484
connection from n3 to x Weight: -0.484457970
connection from x to x Weight: -0.100405216
connection from x to x Weight: 0.948435545
connection from x to x Weight: 0.386952221
connection from x to x Weight: -0.239228070
connection from x to x Weight: 0.425004780
connection from x to x Weight: -0.271669328
connection from x to x Weight: -0.976004720
connection from x to x Weight: 0.298650950
connection from x to x Weight: 0.614292026
connection from c1 to n1 Weight: -0.0372657031
connection from x to x Weight: 0.137725756
connection from x to x Weight: -0.0473885275
connection from x to x Weight: -0.110942230
connection from foodlft to x Weight: -0.573190749
connection from x to x Weight: -0.790772140
connection from x to n1 Weight: 0.828720272
connection from x to x Weight: 0.979187548
connection from x to x Weight: -0.222265124
connection from x to x Weight: 0.353388637
connection from x to n1 Weight: 0.196362391
connection from x to x Weight: 0.247978196
connection from x to x Weight: 0.247641057
connection from x to hunger Weight: -0.0958492458
connection from foodrgt to x Weight: -0.675706267
connection from x to foodlft Weight: -0.616990268
connection from x to x Weight: 0.698731422
connection from x to x Weight: -0.0932890475
connection from x to x Weight: -0.961419344
connection from x to left Weight: -0.927369595
connection from x to x Weight: 0.511784673
connection from x to x Weight: -0.956716835
connection from x to x Weight: 0.211732134
connection from x to left Weight: 0.0725963339
connection from enemyrgt to x Weight: 0.145503521
connection from x to x Weight: -0.516466856
connection from x to x Weight: -0.560723126



edit: thats 54 neurons and 163 connections! I think I might have lost count tho lol

although this fish came from the 1000th gen, it does not survive for as long as some of my previous experimental fish did at the 100th generation

this forces me to conclude that although fish brain size is a factor to a certain point, more neurons after that point simply become useless for such a simple creature causing unnecessary complexity and cpu usage.


Nate the Great(Posted 2009) [#49]
well now I am thinking this brain mass may not be that unnecessary, I am wondering if having such a complex brain may allow them to have a very short term but usefull "memory" of where food is and how much they have to turn to get to it... I cannot tell as of yet... but it would be interesting...


Danny(Posted 2009) [#50]
Maybe the fish are getting fed up with the same food and just gives up! :D

Seriously though, this is extremely interesting stuff you've created here Nate, well done and thanks for sharing! I'd definitely like to study this more..

D.


Danny(Posted 2009) [#51]
OK Guys, how about making an Massive-Multi-Online version of this system? Connecting all the fish together to make them learn at lightning speed past a trillion generations!

If we're lucky enough we can all enjoy Free Sushi by next Tuesday!! LOL!

D.


Nate the Great(Posted 2009) [#52]
thanks danny,

hmm I am working on neural groups inside of neural nets atm, ill post it when im done


Shortwind(Posted 2010) [#53]
Nate - Have you done anymore work on this project? What have been some of your findings? Anything interesting? I'm quite curious.

Not to get off topic, but have you considered what impact DNA has on creatures in nature? I mean, single cell organisms like ameba don't have a "brain" per say, but they seem to have figured out a pretty successful life style for themselves, been around for millions of years.

I am NOT critisizing. I am seriously impressed with the work you've done, from what I've seen. I'm just curious if you have added any more inputs to the brain? Or maybe some different motivations for the creatures.

One question - have you any idea what's makes the creatures fly right past food (when they are hungry) to go for food that's farther away? Is this a bug in the program, or simply a nature of the brain state at the moment?

Can you post some updates? If you don't want to post updated code, then please just give us some written feedback on how your project is going? Maybe some updated screenshots?

Also, why do they move backwards in relation to where the smell antenne are located? Shouldn't they move toward a food particle with the sniffers out front? They always seem to eat backwards...Or is this just a graphic thing?


Thanks!


Nate the Great(Posted 2010) [#54]
Nate - Have you done anymore work on this project? What have been some of your findings? Anything interesting? I'm quite curious.


I havent done much with neural networks recently but I certainly plan to when I have more time.

Not to get off topic, but have you considered what impact DNA has on creatures in nature? I mean, single cell organisms like ameba don't have a "brain" per say, but they seem to have figured out a pretty successful life style for themselves, been around for millions of years.


I thought about doing this but it is a different field alltogether although it would be interesting

One question - have you any idea what's makes the creatures fly right past food (when they are hungry) to go for food that's farther away? Is this a bug in the program, or simply a nature of the brain state at the moment?


well they start out stupid but as they get smarter about 100 generations into it they almost never ignore the oportunity to get food when they are hungry. It is not a bug in the program as far as I am aware.

Can you post some updates? If you don't want to post updated code, then please just give us some written feedback on how your project is going? Maybe some updated screenshots?


well I havent done anything successful with the code that isnt posted here but maybe ill start messing with it again.

Also, why do they move backwards in relation to where the smell antenne are located? Shouldn't they move toward a food particle with the sniffers out front? They always seem to eat backwards...Or is this just a graphic thing?


well this is definitely not a graphic thing because their input depends on the location of their smellers which are at the end of the antennae. I think it shows how although evolution is pretty good, it may do something wrong or at least not the best way it should be done. In the long run creatures that move backwards are not as proficient at gathering food as those that move forwards but in the early stages of development the creatures that move forwards have no advantage over those that move backwards because of their lack of developed skills. Here is what happens:

some creatures are born that move backwards and some move forwards

there is no specific advantage to either because they are not fine tuned food hunters yet

out of random chance the backwards movers may outlive the forwards movers or vice versa.

Once this happens a switch in direction is highly unlikely because many neurons must change to reverse the creature and its senses not just one or two

hope this helps and I may go back and make another experiment with this code or mess around with genetics soon but i wont make any promises as I am pretty buisy :( Recently I have also been thinking about self replicating/ self improving assembly programming.


Thanks!


Arowx(Posted 2010) [#55]
Cool!

What about getting them to fight/eat/mate/reproduce within the simulation?

I think that could make for interesting evolutions, you could even evolve warrior 'fish' and see who can evolve the best predators/hunters!

Fish Fight! ;0)

What about tying the newurons to higher level activites i.e. automate stearing/move to from and use neurons to decide what to do.


Yahfree(Posted 2010) [#56]
You could possible turn this into a screen saver which saves the current state, and comes back to it when the screen saver opens again?

Just an idea :D.


GW(Posted 2010) [#57]
You could possible turn this into a screen saver which saves the current state, and comes back to it when the screen saver opens again?

Already done


Damien Sturdy(Posted 2010) [#58]
*BRAINPOP*

Yep, nice work!

It would be lovely for this to save and restore its state, as i'd like to play with this over longer periods of time.

Anyone want to take that on? (if not I'll do it come the weekend, no time now haha.)


Neuro(Posted 2010) [#59]
Nice!