Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpatialPooler: inhibitColumnsGlobal() does unneeded reverse sort on returned list #3386

Open
cogmission opened this issue Oct 14, 2016 · 1 comment

Comments

@cogmission
Copy link
Contributor

cogmission commented Oct 14, 2016

I think this is a hold-over from before the stimulusThreshold enforcement, that never got reconsidered?

The list returned is the list of active columns (in sparse form), and is used in 2 downstream methods:

  1. _adaptSynapses
  2. _updateDutyCycles

...in the first method, the sparse list of columns is only used as indexes to iterate over; and in the second, the sparse list is used to create a dense list whose indexes indicated by the sparse list are made 1's.

return sortedWinnerIndices[start:][::-1]

Argument: I'm thinking there is no reason to sort the list in reverse order? Even if there is some "magical" underlying C++ method which does it quickly, it's still a useless operation and results in cognitive dissonance for the reader?

@rhyolight
Copy link
Member

@numenta/nupic-committers Please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants