CECN1 Generec
From Computational Cognitive Neuroscience Wiki
GeneRec (Generalized Recirculation) Learning
- The project file: generec.proj (click and Save As to download, then open in Emergent)
- CECN1 Generec screenshots -- for PowerPoint presentations, etc.
Back to CECN1 Projects. See also CECN1 Pattern Associator
Project Documentation
(note: this is a literal copy from the simulation documentation -- it contains links that will not work within the wiki)
- GENERAL USAGE NOTE: To start, it is usually a good idea to do
Object/Edit Dialogin the menu just above this text, which will open this documentation in a separate window that you can more easily come back to. Alternatively, you can just always return to this document by clicking on theProjectDocstab at the top of the middle panel.
Now, let's put some of this theory to work and see how GeneRec does on some small-scale task learning problems. We will use the same problems used in the pattern associator case, but we add an extra hidden layer of units between the inputs and outputs. This should in theory enable the network to solve the "impossible" task from before.
This project is identical to the pattern associator one, with one major and one minor exception. The major exception is that we have introduced a hidden layer of 3 units. Note that there are only feedforward connections from the input to this hidden layer, because the input is clamped in both minus and plus phases and so would not be affected by feedback connections anyway, but that there are bidirectional connections between the hidden and output layers, as required by the GeneRec algorithm. The minor exception is that we have increased the learning rate from .01 to .05 so that it takes less time to solve the "impossible" problem. Let's start by giving the network the hardest problem. By default, the learn_rule value is set to GENEREC, and env_type is IMPOSSIBLE.
- Click on
Init("Yes" to "Initialize Network Weights?") and thenRunin the master .PanelTab.ControlPanel.
As in the pattern associator project, the .T3Tab.EpochOutputGraph displays the SSE error measure over epochs of training. (You may have to hit the Refresh button in the top right corner of the corresponding tab in the (middle) panel. The .T3Tab.TrialOutputGrid is now updated only after every epoch of training, and it also shows the states of the 3 hidden units.
Also as before, the training of the network stops automatically after it gets the entire training set correct 5 epochs in a row. Note that this 5 correct repetitions criterion filters out the occasional spurious solutions that can happen due to the somewhat noisy behavior of the network during learning, as evidenced by the jagged shape of the learning curve. The reason for this noisy behavior is that a relatively small change in the weight can lead to large overall changes in the network's behavior due to the bidirectional activation dynamics, which produces a range of different responses to the input patterns.
This sensitivity of the network is a property of all attractor networks (i.e., networks having bidirectional connectivity), but is not typical of feedforward networks. Thus, a feedforward backpropagation network learning this same task will have a smooth, monotonically decreasing learning curve. Some people have criticized the nature of learning in attractor networks because they do not share the smoothness of backpropagation. However, we find the benefits of bidirectional connectivity and attractor dynamics to far outweigh the aesthetics of the learning curve. Furthermore, larger networks exhibit smoother learning, because they have more "mass" and are thus less sensitive to small weight changes.
- Press
Initand thenRunseveral times to get a sense of how fast the network learns in general.
Question 5.4 Provide a general characterization of how many epochs it took for your network to learn (e.g., slowest, fastest, rough average).
- Press
TestStep4 times in the master .PanelTab.ControlPanel to refresh the .T3Tab.TrialOutputGrid after learning is done.
Question 5.5 (a) Explain what the hidden units represent to enable the network to solve this "impossible" task (make specific reference to this problem, but describe the general nature of the hidden unit contributions across multiple runs). (b) Use the weight values as revealed in the network display (including the bias weights) to explain why each hidden unit is activated as it is. Be sure to do multiple runs, and extract the general nature of the network's solution. Your answer should just discuss qualitative weight values, e.g., "one hidden unit detects the left two inputs being active, and sends a strong weight to the right output unit." (c) Extrapolating from this specific example, explain in more general terms why hidden units can let networks solve difficult problems that could not otherwise be solved directly.
Just to confirm that merely adding hidden units and increasing the learning rate does not enable the network to solve this problem, let's try running this network with Hebbian learning.
- Set the
learn_ruletoHEBB(i.e., CPCA) in the master .PanelTab.ControlPanel and clickApplyand thenSelectLearnRule. Note that clickingSelectLearnRulechanges the relevantLearning Parametersvalues as described in the last project. Then doInitandRuna couple times. You will probably want to watch training in the .T3Tab.EpochOutputGraph
You should observe complete failure. However, Hebbian learning can work quite well with hidden units in simple tasks.
- To see this, set
env_typetoEASY, andApply. Now doInitandRunseveral times.
The network should generally learn within a couple of epochs (with 5 more added at the end to make sure) -- sometimes it does fail to learn, because it is not sensitive to error and can get stuck in a bad solution state due to its purely correlational nature.
- Now, set the
learn_ruleback toGENERECon thisEASYtask, andInit/Runseveral times.
Question 5.6 How fast does GeneRec learn this EASY task compared to the Hebbian rule? Be sure to run several times in both, to get a good sample.
This last exercise should leave an important impression on you -- sometimes Hebbian learning can be faster and more reliable than error-driven learning (even if not 100% reliable). The reasons for this speedup will be explored in greater depth later, but clearly it interacts with the nature of the task. We will see that in fact a combination of both types of learning usually works best.
- To continue on to the next simulation, close this project first by selecting
File->Close Project. It's probably better to not save upon closing so you can sure the exercises will work when reopened. Or, if you wish to stop now, quit by then selectingFile->Quitin the.viewers[0](root) window.
