xtlearn tutorial for Unix at CSE
Here are instructions for accessing and for basic use of
xtlearn
from CSE Unix workstations.
- Log in on a pc.i86.linux machine (or start a remote shell on one):
You may need to change directory to a location of your
choice where you can create files (e.g. configuration, data and teach
files for xtlearn
.)
- Copy the tutorial files to your chosen directory, by doing the Unix
command:
cp /home/cs9444/public/assigns/xtlearntute/xor.* .
Don't forget that trailing full stop!
- Run the command
/home/cs9444/bin/xtlearn
.
This should bring up a rectangular xtlearn
window.
- From the File menu, choose Set Project.
- Type
xor
into the text box and click OK.
- Dismiss the warning box that says "Unable to open the project file".
- Choose Network Architecture from the Displays menu.
- Uncheck the Slabs check box. Slabs can be a better way to
look at large and complex neural nets, but the xor net has only
five neurons, so no slabs is better. Play with the other check
boxes and the "Orient" radio buttons to see what they do.
- Choose Training Options... from the Train menu.
- This brings up a dialog window. Change the training sweeps from
the default value to, say, 25000 sweeps. Change the learning
rate from 0.1 (suitable for simple recurrent networks) to a
less conservative 0.5. Click on the More... button to
see some extra options, then eventually click OK.
- Choose Error display from the Displays menu.
You will see an (initially empty) graph of error against
number of sweeps.
- Choose Train the network from the Train menu.
Watch the error display. Assuming that the error drops to a
nice low value (less than about 0.05) you can probably assume
that the network has learned successfully. You should probably
choose Train the network a couple more times, to see
some different error curves that correspond to different sets of
random initial weights.
- To test that the network has successfully learned, first
choose Testing Options... from the Test menu.
None of these options should need changing on this occasion,
but if you wanted to use testing data that is different from the
training data, you could click beside Novel data and
type in the name of an alternative source of test data.
Click OK.
- Choose Verify network has learned from the Test
menu. This will bring up a window labelled "xtlearn Testing Output"
that lists the output values in the same order as the inputs
appear in the .data file. In this case (xor) there is a single
output unit, so you see a single column of numbers. The numbers will
not be exactly 1 or 0, but should be close to one of these values.
To see if they are (approximately) correct, you need to compare
them to the numbers in
xor.teach
. cat
this file (or view it in a text editor). The first two lines
distributed
and 4
tell you the data
format and the number of training patterns. The remaining 4 lines
are the ones you need to compare to the Testing Output values.
- If the network does not seem to train correctly, go back to the
Train menu and select Resume training. This will
continue training the network for as many sweeps as you
initially specified in the Training options... dialog
window. Alternatively, e.g. if you want to train for lots more
sweeps, you can go back to the Training options... dialog
window, and change the Training sweeps to a large value.
- To leave
xtlearn
, choose Quit
from the File menu. :-)
- You should now have some more files in your current working
directory. As well as the three files that you started with:
xor.cf
,
xor.data
and
xor.teach
,
you will have
xor.prj
,
which is binary and so not fun to read, and various
xor.nnn.wts
,
where nnn is a number. These give the weights at various stages
when they were saved for you by xtlearn
. They are
readable. Their format is described in the
tlearn
reference manual.
- What about the
.err
file that you will have to hand
in with the simple recurrent nets assignment? Get back into
xtlearn
, open up xor
as before, and
then get into the Training options... dialog window.
Check the "Log error every xxx sweeps" box, and type a number
into the text (well, number) box. What number? How many numbers
do you want? Maybe once every epoch is reasonable (but you may
want to experiment - try once per sweep, once every 10 epochs,
depending on how many epochs you train for). As there are 4
training patterns, once per epoch means logging error every
4 sweeps. Click OK, train the network, quit, and presto!
you have an xor.err
file. It's readable, and can
easily get rather big ... Bear in mind that the assignment marker
will not be amused if you hand in a megabyte of error log.
- Use of the Connection weights display slows
xtlearn
down massively. Use with caution.
Good luck!