0% found this document useful (0 votes)
12 views4 pages

CLP Tutorial1

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

CLP Tutorial1

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

Connectionist Language Processing — Tutorial #1

Date: Thursday, 25 April 2024 (due 29 April 2024)

Name:

1 Prerequisites
For this course, we will be using mesh, our in-house neural network simulator on the CoLi
server1 . You can find mesh in: /proj/courses/clp/bin/mesh. For a better experience,
however, it is recommended to add the following alias to the .bash_aliases file in your
home directory: alias mesh="rlwrap /proj/courses/clp/bin/mesh", using your favorite
editor (e.g., nano).

Logout and back in, and test whether it worked by starting mesh from your home direc-
tory. This should show you:

$ mesh
Mesh, version 1.2.0: http://hbrouwer.github.io/mesh/
[:>

For future reference, the command ‘help‘ provides help on a variety of topics. For now, just
type ‘quit’ to exit.

2 Activation propagation using paper and pencil


Copy the files in /proj/courses/clp/Tutorial1/ to your home directory. The NetInput.*
files specify the network shown in the figure. Assume a linear activation function on the
output nodes. Given the weights shown in the figure, and the input patterns defined in
NetInput.set, fill out the table below:

I1 I2 O1 O2

1
If you need help getting set up, the commands are provided in Section 5.
Connectionist Language Processing Crocker, Brouwer & Schulz

3 Activation propagation using mesh


We can now verify our solutions using mesh. Load the network by typing:

$ mesh NetInput.mesh
Mesh, version 1.2.0: http://hbrouwer.github.io/mesh/
...
> Loaded file [ NetInput.mesh ]
[NetInput:data>

Next, load the predefined weights using the ‘loadWeights NetInput.weights’ command,
and type ‘showMatrix weights input ouput’ to see the effect. Do the weights match
those in the figure?

You can now propagate the activation using mesh. The command ‘items’ lists all items
in the current example set, and the command ‘testItem’ either takes the number (first col-
umn) or name (second column) of an item as argument. Do the numbers match the ones
you calculated by hand?

Explore the network some further, using the commands ‘groups’ and ‘projections’ (and
if you want even more information, try ‘inspect’). Which group was omitted in the fig-
ure? Study the weights between this group and its recipient. Was it legitimate to omit in
the figure? Finally, type ‘weightStats’. Do these numbers make sense?

4 Training the network


Let us now try to improve the network. Type ‘init‘ to reset the weights, and use ‘weightStats’
to confirm. Now type ‘train’, and study the output. What happens to the error? How many
times has the network been exposed to each example pattern?

Look at the different items. Has the network improved?

Run ‘train’ again. And now? Repeat one more time. And now?
Connectionist Language Processing Crocker, Brouwer & Schulz

5 Appendix: Getting set up on the CoLi servers


1. Logging into the server.

ssh [email protected]

This lands you in your home directory on the server. If you connect to the server
for the first time you may be asked whether you are sure you want to connect to an
unknown host. Answering yes will add CoLi to the list of known servers and connect
you.

2. Logging into jones-6.

ssh jones-6

Logging into jones-6 next will yield additional functionalities not available on the CoLi
login server but helpful for running mesh, such as rlwrap.
Note: Before being able to log into jones-6, you may need to ask your tutor to add
your LST email address to the tutorial group on the server.

3. Adding an alias for mesh.


Aliases are shorthands for other, usually more complex commands. They can be de-
fined in a file called .bash_aliases (note the leading period, indicating that this is a
hidden file!). To edit this file, type

nano .bash_aliases

and add the alias definition given in Section 1 at the end of the file. Save the changes
typing ctrl-O, hit enter on the file name, and exit the file typing ctrl-X. After logging
out and in, typing the shorthand mesh will execute the long command behind the
scenes.

4. Copying and inspecting files and directories.


Files are copied using the cp command with following syntax: cp file copy_of_file.
To copy directories, the -r flag must be added as well. The -v flag sets the option "ver-
bose", meaning that user feedback will be printed.

cp -rv /proj/courses/clp/Tutorial1/ .

The period indicates the directory you are currently in. The command will keep the
source directory name and copy it to your current location. Navigate into your copy
of the directory, inspect the contents, and show the contents of files.
Connectionist Language Processing Crocker, Brouwer & Schulz

cd Tutorial1
ls
cat filename

You might also like