Original Post
I wrote my first artificial neural network implementation the other day and got it working great for XOR and a few other simple functions I gave it. It seemed a little slow at times, but it would usually eventually get the error sum for each epoch down to a reasonable level. I've decided to give it something a little more complex and now I'm having some issues. The network consists of 7 inputs, 4 outputs, and currently, a single hidden layer with 6 neurons in it. It uses backprop for training and, while I've tried a learning rate with a wide range of values, it's currently set at 0.5. I'm trying to train the network to navigate an agent around a single wall and toward a target location. The 7 inputs are the lengths of 3 rays that extend out to find walls and 4 activation levels of radar wedges around the agent that return information about the target. As it is, the training set ends up being around 150 entries in length (they are recorded at every time step as I drive the agent around the wall toward the target). I've reduced this to as low as 6 and I still get the same problem: the change in the error sum eventually levels off to the point where it's no longer decreasing, even though the sum may be something like 30.0 or 40.0 (whereas I'm trying to get it to 0.01). Sometimes, the error will actually INCREASE over the course of the training. I can't figure out if this is a problem with my data set or with my network training implementation. Here's basically what my code is doing (or what I think it's doing, anyway):
For each training set
For each neuron in the output layer
Set the error value of this neuron to:
error=(target output - actual output) * actual output*(1 - actual output)
error sum += (target output - actual output) squared
For each weight from the hidden layer to the output layer
new weight += error * learning rate * activation of hidden layer neuron
Next weight
new bias weight += error * learning rate * bias (bias is 1)
Next outer layer neuron
For each neuron in the hidden layer
error = 0
For each neuron in the outer layer
error += outer neuron error * weight from hidden to outer
Next outer layer neuron
error *= hidden neuron activation * (1 - hidden neuron activation)
For each weight from inputs to the hidden layer
hidden neuron weight += error * learning rate * input value associated with this weight
Next weight
new hidden bias weight += error * learning rate * bias
Next hidden layer neuron
Next training set
============== If you've made it this far, I thank you. If any clarification is needed, let me know. I'd appreciate any help you can offer.