Download Laboratory Sessions – neural network demos and exercises

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

IEEE 1355 wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Network tap wikipedia , lookup

Airborne Networking wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Transcript
Csci2412 Labwork
Laboratory Sessions – neural network demos.
Lab 3
Learning outcomes
You will have seen demonstrations of the common transfer functions.
You will have seen a network learn to recognise patterns.
You will have created a multilayer feed forward neural net using the toolbox.
Navigate from the start menu to the matlab program or double click the Matlab icon to
get Matlab up and running.
Open the Neural network toolbox and click on the demos icon.
We will look at each of the following demos in turn. Do not spend very much time on
demos 1 and 2 – if necessary you can come back to these in your own time after the lab.
1 Neurons/simple neuron
This demo shows the effect of changing the parameters on some of the standard
transfer functions. You need to know what purelin, hardlim, hardlims, tansig,
logsig look like.
2 Neurons/neuron with vector input
On this demo try to gauge the significance of the weights on the input edges to the
neuron. Set w(1,2) to a small number and then see what effect altering input 2 has
on the output, then change w(1,2) to 2 and see if changing input 2 has more effect.
The effect may change with the different transfer functions.
3 Backpropagation/generalizarion
Start with difficulty index = 1 and one neuron. Increase the number of neurons
one at a time until the network learns the function. Then repeat the process for
each of the other difficulties in turn. What can we conclude about the effect of
increasing the number of neurons? Is increasing the number of neurons always a
good idea? [Make sure you try difficulty index 1 with 9 neurons before you
answer this.]
Page 1
Csci2412 Labwork
Creating a feed-forward network
Load the data in data.txt into a matrix called data (you will need the load command).
data=load('data.txt');
Our input patterns are in the first column – get them via
p=data(:,1);
When we feed data into a network the patterns are assumed to be presented as columns –
so transpose p.
p=p';
Then our target is the data in column 3 - pick column 3 out of data.
t1= data(:,3)
Again we need the transpose because we want our targets as columns.
t1=t1'
The input output pairs we want to learn represent the function in the picture we now plot.
plot(p,t1)
Now use the NNTool to import p as inputs, import t1 as targets, then create a network via
create.
Create a feedforward back prop network, input range from p with one output neuron
(layer 2) and 2 neurons in layer 1. Use logsig in layer 1 and purelin in layer 2. Train the
network a few times – initialise the weights after each go. Does it always learn well?
Now create a second network with an extra couple of neurons in layer 1. Does this
network seem to work better?
If you want simulate your network on the training data, get the output and compare with
the desired output. [Ask how to do this if you can’t see how to do it on your own].
Portfolio Exercise
Train a network to compute the function in one of the other columns in data.
Page 2