Homework #11
Spring 2011
Neural Engineering
Prof. Wheeler
Neural Network Pattern Recognition
. This exercise is a logical continuation of the pattern recognition
done in HW 10.
You will execute both a Matlab version of the neural net and one written for this class
which you can examine and edit for your own use and understanding.
The files needed are:
hw11data.mat
norminpt
chngoutp.m
nnsetup.m
nntrain.m
nnpredct.m
nnpick.m
confused.m
cluster.m
.
The data are all in
hw11data.mat
:
The training data are the principal component projection values (two
per action potential waveform) and are in a data set called
trane
(should be
train
, but apparently
train
is a keyword).
The test data are similar, but taken from the second half of the spike waveforms, and are
in a file called
test.
The target (correct class) data are stored in
trainid
and
testid
, which have the same
information as
ident.dat
.
If you get stuck, intermediate values have been stored in
hw11soln.mat
:
trainin
%normalized training data
testin
% normalized test data
trainidm
% reformatted training class id data
testidm
% reformatted test class id data
eta, beta, tol, itermax
%default parameters for class neural net
R, Q, S1, S2
% sizes for Matlab neural net functions
disp_freq,max_epoch, err_goal, lr, momentum, err_ratio, TP
% default parameters for Matlab NN fct.
Between HW10 and HW11, the row/column nature of the data matrices had to be changed for
compatibility with the Matlab neural network functions.
In HW11, the data
trane
and
test
are 2x41
element matrices, as compared to the 82x2 element matrix
pcfeat
from which they are taken.
(If we
were to use the data from
spikes.dat
(82x35), the new
trane
and
test
would be 35x41 element matrices.)
Hopefully there are sufficient notes to keep you from too many mistakes with the dimensioning of the
data.
Neural net data need to be normalized:
this will be done later by a custom function named
norminpt.m
.
It is also necessary to change the format so that, where each row of
trainid
(41*1) has a single integer
(e.g.
3
), a new variable matrix,
trainidm
(4*41) has a four element column vector of which one element
is 1 (e.g.
0 0 1 0
represents class #3).
The number
4
is the number of different classes possible.
Backpropagation Algorithm
The algorithm is standard backpropagation.
x
i
is the ith input. y
j
is the
jth hidden layer output. z
k
is the
kth output.
The forward propagation equations are:
y
j
=
!
w
"