[Table of Contents]

Take the Headaches out of Neural Networks: A Review of MacBrain

Cyril Latimer,
Department of Psychology,
University of Sydney.
cyril@psych.su.oz.au

Why Neural Networks and Why MacBrain?

Cajoling psychology students into thinking mechanistically about cognition isn't easy. Come to think of it, cajoling academic psychologists into thinking mechanistically about cognition isn't all that easy either! Psychologists, like many others in the social sciences, are often content to live with nebulous verbal accounts of their theories, and questions like, 'OK, exactly how is your theory going to work? ' or, 'Can you show me the design of a machine that will do the cognitive task in the manner prescribed by your theory ?", are rarely asked. Computer simulation and artificial neural net works were supposed to change all that. They didn't. Well, let's be honest - how many psychologists can program computers well enough to construct a neural net or run a simulation? The answer is, "not very many at all". Oh yes, we use computers - for word processing, graphics, statistics.

Teaching engineering and computer science students about artificial neural networks is different. They, unlike most psychology students, already have the necessary mathematical background and can program efficiently, More often than not, students actually take psychology courses to avoid such topics. They will tolerate formulae on the blackboard in their statistics courses (just), but don't try it in a course on cognition. When you turn around, half the class will have gone off to enrol in Fine Arts or (worse) Social Psychology, and the other half will be staring at the formulae in horror like stunned mullet. I myself, in 1970, can well remember my fellow postgrads having to frogmarch me through Minsky and Papert's "Perceptrons". They horsewhipped me through Minsky's "Computation: Finite and Infinite Machines", and, just as I was getting the hang of it, neural networks "went into recession". Nonetheless, while in the 70s and early 80s the candle of connectionism guttered throughout the world, we kept it trimmed at Sydney University by teaching psychology students how to construct effective procedures in networks made out of Pitts-McCulloch neurons. It wasn't easy with just a blackboard and an overhead projector, but psychology students tend to be visual thinkers, and we appealed to their childhood lego-construction skills with great effect. I must admit that, a visual thinker myself, I have dozed through many a derivation of the backpropagation algorithm, dreaming about and yearning for replicas of Minsky's soldered-up, Heath-Robinson machine incorporating those clutches out of a B29 or Frank Rosenblatt's tangles of plug boards and leads.

Then came the Macintosh (the visual machine par excellence), and, one day as I browsed those stunning visuals in Macworld (Does anyone ever really read the words?), I saw what appeared to be a Macintosh window containing a neural network. For a moment, I thought, "Not another review of MacFlow", but no, it was a neural network with coloured neurons in layers and connections, and as I gazed at it in disbelief, (thinking that I might actually have to read this page), I knew that, with MacBrain, the age of electronic lego had arrived and that teaching neural networks to psychology students would never be the same.

The MacBrain tool palette and network construction window with a simple 30 x 5 x 3 backpropagation net for character recognition. The level of fill in the "thermometer" style units indicates the level of activation.

MacBrain, 3.0 by Neurix, is a neural-network simulator that takes full advantage of the Macintosh graphics interface. It comes in two versions, one for Macs with a maths coprocessor and one for those without. I have run the program on a Mac Plus and a Powerbook l00 and while it is slow on these machines, it does run. Additionally, the maths coprocessor version will run on a PowerMac with SoftFPU (John Neil Associates) installed. On faster machines it flies along quite nicely, and within a one hour tutorial, I have had psychology students constructing and training their own rudimentary networks all without even the hint of a mathematical expression Now some may disagree with this approach arguing that without teaching a sound mathematical basis for neural networks, we really are playing lego. I disagree strongly. The first step in teaching anything, let alone neural networks, is to get across basic concepts, and MacBrain is a truly excellent medium for this method. Using a large window and a tool palette with tools for creating, joining, clamping and activating the processing units together with menu commands for cycling and learning, students quickly pick up the essentials of a mechanistic approach to cognitive capacities such as recognition, classification, memory etc. Having engendered interest and a sound grasp of basic concepts, I have found that it is, more often than not, the students themselves who want to explore the underlying mathematics of learning rules and activation functions, and, in such a climate, it is a fairly simple task to work through the mathematical essentials. This way of teaching is, of course, not new, and was developed in the late 60s and early 70s by none other than Seymour Papert himself. Did he foresee his methods being used to disseminate such heresy ?

The unit editing box with parameters whose values can be set individually for each unit or by group from the "Group" menu.

MacBrain Basics

But what of MacBrain itself? It is possible, using the unit creation tool, to create a processing unit by simply clicking once in the construction window. Each further click produces another unit until the usual Macintosh pointer-selection tool is again chosen. By double clicking a unit, one opens a large window of default values of parameters for that particular unit including: name; group (input, hidden, output etc); activation level, minimum, maximum and resting activation; threshold; decay rate, and update frequency. There is choice within a large range of activation functions for the unit (sigmoid, linear threshold, boolean threshold, etc) and one can also define additional activation functions.

The unit edit box showing the range of activation functions available for individual or groups of units. User-defined activation functions can be programmed in the macro language or called in as external resources.

The default style processing unit is a small rectangular "thermometer" which displays its activation value like the mercury level in a real thermometer. This style of unit also changes colour from red to signal rising activation, blue for falling and green for stable activation. Thus, it is possible to tell at a glance the state of activation in units and groups of units. The unit edit box allows the size and style of a unit to be changed from the default thermometer to an oval, rectangle, blip or Hinton diagram etc.

Unit styles that can be chosen from the unit edit box.

Connecting units could not be simpler. Click within the sending unit, and, while holding the mouse button down, drag a connection to another unit and release the mouse button. A dialogue box appears requesting the value of the weight for the connection and whether the connection is just one-way or symmetrical. Modulation (gating) weights which allow control of the connection between two units by the activation of a third unit can also be set. Units can be toggled on and off by the toggle tool and, with activations of chosen units set, simple interactive-activation networks can be cycled for however many cycles from a pulldown menu. The same menu allows a network to "relax" or cycle until a stable condition is reached. Constructing simple networks in this way can be instructive and fun for the beginner, but MacBrain provides powerful tools for development of more complex and elaborate architectures. For example, it is possible, using a pulldown menu, to: set up a matrix of units; if necessary, specify its connectivity; nominate its group (input, hidden, output); determine the range of weights on connections within the matrix or between the matrix and other groups of units. Additionally, a pulldown menu item permits construction of a complete backpropagation network with the necessary learning rules and activation functions etc already set. The user only has to specify, in successive dialogue boxes, the number of layers and number of units per layer - inputs, hiddens and outputs.

Network Training with Macros

A network can be trained by setting a learning rule and activation functions, number of training cycles, training patterns, etc, from pulldown menus. However, for networks and problems of any size, such methods prove tedious. To avoid this tedium, the MacBrain programmers have provided a most ingenious object-oriented macro language. After opening a macro window, it is possible, simply using the mouse, to drag from a programmer's palette, nodes which, when connected, form the elements of a program that cycles and trains a network. Nodes include the standard repeat loop - one simply specifies beginning and end parameters. There are nodes to: paste training patterns onto the input array; apply learning rules; cycle the network; draw graphs; test conditions of the network (if X then do Y etc); read input files; output values to text files; read, write and set weights and activations. The so-called "maths" nodes allow a range of predefined functions to be included in the macros, and, as always, one can define additional functions. Make no mistake. This is true object oriented programming; one does not need know a programming language, and can simply connect preprogrammed nodes and specify their parameters in presented dialogue boxes. Files of training patterns can be created on screen by toggling on and off input units and desired output values with the toggle tool and then, using a menu item, patterns 'can be stored in RAM. Alternatively, files of training patterns can be created off-line in any text editor and read into RAM. A macro can then be employed to read the patterns in a random or fixed order, clamp them onto the input units, cycle the network and apply the chosen learning rule until learning is complete. Learning can be tested by unclamping the output units, pasting the training or test patterns one by one from RAM, and by cycling the network once and observing whether the output values are indeed those desired for each input pattern.

The macro window with programmers' tool palette and a simple macro for training.

Range of Options

In addition to its range of activation functions, MacBrain has a wide range of learning rules including several Backprops, Hebbian, Temporal Hebbian, Kohonen, Competitive and Neighbourhood. As with the activation functions, it is possible, using the macro facility, to create user-defined learning rules. Options are too numerous to cover in detail here, but they include: online two and three-dimensional graphing of weights, activations error etc, the ability to train in the background under multifinder or System 7; pasting of pictures from the clipboard onto an input array; spraying a Gaussian of activation onto the input array; and putting the contents of the clipboard into a file.

MacBrain's suite of learning rules. User-defined learning rules can be programmed in the macro language or called in as external resources.

Extending MacBrain

The icing on the cake is undoubtedly MacBrain's open-endedness. If there is some facility the program lacks and cannot be created in the macro language (recurrent networks are an example) it is possible to program them in C or PASCAL and simply add them as resources (XCMDs and XFCNs). Indeed, MacBrain comes with a library of external procedures (BrainTools) for immediate use. The MacBrain package also includes HyperBrain - a Hypercard stack with preprogrammed applications such as a character recognizor and the travelling salesman problem. The beauty of these extensions is that the nice graphics interface of MacBrain can be maintained. A recent add-in module is the genetic algorithm Optivolve which must be purchased separately.

The Manual, Help and Technical Assistance

The spiralbound manual is good. It covers a majority of things you need to know, with tutorials on how to set up networks and construct macros, training files, etc. Examples of networks such as the XOR, Hopfield and interactive-activation are provided on disk, and there are chapters on extending MacBrain by using external resources, although you will need to be able to program and know your way around - gulp - "Inside Macintosh". MacBrain Help is a Hypercard stack which can be opened from within the application. It, like the manual, provides references to papers which discuss and explain the various learning rules, activation functions and architectures. Technical assistance is only a phone call or fax away, and Contact Person, the charming Jennifer Greenwood, has never failed to call me back or arrange technical help.

The Downside

MacBrain 3. 0 fixed a lot of the bugs in earlier versions, but inevitably, in a large and complex program, things can go wrong. Some are only minor irritations, but others can have serious implications. The Save menu command is quirky to say the least. One can 'Save" a network, and, on returning to the finder, discover it is "not there". It actually is there, but, for some reason, MacBrain has saved it as an invisible file. This can be rectified by getting into ResEdit, getting up the "Get Info" box for the file and unchecking the "Invisible" box. This is not good! The very thought of a psychology student's mouse pointer hovering over the ResEdit icon is enough to chill the blood of any tutor. The fix is never to use the ''Save" command, but rather to use the "Save as" command with different names for your network each time Network 1, Network 2 etc. This way, MacBrain creates a new visible file each time and one can discard the early versions on return to the finder. A macro, once created, will only work for the saved values of its variables. It is not possible to load a saved macro and then change its variables. Try to do this and you are left contemplating the smiling Macintosh icon as your Mac reboots after a system crash. This is particularly not good if you have forgotten to 'Save as" your network before the crash. The trick is to create your macros anew for each network it doesn't take long. Graphing is also quirky; sometimes it works and sometimes it doesn't. I and my postgraduate students have yet to fathom the reasons. Occasionally, a network just will not learn, and MacBrain, for all its sophistication, lacks the analysis tools to find out exactly why. And so it is; a classy program marred by a few bugs. Sub-Editor Kate Stevens and I used to regard MacBrain as this beautiful person one tries to date. Eventually one succeeds only to find that the object of one's desires has a bad case of halitosis.

Conclusions

Despite the bad breath, I am sold on MacBrain and can honestly say that I have never, not even for a moment, regretted buying it. For me, MacBrain is more than just a neural network simulator - it holds the potential for application of a different philosophy of teaching, and it always has been and still is, ahead of its time. In a difficult area, it is a brave, bold, beautiful exploitation of the Macintosh interface. I don't know if Steve Jobs has seen it, but, if he did, he would surely love it as I do; programs like MacBrain are what the Macintosh is about. You will find nothing like it in the world of DOS; Microsoft, even with its billions in resources, has never produced a program like this, if only because Microsoft is hobbled by the need to produce Macintosh applications that also run in its clunky DOS/Windows environment. When you compare the simple, innovative, flow-diagram implementation of the macro concept in MacBrain with its command-line, sometimes arcane, application in Excel, you will appreciate what I mean.

For some years now, I have been able to walk into a packed lecture theatre (400-500 psychology students) with a little Mac SE, and a Kodak DataShow overhead-projection pad. Having connected up and started MacBrain, I can set up a simple network for character recognition, create a file of training patterns, construct a macro for training and testing the network, and, while I am doing so, the Mac screen and all its contents are thrown up on the large theatre screen. Invariably, one could hear a pin drop throughout the demonstration. After the lecture, there is the inevitable group of inquiring students wanting to know more about "how it works", asking to "have a try", and arguing about the delta rule. This is the Mac and this is MacBrain; Bill Gates eat your heart out. To get the very best of teaching out of MacBrain, one should purchase a site licence from Neurix so that the program can be run on any number of Macs at a time. Then, with a colour overhead projection pad connected to the tutor's machine, the students would be able to construct their own networks under visual instruction in the program's use. Like others working in connectionism, I will continue to write my own simulation programs and I will continue to use other simulators. However, when I have to teach, explain a point or run a quick simulation, I will reach for MacBrain every time and you will too.

Pricing and Availability

MacBrain is marketed by Neurix, 327 A St., Sixth Floor, Boston, Mass. 02210. Phone: 617. 577. 1202 Fax: 617. 577. 1264. Contact Name: Jennifer Greenwood. It currently retails for US $1494. 00 and can be purchased by academic and non-profit organisations for US $1495. Site Licences are negotiated on an individual basis. Optivolve, an add-in genetic algorithm, retails at US $495, and, with an educational discount, at US $395. Finally, I would be more than happy to provide further information on MacBrain to any reader by email, fax or phone.

This review first appeared in Macademia, Autumn 1994. Macademia is a publication of the University of Queensland Macintosh Users Group.