Darwinbots Forum

General => Biology => Topic started by: Ulciscor on June 06, 2005, 08:16:58 PM

Title: Neural networks using bots
Post by: Ulciscor on June 06, 2005, 08:16:58 PM
Hey guys! 'Cos I am so new to DB and am not as well versed in biology and computer science as some of you, I don't know if this is a stupid idea or not.

I was wondering if it would be possible to make a neural network consisting of bots connected together in a specific way? Each bot would act like a neuron in the 'brain'. I'm not really sure what the point of this would be as the network would have to be large and would be very vulnerable to other bots. It's more of a think topic than a practical one.

The net could be used to control other bots, I.e. it could be used as a 'queen' to direct the behavious of 'workers.'

Tell me what you think, and sorry if this topic has already been discussed somewhere else!

Neural Networks (http://documents.wolfram.com/applications/neuralnetworks/index2.html)

B) Ulciscor B)
Title: Neural networks using bots
Post by: shvarz on June 06, 2005, 10:16:00 PM
Well, each bot can form four ties, peform logical and math operations, so in my opinion they are quite suitable for creating neural networks.  I imagine that there are better systems for that though.  Yet I am no expert on neural networks...
Title: Neural networks using bots
Post by: Numsgil on June 06, 2005, 11:29:20 PM
I've been thinking of this for a while, but I'm not sure if the bot language is strong enough yet.  This would work well with veggies that tie together to form a lattice.  Although I'm not sure what plants would think about.

I'll give it a more serious look when I have time.  Probably it just requires a new way of thinking about programming the bots, or perhaps the language changes I proposed.
Title: Neural networks using bots
Post by: PurpleYouko on June 07, 2005, 11:32:08 AM
We also need to make tie comunications simpler and quicker. Particularly if we want this kind of thing to be able to evolve.
I have some ideas on that front and that is what I will be working on when I get back to programming next week (hopefully)
Title: Neural networks using bots
Post by: Botsareus on June 07, 2005, 12:14:15 PM
Ok lets say we got a working "brain" , now what the hell are we going to use it for?

My personaly favorate for now is: Change Dna to I.o. text into a little chat program. Make a chat bot...
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 12:22:14 PM
Well, a neural network is good at making distinctions between the values of actions.  Like if producing shell decreases pain of the organism (bots can't feed on it), it'd learn to do that.  Produce too much shell, and it's pain would increase again (since pain is change in energy, and it takes energy to make shell) so it wouldn't make that much.  So a neural net could theoretically figure out a good balance on the fly by 'learning'.  The hardest part I think is figuring out the basic interactions between the bots/neurons.

PY, if I could make a suggestion, I would move ALL ties into a system like your new one for length and angle.  I'll be working on tie physics a bit too (revamping the entire physics code 'cept collisions.  Stupid drag got me excited about physics, such a headache) so tie angle and length commands may need to be modified in what they do, I'm not sure yet, I'll keep you posted.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 12:25:27 PM
Lol [Bot] I know this is probably a totally useless idea but it's a fun one nevertheless. I don't suppose there could be many applications other than what [Nums] suggested.

I was thinking maybe it could learn to change its own genome using viruses or something crazy like that to give itself an advantage in a situation. Dunno if it'd work though.

B) Ulciscor B)
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 12:30:26 PM
Do you have a good idea how to set up the structure of the net?  I haven't really played with neural networks, so I'm not experienced with the basic structure and interactions between neurons.

I mean, I understand in theory, but I have no idea how to start writing DNA code for it.
Title: Neural networks using bots
Post by: Botsareus on June 07, 2005, 12:33:57 PM
I see , basicaly a more complex multibot. I never seen a multibot more then 4 cells big. So yea , this should be fun.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 12:42:31 PM
As far as I know a neural net is a set of idiots each with a certain function, and information passes through the network and is modified and acted upon by the 'neurons.' So I just envisaged a load of bots tied together sending information via the ties, then performing operations on the information until an action is performed.
As for how to code it, I do not as of yet have any idea lol. I am reading about nets right now though so hopefully I will have some good ideas soon.

B) Ulciscor B)
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 12:45:26 PM
Quote
So I just envisaged a load of bots tied together sending information via the ties, then performing operations on the information until an action is performed.
Yep, that's as far as I got.  What information needs to be sent, and what operations need to be performed?  If we can figure that out we can probably put something together.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 12:53:19 PM
I think that's the problem, there seems to be no situation where this would be useful :(

Someone help! Lol

B) Ulciscor B)
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 02:36:02 PM
OK just had an idea, what about a network of veggies where a veggie whose energy is below a threshold sends a signal into the net and the others respond by sending energy to it. Like a bucket brigade system.
Also maybe if a lot of the veggies are under attack they could notify the net to move or maybe shift so that the weaker veggies are on the inside of the net.

I also had another idea about making a macrophage style organism which enveloped other bots and killed them either with shots or ties. This would be cool because the net would function as a body and as a brain at the same time. What do ya'll think?

B) Ulciscor B)
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 02:46:53 PM
Good idea, sort of like a jellyfish (they don't really have a central brain)

So we'd use *.nrg and pleas as inputs, .up, .dx, and sharenrg as outputs.  That's a good place to start.  We can add more if we get something good going (this simple system doesn't need a neural net, but if we build one right it can be made more complex).

Then we have to set up a fairly simple and easily expandable structure.  With four ties, a simple grid is just fine.  As veggies get enough nrg, they can expand the grid, so the grid is always growing.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 02:49:49 PM
Cool! The thing is I don't fully understand the dynamics of ties yet... I know they transfer information etc but I don't understand all this aligning and stuff.

Wouldn't we in effect have to get all the bots to swarm in the same direction? Or would the bots in the lead drag the others behind them?

Is there a link I can go to to have the more advanced features of ties explained or something please? 'Cos I'm sort of flying blind at the minute lol!
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 02:56:08 PM
That's sorta the area that hasn't been wikified yet (yes, it's a verb now).  To tell you the truth I've never played with them so I'm not too sure either.  I think PY's multibot tutorial might have something about them, or even the general help file in game.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 02:58:06 PM
OK [Num] thanks I think I'll mess about with them now and see what I can find out!
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 03:36:33 PM
OK well I have an idea for the energy sharing network but I don't know if it is overcomplicated or if it will even work.

I was thinking every time a new bot is born it bonds to the nearest 4 relatives and generates a random number for itself, from a suitable large range. So each bot in the net would hopefully have a unique ID.
So when a bot's energy is below a certain value, it would send it's ID to the attached relatives. They would then send out the ID to their attached relatives. Then when a bot receives an ID that is not the same as its own it would send some energy to all attached relatives. When a bot received energy and it hasn't got the same ID as the one it received it would send the energy out on all connections again.

Now I read what I have written I've just realised the whole thing could get stuck in a loop with the same bots sending each other energy all the time without it getting to the right bot.

Help!!
Title: Neural networks using bots
Post by: Light on June 07, 2005, 04:37:20 PM
sounds like you want .sharenrg
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 05:14:32 PM
Yes, but that would defeat the purpose to some extent.

I think you're on to something Ulc, you just have to apply a damping force to prevent that kind of infinite oscilation.

In a spring the force is -kx - vb where k and b are constants.  The -vb is what stops infinite oscillations.  In your case, x is energy requested - energy wanted and v is energy just sent last cycle (*.pain).  (I might have some signs backwards, bear with me).  Keep sending energy out/collecting energy at rate v every cycle, where v changes by -kx - vb as I described above.

If that didn't make any sense I can try again.  I'm a little tired.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 05:39:05 PM
Argh is that about simple harmonic motion? I think I get what you mean, it's like a pendulum stop swinging because of air resistance sort of thing and I need a way of stopping the exchange of energy continuing forever.

I have looked and can't find any referral to how to send data via ties or anything like that, does anyone know the location of the help files for this?
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 05:42:21 PM
tieval and tieloc.  tieloc locks onto a memeory location and tieval sends information through the tie.

Check the help->DNA help in game.  It has all the tie stuff.

The only problem is that currently you can only write through one tie once per cycle.  That limits the computational power of the bots.  But see what you can come up with.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 06:11:38 PM
I have looked through all the commands etc and have found stuff like readtie but have no idea how to use it... where does the tie ID go if I wanted to read from a tie? Is it something like

(tieidhere) .readtie store
*.trefnrg (variablename) store

to read energy from a bot tied with tie ID (tieidhere) and store the result in (variablenamehere)?
Title: Neural networks using bots
Post by: Numsgil on June 07, 2005, 06:16:30 PM
That looks right to me, but I haven't really played with ties before, so I'm not sure.
Title: Neural networks using bots
Post by: Ulciscor on June 07, 2005, 07:44:00 PM
Hey again lol. I've been trying to work out the DNA for this plant guy but it's quite awkward so I've posted it in the DNA help section. Could you mosey on over and take a look plz?? Thanks!
Title: Neural networks using bots
Post by: Ulciscor on June 09, 2005, 10:27:53 PM
I think I have an unhealthy obsession with neural nets but they're so damn cool! I have also had some cool ideas about them that could be put in DB. I was gonna put 'em in the suggestions bit but since this thread is here I'll use it if that's OK...

I was thinking it would be neat for every bot to have a really simple neural net built-in so to speak, one that hasn't been set to perform any particular task yet. A blank slate kind of thing. It would be good if there was a little training program that allowed you to train your neural net to do different things, like recognising family, food, how to hunt or defend etc. Although thinking about it this completely detracts from using DNA, which is what DB is all about...
Crap! There must be something neural nets can be used for!
Title: Neural networks using bots
Post by: Ulciscor on June 09, 2005, 10:31:02 PM
Oo hang on sudden thought, the coding in DNA can sort of be equated to instinctive behavious as the bot has no option in acting on it or not, if criteria are met then an action is executed. Well instincts would still be useful in a situation where an immediate action is required, but a net would be capable of forming more complex actions from multiple inputs. DNA could still be used to pass information to and retrieve data from the net, and commands could be added to screw with another bot's net. Sexual reproduction could result in a bot with a combination of both parents networks, whereas asexual reproduction would lead to a bot with a mutated version of the parent net.
Title: Neural networks using bots
Post by: Botsareus on June 10, 2005, 12:11:39 PM
Lets see here, Neural Net

This is far from close but:

Quote
-5000
10000
rnd
add
990
rnd
store

we got a bot doing random actions , thats a start.

A more complex system of random code , manipulating memory locations etc. can be used to create a "vertual neural nets"

Just bc its a nerual net we are still not working with malecules we are working with computer code. A nerual net in computers is just a fansy way of menipulating memory and/or doing random actions.

Ulciscor, based on my example try to write a more complex bot using somthing like a "nerual net".
Title: Neural networks using bots
Post by: Ulciscor on June 10, 2005, 12:18:07 PM
I thought that neural nets were made of nodes all connected together? The nodes are equivalent to the neurons in a brain, the connections are the dendrites and axons.
Title: Neural networks using bots
Post by: Botsareus on June 10, 2005, 12:20:13 PM
Select case maybe?

cond
blabla
start
stop
cond
blabla
start
stop
cond
blabla
start
stop


All you have to do is write a complex matrix of randomly generated numbers , mathematics and conditions all linked to actions.
Title: Neural networks using bots
Post by: Botsareus on June 10, 2005, 12:23:35 PM
You have to stop thinking actual physics wise and start thinking code wise if you want each robot to have its own brain, otherwise what we talked about before is fine: make a complex multibot, use ties.
Title: Neural networks using bots
Post by: Numsgil on June 10, 2005, 12:26:49 PM
That's how I understand it Ulc.  You have a series of independant but communicating nodes that have rules of how to move signals coming in to signals going out.

You just connect any series of such nodes to an input and an output and provide it with a way to determine "bad" from "good", and it will learn the best method for doing it.  Or theoretically anyway.
Title: Neural networks using bots
Post by: Ulciscor on June 10, 2005, 12:27:44 PM
Could you use a gene as each node, turning off the other node genes using variables? Or is that overcomplicated?
Title: Neural networks using bots
Post by: Numsgil on June 10, 2005, 12:28:54 PM
It's possible but it would take quite a bit of programming.  The problem is, of course, the linear nature of the genes.  Bots tied together lends itself more to this kind of form, but has its own problems obviously.