Frequently Asked Questions

Contact

If you have a question that is not answered below, please contact any of the following people:

Chris Eliasmith (celiasmith at uwaterloo dot ca)
Terry Stewart (tcstewar@uwaterloo.ca)
Bryan Tripp (bptripp at gmail dot com)

New Users

Q: What should I do first?

A: Install it and go through some tutorials

  1. Download Nengo
  2. Unzip it and run it (run nengo on Mac OS X or Linux, run nengo.bat on Windows
  3. Follow these tutorials

Python Scripting

Q: How do I import a Java or Python library?

A: Two options. You can do it this way:

import ca.nengo.utils

but then when you use the library, you will have to provide its full name:

y=ca.nengo.utils.DataUtils.filter(x,0.005)

The other option is to import this way:

from ca.nengo.utils import *

This allows you to just do:

y=DataUtils.filter(x,0.005)

Q: How do can I specify a particular set of encoding vectors?

A: You need to create your own VectorGenerator that will be used to set the encoding vectors for an ensemble. The simplest example is as follows, where we manually specify two four-dimensional encoding vectors:

from ca.nengo.model import *
from ca.nengo.model.impl import *
from ca.nengo.model.nef.impl import *
from ca.nengo.util import *

network=NetworkImpl()
network.name="Encoding"
world.add(network)


class FixedVectorGenerator(VectorGenerator):
    def genVectors(self,number,dimensions):
        return [[1.0,0.5,0,-0.5],[0.5,0,-0.5,1.0]]
 
ef=NEFEnsembleFactoryImpl()
ef.encoderFactory=FixedVectorGenerator()


a=ef.make("a",200,4)
network.addNode(a)

You can, of course, put any code you want inside the genVectors function. One thing that may be useful is to allow it to return many copies of those vectors, to handle situations where there are more neurons than vectors. This could be done as follows:

class FixedVectorGenerator(VectorGenerator):
    def genVectors(self,number,dimensions):
        base=[[1.0,0.5,0,-0.5],[0.5,0,-0.5,1.0]]
       
        vectors=[]
        while len(vectors)<number:
            vectors.extend(base)
   
        return vectors