Programming Assignment Page 1 of 11
Programming Assignment Page 1 of 11
Programming Assignment
Name Removed
Programming Assignment Page 2 of 11
Introduction
This presentation will present my effort in developing and training a neural network
to detect the numbers 0 to 9 as well as the letters A through F and H of the alphabet when
Preliminaries
I will create a network, load the pattern file, and then train the network to recognize
the letter or number based on the pattern of segments input using the Basic Prop neural
network simulator.
My design will be based on the seven-segment display shown below, with each
segment serving as one input to the neural network. This numbering will be sent into my
neural network as input. The ASCII code (in binary) of the letter or number determined by
0 48 0110000
1 49 0110001
2 50 0110010
3 51 0110011
4 52 0110100
5 53 0110101
6 54 0110110
7 55 0110111
8 56 0111000
9 57 0111001
A 65 1000001
B 66 1000010
C 67 1000011
D 68 1000100
E 69 1000101
F 70 1000110
H 72 1001000
Programming Assignment Page 4 of 11
The simple Prop simulator use the pattern file to train the network. In this case, I
encoded the input and output and converted the data into a format that the software could
understand.
a. The input is in binary format and is represented as a seven-element vector, with each
index indicating a different point on the display. I encoded the display unit segments in my
pattern file in the sequence 9 8 7 6 5 4 3 2 1 from left to right in order to match the binary
representation of the ASCII code (both read from left to right) and for my personal
convenience of reading the binary digits. If the position is lighted up for a number, the value
b. Because the software required binary input and output, I also encoded the output in
binary format. The values in ASCII have been translated to binary. Look at the graph
above.
c. This is a snapshot of the text file I'll be using to train the network, which has the
required extension (.pat) so that basic Prop recognizes it as an input pattern file. (See
a. Configure the network by selecting Configure Network from the list of choices in the
Network menu.
I picked a three-layer feed-forward network of six neurons, with inputs and outputs
both equal to seven (as in the pattern I produced in part 1) and an output bias of one.
b. Load your pattern file into the network to train it. This may be accomplished by selecting
Load Patterns from the Patterns dropdown menu. Then choose the file you produced in
section
1. Then use the control panel on the right side to train your network.
Programming Assignment Page 7 of 11
Here's a snapshot of the parameters I chose (learning rate of.3, momentum of.8,
learning steps of 5000, weight range of -1, -1) and the pattern file loaded.
The network was then trained by clicking the Train button. Here are some screenshots of the
As we can see, the errors are smoothly converging to 0, indicating that my model is
functioning. After 20,000 learning steps, it is already near to the desired error rate
percentage of less than 5% (.05), as specified by the assignment. Let's attempt another
5000 steps.
That reduced my error rate to.049, which was required, but now I'm going to try to
The error rate is now at .03, after 50,000 learning steps, but now I’ll train it to 100,000 steps.
The error rate has now reached. 024, which is half of the minimum amount, thus I'll call my
testing a success.
I've provided a snapshot of the weights I changed to improve performance (also see
c. Test the model by choosing individual patterns and Clicking the Test one button.
Here are some screenshots of the 17 distinct patterns from my pattern file being tested.
Programming Assignment Page 10 of 11
As you can see, the results of the testing for each unique pattern correspond to what I stored in
the pattern file.
Conclusion
These activities clearly show how to build up and train a basic feed-forward artificial
neural network. According to Gershenson (2003), training and learning entail applying an
algorithm to alter weights to get the intended result, i.e., supervised learning. I believe I
have accomplished this here while also learning something; now I simply need to lower my
References:
http://arxiv.org/ftp/cs/papers/0308/0308031.pdf
Words: 850