Home > Uncategorized > Using Back Propagation To Train A Neural Network

Using Back Propagation To Train A Neural Network

June 16th, 2010
(download)

I made this very simple program to figure out how to implement "back propagation," a method of training a neural network.  In the previous program I published, I was using a genetic algorithm to adjust the weights of every network based on a fitness scale.  The method required a gene pool of a good size, made up of the weight information of each network, in order to successfully adapt.  Using a genetic algorithm this way made it impossible for a single network alone to improve.  Back propagation does not require more than one network, only one thing: a measurable goal.  Using back propagation, a network can hone in on the best values for each of weights it contains (which range from .0000 to .9999), adjusting them slightly every time the network runs a single generation.  The result is incredibly successful in this particular case. 

On the left is a set of color values you can modify for four squares in the middle.  You can type values in (0-255), use the slidebar, or choose to generate colors randomly.  Pressing the large "Start" button on the right will start up the networks (one for each square) and begin the back propagation.  While it is running, you can modify any color value or click to randomize the values and the networks will readjust every time. 

The key here is that there is a very easy goal for the networks to achieve.  Each square has only three inputs and three outputs: red, green and blue, each an integer between 0 and 255.  The program adjusts each weight by a ratio, so as an output value get closer to the goal, less is added to or subtracted from the weights.

This program is very simple and pointless in what it does, but the concept, even this particular application, can be used in other ways.  It would be possible to create, for instance, enemies in a game that can camouflage themselves based on whatever their around (or above, if you're looking down on a two dimensional game).  I've drawn some sketches and mapped out the idea for making a cameleon like creature that, when approached by the mouse, would move away, taking the image of whatever it was on with it.  The trouble in this case is that, to make a good quality camouflage effect, each pixel would have to be modified as each would most likely require its own network.  A simpler use could be something such as light finding or light avoiding bots.  I'll post more details about how the propagation works once I've finished the next project.

Posted via email from ideacrank.net

Maxwell Uncategorized

  1. No comments yet.
  1. No trackbacks yet.