|
• Re:
One major problem I see here is that you have no hidden layers. Hidden layers allow the network to adjust more and more (the more layers the more it can adjust) and in different ways. However, it can take longer for it to learn (it has to adjust more weights total). For a simple example of how different a single layer NN is from a multi-layer NN, try and have a single layer NN (meaning only input and output layers) learn the XOR logic gate function. It can't be done no matter what you do. However, add a hidden layer and it can be done. This is because the hidden layer allows the inputs to adjust in a different manner before it reaches the output layer. So, using the XOR example, a single layer would be like this:
Input layer takes in the two binary numbers (0, or 1), and applies the necessary weights. In order for the network to make sure that an input of 01, or 10 is 1, the weights have to both be above the threshold. So if the threshold is .5, the weights each must be .5 or higher. Now, with XOR, an input of 11 outputs a 0. Since the weights are .5 each, this can't be accomplished while maintaining the ability to output 1 with 01 or 10.
A hidden layer would work like this, for XOR:
Input layer layer takes in the two binary numbers and applies a set of necessary weights. Lets say that the input layer processes the output of 1 side of the issue (meaning inputs of 10, and 01, output 1, as well as 11 since the weights have no choice but to both be higher than the threshold). Now, that is sent to the hidden layer. Let's also say that a neuron in the input layer sends an output of 1 if the inputs were 11. Now, the hidden layer processes the 01/10 issue and the 11 issue. The 11 neuron (the one in the input layer that outputs 1 whenever 11 is input) will have a negative weight connected to the hidden layer neuron. The other input layer neuron will have a positive weight connected to the hidden layer neuron that exceeds its threshold (so the weights are -.2 (at least) and .6 (at least)). If both input layer neurons output a 1, the hidden layer neuron doesn't fire. If only one input layer neuron fires (which will always be the 01/10 neuron unless 00 is input), the hidden layer neuron will fire. So, in the end, the input layer tells the hidden layer the original input and the 01/10 processed input, and the hidden layer takes that information and completes the 00/11 input issue if it applies. The hidden layer then sends that to the output layer which outputs the correct XOR system.
As you may see, hidden layers can allow the inputs to be altered in ways that allow the network to acheive the correct response. The more hidden layers, the more the inputs can be altered, however, traning may take longer. Try using hidden layers to acheive your results.
The Intellector
|