I am looking at using the topology feature of NuPIC to analyze 2D inputs with non-global inhibition and non-global receptive fields (potential pool I think is the NuPIC term?). To this end I am trying to run the code for the 2016 Frotiers paper “The HTM Spatial Pooler - A Neocortical…”
Both the 1D and 2D examples give me errors (different ones). 1D case looks like an object property name was changed or something. The second looks like the input dimensionality isn’t handled correctly. Below are the two commands and excerpts from the output. Note that I also had to make a small change to the 2D script import function to find the parameters file.
Any help would be appreciated. Thanks!
$python train_sp.py -d 'randomBarPairs' . . . [lots of parameter outputs, and finishing =the first training epoch] . . . Mean number of active columns: 20.0 Traceback (most recent call last): File "train_sp.py", line 640, in <module> metrics, expName = runSPexperiments(expConfig) File "train_sp.py", line 553, in runSPexperiments reconstructionError(sp, testInputs, activeColumnsCurrentEpoch)) File "C:\Python27\lib\site-packages\htmresearch\frameworks\sp_paper\sp_metrics.py", line 836, in reconstructionError numActiveColumns = int(sp._localAreaDensity * sp._numColumns) + 0.0 AttributeError: 'SpatialPooler' object has no attribute '_localAreaDensity'
$ python train_sp_topology_simple.py -d 'randomBarPairs' . . . [lots of parameter output] . . . training SP epoch 0 ERR: Expecting 1D array but got 2D array [C:/projects/nupic-core/src/nupic/py_support/NumpyVector.hpp line 406] Traceback (most recent call last): File "train_sp_topology_simple.py", line 150, in <module> sp.compute(inputVector, True, outputColumns) File "C:\Python27\lib\site-packages\nupic\bindings\algorithms.py", line 2873, in compute return _algorithms.SpatialPooler_compute(self, *args) RuntimeError: Expecting 1D array but got 2D array