0% found this document useful (0 votes)
125 views

Unit 6 Programming Assignment

This document provides instructions for a programming assignment to create an artificial neural network to recognize handwritten digits. It involves encoding the input patterns, creating a training text file in a specific format, configuring a 3-layer network with 7 inputs and outputs and 5 hidden nodes, training the network by loading the pattern file, and testing the network on individual and all patterns. The results, network architecture, training parameters, and weight files are to be reported. A short paper explaining the neural network development process is also required.

Uploaded by

josephagadaga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views

Unit 6 Programming Assignment

This document provides instructions for a programming assignment to create an artificial neural network to recognize handwritten digits. It involves encoding the input patterns, creating a training text file in a specific format, configuring a 3-layer network with 7 inputs and outputs and 5 hidden nodes, training the network by loading the pattern file, and testing the network on individual and all patterns. The results, network architecture, training parameters, and weight files are to be reported. A short paper explaining the neural network development process is also required.

Uploaded by

josephagadaga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Unit 6 Programming Assignment

Author Omitted

CS 4407-01 Data Mining and Machine Learning

University of the People


Part 1. Write the pattern file

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.

Binary values Characters ASCII Equivalents


0110000 0 48
0110001 1 49
0110010 2 50
0110011 3 51
0110100 4 52
0110101 5 53
0110110 6 54
0110111 7 55
0111000 8 56
0111001 9 57
1000001 A 65
1000010 B 66
1000011 C 67
1000100 D 68
c. Create a
1000101text file to use for
E training the network. This file should be in the following format:
69
1000110 F 70
Number of
1001000patterns = 4 Number
H of inputs = 2 Number of outputs = 1 [patterns]
72

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

Part 2. Create the network


a. Configure the network by going to the Network menu and choosing Configure
Network from the list of options

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:

The graph indicates that error is approximately 0.

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:

The process of developing a network

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.

The network architecture:

Number of
layers = 3
Number of
inputs = 7
Number of hidden layers (Layer
1) = 5 Number of outputs = 7

a. Details on how much iteration of network designs were evaluated.

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:

A basic introduction to neural network (n.d).


Retrieved from
http://pages.cs.wisc.edu/~bolo/shipyard/neural/local.ht
ml

Jaksa, R., & Katrak, M. (2006). Neural Network Model of the Backpropogation Algorithm.
Available from http://neuron.tuke.sk/jaksa/publications/Jaksa-Katrak-SKJP05.pdf

You might also like