Combining 1D Representations into a 2D RepresentationΒΆ

Purpose: This demo shows how to construct a network that combines two 1D inputs into a 2D representation.

Comments: This can be thought of as two communication channels projecting to a third population, but instead of combining the input (as in addition), the receiving population represents them as being independent.

Usage: Grab the slider controls and move them up and down to see the effects of increasing or decreasing input. Notice that the output population represents both dimensions of the input independently, as can be seen by the fact that each input slider only changes one dimension in the output.

Output: See the screen capture below

../_images/combining.png
Code:
import nef

net=nef.Network('Combining')  #Create the network object

net.make_input('input A',[0]) #Create a controllable input function 
                              #with a starting value of 0
net.make_input('input B',[0]) #Create another controllable input 
                              #function with a starting value of 0
                              
net.make('A',100,1)  #Make a population with 100 neurons, 1 dimension
net.make('B',100,1)  #Make a population with 100 neurons, 1 dimension 
net.make('C',100,2,
    radius=1.5) #Make a population with 100 neurons, 2 dimensions, and set a
                #larger radius (so 1,1 input still fits within the circle of
                #that radius)
net.connect('input A','A') #Connect all the relevant objects (default connection 
                           #is identity)
net.connect('input B','B')
net.connect('A','C',transform=[1,0]) #Connect with the given 1x2D mapping matrix
net.connect('B','C',transform=[0,1])
net.add_to_nengo()

Nengo User Manual

Table Of Contents

This Page