Sets

When simulating a neural network it is frequently necessary to apply a pattern of values to a set of units. It is inconvenient to have to set the value of each unit separately each time you would like to apply a pattern. The set tool allows you to create sets of objects and a set of patterns that are to-be-applied to those objects. To create a set, select the objects you wish to be in the set (typically these are units although other objects can be included also). Then select the set object in the Object Menu, position the mouse cursor on the workspace where you wish the set to appear and click. The set will appear in the workspace labelled "Pattern Set[No Pats]". The set is empty because you haven't added any patterns to it yet. The units in a set change colour to match the colour of the set, so that it is easy to identify which units go with which set. It is possible to include the same unit in multiple sets. When this happens, the unit is wrapped with multiple colours to indicate its membership in multiple sets.

To add a pattern to a set, specify the values of the objects in the set (by changing activation or weight paraemters), and select add pattern from the set's parameter menu. The label for the new pattern will appear under the set(s) to which it has been added. The default pattern labels and set names can be edited from the parameter menu.

To select a pattern from a set, click on the label of the pattern which you wish to select. The label will change colour (indicating that it is the currently selected pattern) and the pattern will be applied to its associated objects. The number following the set label indicates the number (starting with one) of the currently selected pattern.

To delete a pattern from a set, select the pattern you wish to delete and select the Delete Pattern option from the parameter menu. The current pattern in each of the selected sets will be deleted.

The Swap Patterns option allows you to rearrange the order of patterns in a set. This is especially useful when there is a correspondence between patterns at each position in different sets, such as the pairing of input and outputs.

Exercise 8: Create a set containing the three letter units of the word network. Add patterns for C, CA, and CAT by toggling the appropriate letter units. Your network should now look like Figure 7. Apply the CAT pattern and cycle the network. How many cycles does it take before the activation of the word unit is less than zero?

Figure 7: Adding a Set to the word Network.

Buttons and Cycling your Network

Buttons encapsulate a variety of functions from randomizing weight values, to cycling the network to analysizing network output. There are many different sorts of buttons but they all work in the same way. To create them you select the button type from the Object Menu and then click on the workspace. To activate the button you click on it and to change any of its parameters you right click on it in the same fashion as any other object.

Figure 8: Adding the Cycle and Zero Units buttons.

Exercise 9: Create Cycle and Zero Units buttons. Create a value from the Cycle button that displays the Total Number of Cycles that have been executed (see Figure 8).

Before running a neural network, it is often a good idea to reset the network so that all of the unit activations become zero. The behaviour of a neural network is often sensitive to small differences in activation levels, so it is best to know what the activations of your units are before applying an input pattern. Setting all the unit activations to zero is one way of doing this. To run (or cycle) the network, you click on the cycle button. The number of cycles that will be executed is a paraemter of the button.

Exercise 10: Reset the network to zero the activations of all of the units. Toggle the activation of the C unit to 1.0. Cycle the word network for ten iterations. What happens to the activation of the word unit?

Graphs

Another way to track the value of a unit (weight, value, or set) is to use a graph. To create a graph, select the graph object from the Object Menu, select the object that you want to graph, and click where you want the graph to appear. Graphs can be resized by selecting the graph, clicking down on the bottom right corner and then dragging. When the graph is at the desired size, release the mouse button.

Using the parameter menu the the minimum and maximum value of the y-axis, and whether or not the graph is frozen can be changed. Each graph plots the value of the selected object (along the y-axis) as a function of the number of cycles (along the x-axis). The minimum and maximum parameters determine the range of values that are plotted.

Cycling a network automatically updates the unfrozen graphs. When a graph is frozen, it turns pink and its values become fixed. Freezing a graph is useful when you want to compare graphs from two different runs of the network.

Exercise 11: Create a graph for the word unit and change the minimum activation value that is plotted to -0.2. Reset the network, apply the C pattern, and cycle. At approximately what value does the word unit peak? When does the activation of the word unit fall below zero? Freeze the graph and repeat this exercise for the CA, and CAT patterns, comparing the graphs of the word unit for each pattern (see Figure 9).

Figure 9: Adding Graphs to the word Network.





Saving your Network

To save your network select the "Save As" option from the File menu. A dialog box will appear allowing you to specify where you would like the network saved and what its name should be. It is a good idea to decide on a naming convention for your network files and stick to it, such as having all network files end with .net. Note that when running BrainWave through Netscape or Internet Explorer, the save option may not be available for security reasons.

To load a network you or someone else saved, you need to use the Open or Open URL commands in the File menu. To load a network from disk, select the Open option from the File menu. A dialog will appear allowing you to select the file to load. To load a network from a URL, select instead the Open URL option from the File menu. A dialog will appear for you to type in the URL of the file you wish to load.

For example, type in http://www.connectionist.net/chapters/Introduction/JetsAndSharks.net to load the Jets and Sharks network from the previous chapter.

Printing

To print a network, use the Export to Postscript in the File menu to save a postscript file. Printing this file requires using a method appropriate for your platform. On unix machines this involves the lpr command:

lpr MyNetwork.ps

Select the Landscape item from the Options menu to make the Export to Postscript option save in landscape mode rather than portrait. Select the EPS item in the Options menu to produce an encapsulated postscript file which can be imported into other packages.

References

McClelland, J. L. (1981). Retrieving general and specific information from stored knowledge of specifics. Proceedings of the Third Annual Meeting of the Cognitive Science Society, 170-172.