5
\$\begingroup\$

I've created a small simulation game and I have a basic neural network in place, each "creature" in my game has random weights on it's nodes and they all behave differently.

Their goal is to stay inside a circular "safe zone" that moves around the center of the game world. After 1000 generations of evolution not a single one of them makes any attempt to follow the circle around, so I was thinking I either..

  1. Don't know how to train them properly

  2. Don't know how to find who should live/ die.

  3. Using the wrong input/ outputs.

Here is the diagram of the brain (ignore the numbers) Image of neural network

Can anyone shed any light on what my issue is here? I'm sorry if this is vague I've only been using these for a couple of hours. But to elaborate on my question, what kind of inputs/ outputs should I be using with my neural network and what is the general procedure (in respect to my evolution approach) to train them to do the correct thing?? Could the error be caused by the number of nodes in the hidden layer or something?

\$\endgroup\$
  • \$\begingroup\$ are you using normalized (0..1) values for input? \$\endgroup\$ – dnk drone.vs.drones Oct 13 '15 at 14:40
  • \$\begingroup\$ No. should that be a thing I should change? How can I normalize a distance when there is no "max distance" ? \$\endgroup\$ – Shaun Wild Oct 13 '15 at 14:41
  • \$\begingroup\$ As far as I know NN require normalized values in input and returns normalized values as output. I suggest you to define a max distance \$\endgroup\$ – dnk drone.vs.drones Oct 13 '15 at 14:43
  • \$\begingroup\$ I normalized the angle to be 0...1 instead of 0...360 and did dist sq from 0...1 instead of 0...100^3, they still seem to just move around aimlessly generation after generation. \$\endgroup\$ – Shaun Wild Oct 13 '15 at 14:47
  • \$\begingroup\$ I don't know much about neural networks. In generational algorithms, you have a stage where you assess "fitness" (or "how good are we?"). Do you have that stage, and are you using the appropriate mechanism to tell how "good" the creature did (distance to the center?) \$\endgroup\$ – ashes999 Oct 13 '15 at 16:12
5
+50
\$\begingroup\$

I'm not entirely sure what the specific issue is with your setup, but there is a fairly in-depth explanation here of using a genetic approach to training neural networks.

One possible theory: generally in situations like games, NN's ability to learn patterns across long periods of time is limited. One way some people (like the author of the blog linked above) have gotten around this is to use recurrent neural networks .

RNNs are structured similarly to a regular feed-forward network, but they also have a set of 'context units' which (at each step) feed the previous values of the hidden units back into the hidden layer along with the new inputs from the input layer. By having this 'memory' of the previous hidden state, the model is able to detect patterns over a larger number of training steps.

I'm not entirely certain if this will solve your problem though. Perhaps someone else can comment on this?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.