numenta / nupic-legacy

Numenta Platform for Intelligent Computing is an implementation of Hierarchical Temporal Memory (HTM), a theory of intelligence based strictly on the neuroscience of the neocortex.
http://numenta.org/
GNU Affero General Public License v3.0
6.33k stars 1.56k forks source link

Optimization to spatial_pooler.py initialization. Fixes #1385 #3816

Closed ctrl-z-9000-times closed 6 years ago

ctrl-z-9000-times commented 6 years ago

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 also complains that the SP.init is slow. Issue #1385 is about using dense arrays to represent potential synapses, which were then being iterated over by the function _initPermanence. Instead of fixing issue #1385 I instead made the surrounding code more capable of working with dense arrays.