Thursday, November 19, 2009

My Neural Network Algorithm

Since 3 days I was trying to write a sample neural network algorithm for boolean value inputs and output. My neural network contains three inputs and one output.I used one hidden layer with two hidden units. The AND operation on the three inputs gives the output. I wrote down a truth table and supplied this as a set of training examples to the algorithm. I initialized the weights to some random numbers(between 0 - 0.05). Then I ran the algorithm. After 50 iterations over the training examples, 6 out of 8 examples are consistent with the output. After that I iterated through the examples many times(nearly 2000000) but still only those 6 same samples are consistent. The input weights almost converge after 2000 trails but the hidden weights(weights on the links between hidden units and output units)never converge. They keep oscillating between 2 samples. I even tried by reducing the 'eta' value. But all 8 samples are never consistent with a set of weights.

No comments:

Post a Comment