numenta / nupic.core-legacy

Implementation of core NuPIC algorithms in C++ (under construction)
http://numenta.org
GNU Affero General Public License v3.0
272 stars 276 forks source link

Move segment/synapse cleanup out of Connections #1327

Closed mrcslws closed 7 years ago

mrcslws commented 7 years ago

Fixes #986

This change removes maxSegmentsPerCell and maxSynapsesPerSegment parameters from the Connections class, and adds their logic to the TemporalMemory. In this new code I fixed the synapse destroy bug mentioned in the issue above.

This change is ~performance neutral. If anything, it's slightly faster.

I've wanted to make this change for a long time. Code that enforces segment/synapse limits is algorithm code, not data structure code. There's no obvious right way to do it, and different algorithms should choose whether/how to handle it explicitly.

mrcslws commented 7 years ago

This will require changes to htmresearch-core and nupic. I'll make sure I have both of those changes ready before merging this.