Jan 2026
KanervaSDM PyPI Package
Screenshot of the KanervaSDM package page on the PyPI (Python Package Index) website.
Previously I developed Python and C++ code as part of a variety of experiments Sparse Distributed Memory (SDM)¹, a computational model of human memory, found here.
In an effort to make SDM easier to use for myself and more accessible to others, I created a Python package and published it to PyPI, the Python Package Index.
The core of the package is an optimized C++ implementation of SDM based on my previous Python code. Using C++ code allows SDM functionality to be approximately six times faster than it is when implemented using pure Python code. The C++ header file is connected to Python using a bindings file written in C++ using the pybind11 library.
¹ Sparse Distributed Memory was introduced by Pentti Kanerva in 1988. My work is based on his 1992 technical report “Sparse Distributed Memory and Related Models”.
Screenshot of example usage.
Screenshot of the bindings file (bindings.cpp), showing how the C++ SDM implementation is bound to methods and attributes in Python.