Package: nengo-spa
Implementation of the Semantic Pointer Architecture for NengoTheSemantic Pointer Architectureprovides an
approach to building cognitive models implemented with large-scale spiking
neural networks.Feature highlightsWrite arbitrarily complex expressions with type checking involving neurally
represented and static Semantic Pointers likedot((role* filler + BiasVector) * tag, cmp) >> target. NengoSPA will
take care of implementing the required neural networks.Quickly implement action selection systems based on a biological plausible
model of the basal ganglia and thalamus.Neural representations are optimized for representing Semantic Pointers.Support for using different binding methods with algebras. NengoSPA ships
with implementations of circular convolution (default) and vector-derived
transformation binding (VTB), which is particularly suitable for deep
structures. Different binding operations/algebras can be mixed in a single
model.Seamless integration with non-SPA Nengo models.Project statusAll of the core functionality is implemented and the API is stable.While basic integration with the NengoGUI works, it should be improved in
the future. However, this will not be pursued until major improvements to
NengoGUI are released.InstallationNengoSPA depends onNengo 2.7+, and we recommend
that you install Nengo before installing NengoSPA.To install NengoSPA:pip install nengo-spaNengoSPA is tested to work on Python 3.6+.If you need support for Python 2.7 or 3.4, NengoSPA 0.6.2 is the last version
with support for these earlier Python versions.DocumentationThe documentation can be foundhere.Getting HelpQuestions relating to Nengo and NengoSPA, whether it’s use or it’s
development, should be asked on the Nengo forum athttps://forum.nengo.ai.Release History2.0.0 (November 16, 2023)ChangedMade NengoSPA available under the GPLv2 license.
(#295)1.3.0 (November 30, 2021)AddedSupport for (fractional) binding powers and the notion of signs in algebras
and forSemanticPointerinstances.
(#271,#286)EquallySpacedPositiveUnitaryHrrVectorsandVectorsWithPropertiesvector generators.
(#284,#285)Example of how to use learning connections betweenStatemodules.
(#16,#288)RemovedPython 3.5 support was removed.
(#273,#274)FixedScalar arrays likenp.array(1)will now be treated as scalars as intended.
(#289)1.2.0 (November 15, 2020)AddedTransposed Vector-derived Transformation Binding (TVTB) algebra which has
essentially the same properties as the existing VTB algebra, but has two-sided
identities and inverses (opposed to VTB where these are right-sided only).
The only difference in the math is that TVTB transposes the matrix used in the
binding operation.
(#266)Differentiation between left, right, and two-sided special elements (identity,
zero, absorbing element, inverse) of an algebra.
(#265)Addedlinvandrinvmethods toSemanticPointerfor the left and
right inverse, respectively.
(#265)Add support for thenormalizedandunitarymethods on Semantic Pointer
symbols.
(#265)ChangedCreating special elements (identity, zero, absorbing element, inverse) of theVtbAlgebrawithoutsidednessargument has been deprecated because
these are only right-sided special element. Add thesidedness=ElementSidedness.RIGHTargument to update your code.
(#265)The~operator has been deprecated for theVtbAlgebra. Use therinv()method instead.
(#265)Improved automatic names forSemanticPointerthat only contain parenthesis
where actually needed. In addition, syntax is considered when shortening a
name exceeding the maximum length.
(#255,#270)1.1.1 (November 3, 2020)FixedPointerSymbolprecedence handling has been fixed. For example,(sym.A + sym.B) * sym.Cwill be evaluated correctly now.
(#267,#268)1.1.0 (June 23, 2020)AddedSupport division with constant scalars.
(#249,#253,#257)ChangedMakeAbstractAlgebraan actual abstract base class (usingABCMetaas
meta-class). While still supported, this deprecates pure duck-typing for
algebras.
(#240)Raise an exception when a Semantic Pointer is added to a vocabulary with a
differing algebra.
(#239,#240)All examples now have seeds to ensure that occasional “bad seeds” do not create
problems in the documentation.
(#248)FixedSemanticPointer.translateandPointerSymbol.translatenow use thekeysargument; previously, this argument was mistakenly ignored.
(#248)Fixed an issue where the names of iteratively generated semantic pointers
could grow exponentially in length, by truncating them at 1 KB.
(#244,#246)Allow NumPy scalars in place of Python scalars for binary operations onSemanticPointerinstances.
(#250,#257)The SPA sequence example was not working properly due to a missing connection.
(#258,#259)1.0.1 (December 14, 2019)ChangedAdd redirects from old URLs to documentation.
(#237,#238)1.0.0 (December 12, 2019)ChangedEnsure compatibility with Nengo 3.
(#225,#233,#236)Modules and networks no longer set a default label. This will give
more useful labels by default in Nengo GUI (assuming the latest dev
version).
(#234,#235)All networks have been converted to classes. This will give
more useful labels by default in Nengo GUI (assuming the latest dev
version).
(#234,#235)RemovedDropped support for Python 2.7 and 3.4.
(#233,#236)0.6.2 (June 21, 2019)AddedAdd previously missing documentation on thevector_generationmodule as
well as thereinterpretandtranslatemethods ofSemanticPointer.
(#228,#229)FixedFixed a bug where an exception within anActionSelectionblock would
lead to every subsequentActionSelectionblock to raise an exception.
(#230,#231)Nengo SPA is now compatible with pytest 4. Support for earlier versions has
been dropped.
(#227)0.6.1 (April 26, 2019)ChangedMinor documentation improvements.
(#217,#218)0.6.0 (September 17, 2018)AddedSupport for algebras that allow to use binding operations other than circular
convolution. This includes an implementation of vector-derived transformation
binding (VTB) and thenengo_spa.networks.VTBnetwork to perform this
particular binding operation.
(#69,#198)Added generators for vectors with different properties that can be used to
define how vectors are created in a vocabulary (e.g., axis-aligned,
orthogonal, unitary).
(#201,#129)Added a matrix multiplication networknengo_spa.networks.MatrixMultbased
on the nengo-extras implementation.
(#198)Allow to connect to the utility node returned byifmaxwith the SPA>>operator.
(#190,#194)The Semantic Pointer namesAbsorbingElement,Identity, andZeronow
have a special meaning inVocabularyandnengo_spa.symand will return
the respective special Semantic Pointers.
(#195,#176)SemanticPointerinstance can now track names for improved labeling in Nengo
GUI.
(#202,#184)Label the utility nodes for the action selection.
(#202)ChangedA number of module names have been changed for better naming consistency.
In particular,nengo_spa.actionstonengo_spa.action_selection,nengo_spa.pointertonengo_spa.semantic_pointer,nengo_spa.vocabtonengo_spa.vocabulary,andnengo_spa.modules.assoc_memtonengo_spa.modules.associative_memory.(#199,#205)Require themappingargument for associative memories. In addition to
dictionaries and the string'by-key', a sequence of strings can be passed
in to create an auto-associative memory.
(#177)Changed therngargument forVocabularytopointer_gen.
(#201)Renamedinput_aandinput_bof thenengo_spa.Bindmodule toinput_leftandinput_rightto account for non-commutative binding
methods where the order of operands matters. Also, renamed theinvert_aandinvert_barguments tounbind_leftandunbind_rightto reflect
that some binding methods might not have inverse vectors, but might still be
able to do unbinding.
(#69,#198)Renamed thenengo_spa.Stateparameterrepresent_identitytorepresent_cc_identityto reflect that it only optimizes for the circular
convolution identity, but not the identity for other binding operations.
(#212)RemovedRemovednengo_spa.networks.circularconvolution.circconvbecausenengo_spa.algebras.CircularConvolutionAlgebraprovides the same
functionality.
(#198)TheSemanticPointerclass does no longer accept a single integer as
dimensionality to create a random vector. Use the new generators innengo_spa.vector_generationinstead.
(#201)FixedRaise an exception instead of returning incorrect results fromprob_cleanup. Also, fix the function’s incorrect documentation.
(#203,#206)Fixnengo_spa.ActionSelection.keys()when no named actions have been
provided.
(#210)Do not create an unnecessary compare network when computing a dot product
with aSemanticPointerinstance.
(#202)HandleSemanticPointerinstances correctly as first argument tonengo_spa.dot.
(#202)0.5.2 (July 6, 2018)FixedSPA modules will use the same default vocabularies even if not instantiated
in the context of aspa.Network.
(#174,#185)Disallow Python keywords, including None, True, and False, as well as unicode
characters from Python names.
(#188,#187)Allow action rules without name to have no effects.
(#189,#191)Raise exception when using NumPy arrays in SPA operations which would give
unexpected results.
(#192,#193)0.5.1 (June 7, 2018)AddedTranscodenow supportsSemanticPointerandPointerSymboloutput types.
(#175,#178)FixedAllow integer values for vocabularies in associative memories.
(#171)Implementreinterpretoperator for pointer symbols.
(#169,#179)0.5.0 (June 1, 2018)AddedOne-dimensional outputs of Nengo objects can be used as scalars in action
rules.
(#139,#157)Syntactic sugar for complex symbolic expressions:nengo_spa.sym('A+ B * C').
(#138,#159)Include the achieved similarity in warning issued when desired maximum
similarity could not be obtained.
(#117,#158)Possibility to name Vocabulary instances for debugging.
(#163,#165)ChangedMake the error message for incompatible types more informative.
(#131,#1600.4.1 (May 18, 2018)This release fixes problems with the online documentation. Local installs are
not affected.0.4.0 (May 17, 2018)This release increases the minimum required Nengo version to Nengo 2.7
(previously Nengo 2.4).AddedAdded documentation and build tools for the documentation.
(#68)ChangedThis release introduces a new syntax for SPA action rules.
(#114)RemoveUnnecessaryvocabargument fromTranscode.
(#68)FixedValidation ofVocabOrDimParamandVocabularyMapParam.
(#95,#98)Allow the configuration of instance parameters withnengo_spa.Network.config.
(#112,#113)Fix an undeclared input to theIAAssocMemmodule.
(#118,#120)0.3.2 (November 17, 2017)AddedAddall_bgsandall_thalsmethods toAstAccessorto enable easy access to these objects.
(#61,#28)FixedAllow thespa.Actionsstring to be empty.
(#107,#109)Thepasskeyword can now be used to create blocks in action rules that
do not have any effect.
(#101,#103)Allow comments at various places in actions rules.
(#102,#104)0.3.1 (November 7, 2017)ChangedClearer error message as aSpaTypeErrorsomething is used as input/output
in an action rule without being declared as such.
(#82,#89)FixedAllow leading comments in actions rules.
(#81,#85)Gave the basal ganglia a default label.
(#84,#88)Fixed warning produce by thecreate_inhibit_nodefunction.
(#90)Prevent whitespace from being completely removed in action rules.
(#92,#93)Have theintercept_widthargument ofIAactually take effect.
(#94,#97)0.3.0 (October 16, 2017)AddedAddadd_outputandadd_neuron_outputmethods toIdentityEnsembleArrayto provide the full API that is provided by the
regular NengoEnsembleArray.
(#61,#28)Addcreate_inhibit_nodefunction to create nodes that inhibit complete
Nengo networks.
(#65,#26)Add asolverargument to the action rule’stranslateto use a solver
instead of an outer product to obtain the transformation matrix which can
give slightly better results.
(#62,#57)ChangedActions rules do not require module to be assigned to the model any longer.
They will access exactly the same variables as are available in the
surrounding Python code. This means that existing action rules need to be
changed to reference the correct names.
(#63)The action rule syntax changed significantly.
(#54,#72)Actions will be build automatically without an explicit call tobuild().
(#59,#45,#55)Consolidated the functionality ofEncodeandDecodeintoTranscode.
(#67,#58)FixedFix some operations changing the dimensionality of semantic pointers with an
odd initial dimensionality.
(#52,#53)When building actions the basal ganglia and thalamus will only be created
when actually required.
(#60,#42)The vocabulary translate mechanism will properly ignore missing keys in the
target vocabulary whenpopulate=False.
(#62,#56)Allow empty string as argument toVocabulary.populate.
(#73)0.2 (June 22, 2017)AddedTutorial explaining what has changed in nengo_spa compared to the legacy SPA
implementation.
(#46)Examples can be extracted withpython-mnengo_spaextract-examples<destination>.
(#49,#7)ChangedReplacedinput_keysandoutput_keysarguments of associative memories
with a singlemappingargument.
(#29,#8)Replacedampa_configandgaba_configparameters of theBasalGangliawithampa_synapseandgaba_synapseparameters.
Removed thegeneral_configparameter.
(#30,#23)FixedImproved a number of error messages.
(#35,#32,#34)Improved accuracy by fixing choice of evaluation point and intercept
distributions.
(#39)Correctly apply transforms on first vector in vocabularies on on non-strict
vocabularies.
(#43)0.1.1 (May 19, 2017)FixedUpdated the 0.1 changelog.0.1 (May 19, 2017)Initial release of Nengo SPA with core functionality, but excludingupdates and completion the documentation,proper integration with Nengo GUI.The API is still conisdered unstable in some parts of it are likely to change
in the future.Main features compared to the SPA implementation shipped with Nengo are:neural representations have been optimized for higher accuracy,support for arbitrarily complex action rules,SPA networks can be used as normal Nengo networks,and SPA networks can be nested.