Closed ctrl-z-9000-times closed 6 years ago
@ctrl-z-9000-times This repo is currently in maintenance mode and we are now accepting new features or enhancements. (All our engineers are currently doing research.) We use the C++ Spatial Pooler when we need speed. The python SP is really there for easy prototyping and readability.
You might find that the community fork will accept your contributions, however.
I rewrote some of the SpatialPooler's initialization code to run faster by using Numpy instead of python "for" loops.
This is related to issue #1385 which complains that the SP.init is slow. Issue #1385 is about using dense arrays to represent the potential synapses for each column. The dense boolean arrays are iterated over by the function _initPermanence. Issue #1385 calls for replacing these dense boolean arrays with a sparse array of indices. Instead of directly fixing issue #1385 I instead made the surrounding code more capable of working with dense arrays. This is accomplished primarily through the use of the function numpy.nonzero which converts the dense boolean arrays into sparse index arrays.