![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
As it can be seen the smallest error is still below our wanted level and changing the momentum didn’t help. Notice how we didn’t change the learning rate. That is something we will do in our next attempt. Training attempt 9Step 5.9. Train the network Now we will try to change Learning rate but maintain momentum at 0.9 which is our best result so far. With Learning rate of 0.005 we get total net error of 0.01969 in 37 iterations which clearly means we need more neurons in our hidden layer. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Training attempt |
Hidden Neurons |
Learning Rate |
Momentum |
Max Error |
Number of iterations |
Total Net Errors |
9. |
4 |
0.005 |
0.8 |
0.01 |
37 |
0.01969 |
10. |
8 |
0.2 |
0.9 |
0.01 |
30 |
0.00547 |

Step 6.10. Test the network
Now that we have acceptable solution we will try and test our neural network and see how it stacks up to linear regression model that we have in our dataset. We will choose 5 random inputs data from our data set and calculate their average error and compare it to the same 5 linear regression data. The results table is below:
Network output |
Expected value |
Linear regression estimate |
Network error |
Regression error |
0.012417508 |
0.02972028 |
0.007358953 |
0.017302772 |
0.022361326 |
0.027087257 |
0.022727273 |
0.010629599 |
0.004359985 |
0.012097673 |
0.069840154 |
0.11013986 |
0.05478332 |
0.040299706 |
0.05535654 |
0.005748127 |
0.004370629 |
0.001635323 |
0.001377497 |
0.002735306 |
0.00538984 |
0.01048951 |
0.004088307 |
0.005099671 |
0.006401203 |
Average error |
0.013687926 |
0.01979041 |
||
As it can be seen from above, in all 5 of the random chosen inputs our neural network achieved better result than linear regression method and can be used as a estimation of the output, which in this case is relative performance of a CPU.
Advanced learning techniques
The real power of neural networks lies in predicting outputs for inputs that it wasn’t trained for. In our case this means that we can use novel data that describes computer processors and predict what is a relative performance of those CPU-s with high statistical certainty. This data can be later used for example by CPU vendor to set prices of those processors and compare with other vendors.
In order to test how our network behaves with novel data, we will divide our data set in two parts – training set and test set. Usually when dividing dataset like this there must be enough data to use in order to train the network but not to much. When the network is over trained any minor deviation from expected data can be considered as a bigger error that it is. That is the reason why those networks are not good in prediction which is exactly what we don’t need.
In this research we will try two different proportions, 70/30 and 80/20, that is for example in first case, about 70% of data will be our training set and the rest we will use to test our network. The data will be chosen randomly because if we chose similar data the network would not be able to perform very well with the data that differs significantly from our original.
Step 3.11. Create a training set
First thing we need to do is to create a new training set. We once again do this by right clicking Training Sets -> New -> Training Set. We call it ComputerHardware70 and choose other parameters same as we did in all previous cases. Now we need to load a file called ND70.txt which is a file that contains 70% of original data set in the same manner as we did in the beginning.

Step 5.10. Train the network
After selecting our last neural network with 8 neurons and changing its training set to our new training set we can try and retrain our network. After just 9 iterations we trained it with an error of 0.00591 which is little worse than with our whole dataset. But that doesn’t mean anything. In order to test it we need to create new test set.

Step 6.11. Test the network
Now we need to add another training set to our training set folder in order to test how it behaves. The file we must use is ND30.txt which represents the rest (30%) of our data set. Now instead of clicking train we need to click Test. The results are displayed below:

As we can see, our error is 0.02037 which is not a good result. But when we look at individual results we will see that we have only few extreme errors, mainly in the first few test cases. They is an error of 0.55, 0.33, 0.23 which are isolated cases as can be seen from our picture. That implies that we maybe need to add those cases to our training set instead of our test set.

That means that in our last attempt we will use 80% of our dataset as our training set and the rest as test set. The results are displayed below:
Training attempt |
Hidden Neurons |
Learning Rate |
Momentum |
Max Error |
Number of iterations |
Total Net Errors (training) |
Total Net Errors (test) |
11. |
8 |
0.2 |
0.9 |
0.01 |
9 |
0.00591 |
0.02037 |
12. |
8 |
0.2 |
0.9 |
0.01 |
13 |
0.01382 |
0.02566 |
The results are not promising, we didn’t succeed to train this network with novel data. This must be because there were little data to begin with our that our network needs more neurons.
Conclusion
We created three different neural network architectures in this experiment. We concluded that with recognizing data using neural network the best way to go is to use 8 neurons in a hidden layer. The results that we got worked better in all of our cases where compared to linear regression method that is located in our dataset, and should be used to estimate relative performance of CPU-s. . The total results of our research can be seen in a tables below.
Table 1. Standard training techniques
Training attempt |
Hidden Neurons |
Learning Rate |
Momentum |
Max Error |
Number of iterations |
Total Net Errors |
5 random inputs test - number of correct guesses |
Network Trained |
1. |
2 |
0.2 |
0.9 |
0.01 |
10 |
0.01797 |
/ |
yes |
2. |
2 |
0.2 |
0.7 |
0.01 |
31 |
0.01885 | / | yes |
3. |
2 |
0.2 |
0.8 |
0.01 |
35 |
0.02173 | / | yes |
4. |
2 |
0.4 |
0.9 |
0.01 |
9 |
0.01522 | / | yes |
5. |
2 |
0.1 |
0.9 |
0.01 |
56 |
0.01655 | / | yes |
6. |
4 |
0.1 |
0.9 |
0.01 |
22 |
0.01499 |
/ | yes |
7. |
4 |
0.1 |
0.8 |
0.01 |
30 |
0.01696 |
/ | yes |
8. |
4 |
0.1 |
0.7 |
0.01 |
37 |
0.02109 |
/ | yes |
9. |
4 |
0.005 |
0.8 |
0.01 |
37 |
0.01969 |
/ | yes |
10. |
8 |
0.2 |
0.9 |
0.01 |
30 |
0.00547 |
5/5 | yes |
Table 2. Advanced training techniques
Training attempt |
Hidden Neurons |
Number of hidden layers |
Training set |
Test set |
Learning Rate |
Momentum |
Max Error |
Number of iterations |
Network trained |
5 random inputs test |
Total Net Errors (training) |
Total Net Errors (test) |
11. |
8 |
1 |
70% |
30% |
0.2 |
0.9 |
0.01 |
9 |
yes |
1/5 |
0.00591 |
0.02037 |
12. |
8 |
1 |
80% |
20% |
0.2 |
0.9 |
0.01 |
13 |
yes |
1/5 |
0.01382 |
0.02566 |
Below you can download and try these network and maybe try to enhance the precision of results.
DOWNLOAD
See also:
Multi Layer Perceptron Tutorial