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

Encoders using vector input like CoordinateEncoder do not work anymore #3753

Closed rhyolight closed 6 years ago

rhyolight commented 6 years ago

I found this issue when trying to get https://github.com/numenta/nupic.geospatial running with NuPIC 1.0.

Looks like this is the origin of the bug:

https://github.com/numenta/nupic/commit/34dd874896b22da217c5bede494f910faf6efb99#diff-d62e7e036bc450e0076245d0839b7ef4R381

In this commit, we start using self.predictedField as a condition to get encoder outputs instead of self.predictedFieldIdx. The CoordinateEncoder's predictedFieldIdx is always -1, so it worked before the change. But the CoordinateEncoders' predictedField is not None, it is vector, so the compute function tries to get bucket values from the encoder that do not exist.

We need to add a special condition to the compute function to check also for self.predictedField == "vector".