Hey everyone, I'm back. *audience boos* I have some more questions.
After successfully creating an evolving colony of creatures that eat, mate and die, I've chosen to move on to neural networks. Now, in my last post, someone explained these to me as simply as they could and, though I understood and still do understand the basic gist of it, it's honestly still eluding me.
Having read a few more articles on it, I have a better understanding, and in turn, more questions.
One of the articles I read suggested an RTS game like Warcraft, with the peons having evolving neural networks; the best peons' networks being passed along. This idea pretty much amazed me, and I'd like to eventually get around to it. Now, I DO have the skill and knowledge to code my own RTS, but it's a big project, and I'm merely focusing on AI for now. As such, I would like to do something LIKE the said idea. I have a few ideas myself.
Now for my questions. I understand that in a neural network, neurons are given data. What do they receive. Let's say I gave my creatures a basic neural network to govern movement with obstacles. What would the input be, look like, etc? After they receive input, I understand that they output something, and to my understanding it is either 0 or 1. Is it always 0 or 1, or just in the given examples? I don't really understand how to control movement using 0s and 1s, besides to have four neurons (one for up, one for right, one for down, and one for left) and then putting the input into each one. I also don't understand the whole idea of "weights". I'm going to explain the situation as I understand it. Feel free to correct me, as that's what I want.
Let's say I have a colony of creatures, they have four neurons, ones for up, down, left and right. In every loop, certain data (?) is inputted into each neuron, and each then (not sure on this part) somehow calculates something (something to do with the input data * something, but I really don't understand this, so an explanation would be appreciated) and then outputs 0 or 1. The only flaw I see in this system is: What if two neurons fire? It moves up and right, or whatever. What happens if three or four fire? Is there some way it can have priorities?
EDIT: Or another scenario: In every loop, certain data (?) is inputted into the first neuron (let's say up), which then outputs 0 or 1 to a connected neuron (right) then to another (down) and lastly to another (left), which somehow outputs the movement data (four 0s and 1s?) I'm very confused.
ANOTHER EDIT: One more scenario, after some more thinking: In every loop, data (let's say the distance of the food around the creature) is inputted into all four neurons, ones for up, down, left and right. Each of the neurons then multiplies the data (let's say there's a piece of food 20 feet up, and none anywhere else, so the input is 20 into the up neuron, and 0 into the others) by it's own weight (is this correct)? Let's say all the neurons had the same weight, simply 1, so the up neuron fires, moving the creature up, the others don't fire, returning
- Is this the correct method?
I'm not looking on these creatures "learning" yet, but that'd be an added bonus if it's not too hard to implement.
My last question is: say you have some kind of creatures system, and they've evolved and learned, and yada yada. You're ready to quit, but your precious colony has taken four hours to reach the point it's at. How do you save the neural network data (the learnt data, etc) to a file? I'm not asking how to handle files, but how to store the data.
If I didn't elaborate enough on anything, let me know and I'll post a reply. Thanks for your input (no pun intended).