



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Choe; Class: ARTIFICIAL INTELLIGENCE; Subject: COMPUTER SCIENCE; University: Texas A&M University; Term: Unknown 1989;
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!




You will implement perceptron learning from scratch (see section 3 for details), and train it on AND, OR, and XOR functions. Then, you will take an existing backprop- agation code (see section 4), train it and test it under different conditions and report your findings. The same three boolean functions will be used for the backpropagation learning. For further details on perceptrons and backpropagation, see the lecture slides and also Hertz et al. (1991). Specific submission instruction will be given in section 5 and section 6.
You may use either C/C++, Java, Matlab (or Octave), or Lisp. The resulting code should be able to compile and run on the departmental unix host (unix.cs.tamu.edu). You may use a different language with a permission from the instructor, in which case you will be asked to do a demo in front of the TA.
To compile your programs other than Lisp (which you already know), see the following instructions.
The full paths for the compilers are (on compute.cs.tamu.edu):
Perceptron activation is defined as:
Output = step
i=
W [i] ∗ IN P [i]
where step(X) = 1 if X ≥ 0 and step(X) = 0 if X < 0 (see figure 1).
W[0] W[1] W[2]
−1 X Y
f(X,Y)
INP[0] INP[1] INP[2]
Figure 1: Perceptron. The input IN P [0] is the bias unit, fixed to − 1 , and has an associated weight W [0], which is the threshold. The two inputs X and Y are given and the output f (X, Y ) will be calculating (or attempting to calculate) a boolean function, one of OR, AND, or XOR.
Implement a perceptron with two input units (three, including the bias unit that has a fixed input value -1) and one output unit. Your program should take three inputs from the command line.
$ ./bp conf/xor.conf | grep ERR
and to view the actual output values for the inputs:
$ ./bp conf/xor.conf | grep OUT
This section will detail what you actually have to do and have to submit. All projects should be turned in using the csnet turnin.
Implement perceptron learning algorithm as detailed in section 3, and with the program conduct the following experiments, and submit the required material, along with the code and the README file as usual.
Experiments:
(a) initial weights, and show the plot of the decision boundary (the straight line defined by the weights). (b) final weights, and show the plot of the decision boundary. (c) number of epochs taken to complete training if successful (let us call this n), and (d) for each epoch, the sum of squared error for all four input patterns.
(a) Do you think perceptron will be able to learn the boolean function f (X, Y ) = ¬(X ∨ Y )? What do you think is the role of the sign of the weights in this case? Think about the geometric interpretation in that case.
Table 1: Boolean Function f (X, Y ) = ¬(X ∨ Y ). X Y ¬(X ∨ Y ) 0 0 1 0 1 0 1 0 0 1 1 0
With the provided code, conduct experiments on AND, OR, and XOR. Note that in the bp.cc code, learning rate α is a named eta, just in case you want to take a look inside the code.
Experiments:
$ ./bp conf/xor.conf | grep ERR > dump.txt
timex ./bp conf/xor.conf
Report the number of epochs and time spent for each trial in the README file. How many number of hidden units was the best in your opinion and why?
The due date is 12/4/2008, 11:59pm. Grading criteria will be similar to the previous programming assignments. You must submit the following: