Simple Neural Network

By rador.dekeche, January 9, 2017

Code Link: Github

Code: C++

Library: Unreal

One of the aspects of A.I. programming I’ve always found fascinating was the Neural Network. The concept of having a program that learns how to accomplish a task, rather than having it be hard coded, was always interesting one. This project is one done for one of my senior classes at Champlain College. I wanted to experiment with a simplistic neural network, or basically a network with static neurons and connections, that just altered the weights on those connections. The scenario was simple:

  1. Organisms have the ability to move forward/backwards, and move while rotating left/right. (4 output nodes)
  2. Organisms also have the ability to see an object, food or other organisms, in front or to the side of them. (6 input nodes)
  3. Organisms use energy over time, replenish energy by colliding with food objects, and die when energy = 0.
  4. One round consists of 100 organisms being dropped at the same position on a plane, with food randomly spawning around them.
  5. Each organism is then weighted by an evolution algorithm, based on how long it lived. The longer it lived, the more likely it is to contribute for the next simulation.

Overall, the neural network does work. Over time, organisms become better able to discover the fastest way to find food. There are some areas that could be improved upon. First, having a single generation spawn at the same time is not the best method for accurate results, as slower organisms may be able to survive due to luck, faster organisms will survive due to fitness, but organisms in the middle may fail because their food is stolen first. I originally chose this method because it was better for presenting with a small amount of time, as more generations could be processed during a presentation.

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *