nupic-legacy
nupic-legacy copied to clipboard
Add a "checkInputs" parameter to TemporalMemory
Here's the current state of things:
- Encoders output a binary array.
- The SpatialPooler outputs a binary array.
- The TemporalMemory receives a list of active column indices.
- Binary arrays and lists of indices are identical types. They're vectors of numbers.
- If you give the TemporalMemory a binary array, it doesn't complain, it just quietly does the wrong thing.
I've been bitten by this before, and so have others. By default, the TemporalMemory should check that the input vector is valid. It should offer a "fast mode" option which disables this check.
Today, a valid TemporalMemory input:
- Contains no duplicates
In the future, a valid TemporalMemory input also might need to be sorted, but that's not required today. (We'd be careful to find a backward-compatible way to do this.) Also, some research code already expects external / apical inputs to be sorted. It will be good for our research productivity to have this runtime check.
Proposal: Let's add a "checkInputs" parameter which enables these checks. It will default to True in the constructor.
I would like to see a 👍 from another @numenta/nupic-committers before approving this concept for work.