Note
This documentation is for a development version. Click here for the latest stable release (v1.2.0).
nengo_spa.vector_generation¶
Generators to create vectors with specific properties.
Classes
Generator for axis aligned vectors. 


Generator for uniformly distributed unitlength vectors. 

Generator for unitary vectors (given some binding method). 

Generator for random orthonormal vectors. 

Generator for vectors with expected unitlength. 

nengo_spa.vector_generation.
AxisAlignedVectors
(d)[source]¶ Generator for axis aligned vectors.
Can yield at most d vectors.
Note that while axisaligned vectors can be useful for debugging, they will not work well with most binding methods for Semantic Pointers.
 Parameters
d (int) – Dimensionality of returned vectors.
Examples
>>> for p in nengo_spa.vector_generation.AxisAlignedVectors(4): ... print(p) [1. 0. 0. 0.] [0. 1. 0. 0.] [0. 0. 1. 0.] [0. 0. 0. 1.]

class
nengo_spa.vector_generation.
UnitLengthVectors
(d, rng=None)[source]¶ Bases:
object
Generator for uniformly distributed unitlength vectors.
 Parameters
d (int) – Dimensionality of returned vectors.
rng (numpy.random.RandomState, optional) – The random number generator to use to create new vectors.

class
nengo_spa.vector_generation.
UnitaryVectors
(d, algebra, rng=None)[source]¶ Bases:
object
Generator for unitary vectors (given some binding method).
 Parameters
d (int) – Dimensionality of returned vectors.
algebra (AbstractAlgebra) – Algebra that defines what vectors are unitary.
rng (numpy.random.RandomState, optional) – The random number generator to use to create new vectors.

class
nengo_spa.vector_generation.
OrthonormalVectors
(d, rng=None)[source]¶ Bases:
object
Generator for random orthonormal vectors.
 Parameters
d (int) – Dimensionality of returned vectors.
rng (numpy.random.RandomState, optional) – The random number generator to use to create new vectors.

class
nengo_spa.vector_generation.
ExpectedUnitLengthVectors
(d, rng=None)[source]¶ Bases:
object
Generator for vectors with expected unitlength.
The vectors will be uniformly distributed with an expected norm of 1, but each specific pointer may have a length different than 1. Specifically each vector component will be normal distributed with mean 0 and standard deviation \(1/\sqrt{d}\).
 Parameters
d (int) – Dimensionality of returned vectors.
rng (numpy.random.RandomState, optional) – The random number generator to use to create new vectors.