Connections between ensembles are built using Origins and Terminations. The Origin from one ensemble can be connected to the Termination on the next ensemble
Create two ensembles. They can have different neural properties and different numbers of neurons, but for now make sure they are both one-dimensional.
Drag the Termination icon from the sidebar onto the second ensemble
- Provide a name (for example, input)
- Set the input dimension to 1 and use Set Weights to set the connection weight to 1
- Set tauPSC to 0.01 (this synaptic time constant differs according to which neurotransmitter is involved. 10ms is the time constant for AMPA (5-10ms).
The text shows the various components of your model, and the arrows indicate the synaptic connections between them.
- You can move the components by left-click dragging them, and you can move all the components by dragging the background.
- You can hide a component by right-clicking on it and selecting “hide”
- To show a hidden component, right click on the background and select the component by name
The bottom of the window shows the controls for running the simulation.
- The simulation can be started and stopped by pressing the Play or Pause button at the bottom right. Doing this right now will run the simulation, but no data will be displayed since we don’t have any graphs open yet!
- The reset button on the far left clears all the data from the simulation and puts it back to the beginning.
- In the middle is a slider that shows the current time in the simulation. Once a simulation has been run, we can slide this back and forth to observe data from different times in the simulation.
Right-clicking on a component also allows us to select a type of data to show about that component.
- Right-click on A and select “value”. This creates a graph that shows the value being represented by the neuron in ensemble A. You can move the graph by left-click dragging it, and you can resize it by dragging near the corners or using a mouse scroll wheel.
- Press the Play button at the bottom-right or the window and confirm that this group of neurons successfully represents its input value, which we previously set to be 0.5.
So far, we have just been graphing information about neural ensemble A. We have shown that these 100 neurons can accurately represent a value that is directly input to them.
For this to be useful for constructing cognitive models, we need to also show that the spiking output from this group of neurons can be used to transfer this information from one neural group to another.
- In other words, we want to show that B can represent the same thing as A, where B’s only input is the neural firing from group A. For this to happen, the correct synaptic connection weights between A and B (as per the Neural Engineering Framework) must be calculated.
- Nengo automatically calculates these weights whenever an origin is created.
We can see that this communication is successful by creating graphs for ensemble B.
- Do this by right-clicking on B and selecting “value”, and then right-clicking on B again and selecting “voltage grid”.
- To aid in identifying which graph goes with which ensemble, right click on a graph and select “label”.
- Graphs can be moved (by dragging) and resized (by dragging near the edges and corners or by the mouse scroll wheel) as desired.
For example, two 1-dimensional values can be combined into a single two-dimensional ensemble. This would be done with two terminations: one with a transformation (or coupling) matrix of [1 0] and the other with [0 1]. If the two inputs are called a and b, this will result in the following calculation:
- a*[1 0] + b*[0 1] = [a 0] + [0 b] = [a b]
- This will be useful for creating non-linear transformations, as discussed further in the next section.
There are additional ways to view 2D representations in the interactive plots, including:
- Plotting the activity of the neurons along their preferred direction vectors
- Plotting the 2D decoded value of the representation
Along with the ability to construct models using this point-and-click interface, Nengo also provides a Python scripting language interface for model creation. These examples can be seen in the “demo” directory.
To create the communication channel through the scripting interface, click on the Folder icon (top left), navigate to the /demo directory (inside the Nengo home folder) and open “communication.py”
The actual code for this can be seen by opening the communication.py file in a text editor:
import nef net=nef.Network('Communications Channel') input=net.make_input('input',[0.5]) A=net.make('A',100,1) B=net.make('B',100,1) net.connect(input,A) net.connect(A,B) net.add_to(world)
The following demo scripts create models similar to those seen in this part of the tutorial:
- demo/singleneuron.py shows what happens with an ensemble with only a single neuron on it (poor representation)
- demo/twoneurons.py shows two neurons working together to represent
- demo/manyneurons.py shows a standard ensemble of 100 neurons representing a value
- demo/communication.py shows a communication channel
- demo/addition.py shows adding two numbers
- demo/2drepresentation.py shows 100 neurons representing a 2-D vector
- demo/combining.py shows two separate values being combined into a 2-D vector