numenta / htmpapers

Numenta published papers code and data
GNU Affero General Public License v3.0
318 stars 88 forks source link

Missing property on sp in HTM SP paper #17

Closed rhyolight closed 5 years ago

rhyolight commented 5 years ago

See original report on HTM forum. I was able to replicate the error below:

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 "/Users/mtaylor/nta/htmresearch/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'

This looks like inappropriate intimacy code smell. The sp instance is a SWiG wrapper, and it has no _localAreaDensity property. May need to add a const accessor in the cpp bindings? cc @rcrowder