Unit 6 Programming Assignment
Unit 6 Programming Assignment
Author Omitted
The pattern file is what the program uses to train the network. To create this file, you
need to encode the input and output, and then put the data into a format that the
program can analyze.
a. Encode the input (the seven segment display) in a binary format that the program
can recognize. This can be done many ways, but I suggest making a seven-element
vector with each index representing one location in the display.
c. Create a text file to use for training the network. This file should be in the following
format:
Number of patterns = 4
Number of inputs = 2
Number of outputs = 1
[patterns]
Number of
patterns = 17
Number of inputs
= 7 Number of
outputs = 7
[patterns]
1111110 0110000
0110000 0110001
1101011 0110010
1111001 0110011
0110101 0110100
1011101 0110101
1011111 0110110
1110000 0110111
1111111 0111000
1110101 0111001
1110111 1000001
0011111 1000010
1001110 1000011
1111011 1000100
1001111 1000101
1000111 1000110
0110111 1001000
Number of
layers = 3
Number of
inputs = 7
Number of hidden layers (Layer
1) = 5 Number of outputs = 7
b. Train the network by loading in your pattern file. This can be done by going to the
Patterns dropdown menu and choosing Load Patterns. Then choose the file that you
created from part 1.
The parameters are set by clicking the Train button to train the network. The error progress
graph is below:
Report the parameter values that you used for training your model as well as a graph of the errors over the
training steps. Include the weight file in your final submission, either as a separate file, or copied into
your write-up. The weights can be saved by going to the Weights menu and choosing Save Weights
[Weights]
Number of
layers = 2
[Layer0]
Number to
=6
Number
from = 8
0.847 3.293 5.979 -6.135 2.518 -0.604 -5.861 -3.685
-2.307 3.922 -3.548 5.222 1.359 4.301 -10.018 -0.097
-1.953 3.658 3.746 -0.433 6.553 -1.782 -7.396 1.923
-2.765 -1.763 4.588 2.579 -4.374 1.979 -1.17 0.481
2.254 4.926 -1.869 -2.124 3.145 0.782 -8.795 -1.77
5.214 4.575 -6.862 1.566 -3.216 -5.372 3.512 -2.306
[Layer1]
Number
to = 7
Number from = 7
3.269 -4.449 -7.439 -4.271 0.25 0.275 3.641
-3.272 4.511 7.459 4.214 -0.182 -0.408 -3.58
-3.189 4.578 7.458 4.13 -0.247 -0.645 -3.557
-0.175 -3.091 -6.069 2.768 2.362 5.107 -8.026
-6.576 -6.181 6.758 2.917 -0.67 -2.616 8.653
0.497 7.808 4.349 -7.798 -4.857 -1.419 3.538
-6.701 1.396 -1.003 -0.656 5.298 8.523 4.108
c. Test the model by choosing individual patterns and Clicking the Test one button.
The results will be printing in the console at the bottom. For example, here is the output
from the console and network:
Report the results for each of the inputs. Then, choose Test all to get the average error
and report the resulting value.
Part 3. Report results
Write a short paper (500-800 words) explaining the process of developing the network
provided including:
First, I created the network by clicking network menu and configuring the network based
on the options provided. Then, I decided the type and structure of the network to use. The
number of inputs and outputs were equal to 7. The artificial neural network used in process
consists of three groups, or layers, of units: a layer of input units is connected to a layer of
hidden units which is connected to a layer of output units. The activity of each hidden
unit is determined by the activities of the input units and the weights on the connections
between the input and the hidden units. The hidden unit processes the summations with its
activation function and distributes the result to the next layer. The input units are fed into
the network.
Number of
layers = 3
Number of
inputs = 7
Number of hidden layers (Layer
1) = 5 Number of outputs = 7
The initial weights assumed were within the range of 0 to 1. The weights were updated
for 17 times to reach the 18 iteration where the mean error between the original data
and the ANN output approach to 0.
References:
Jaksa, R., & Katrak, M. (2006). Neural Network Model of the Backpropogation Algorithm.
Available from http://neuron.tuke.sk/jaksa/publications/Jaksa-Katrak-SKJP05.pdf