diff --git a/src/htm/algorithms/SpatialPooler.cpp b/src/htm/algorithms/SpatialPooler.cpp index afbedc2d0f..d4f6b308c9 100644 --- a/src/htm/algorithms/SpatialPooler.cpp +++ b/src/htm/algorithms/SpatialPooler.cpp @@ -472,14 +472,9 @@ void SpatialPooler::compute(const SDR &input, const bool learn, SDR &active) { auto &activeVector = active.getSparse(); //boosting -// boostStrength_ = 0.0; boostOverlaps_(overlaps_, boostedOverlaps_); //inhibition - //update inhibition radius if it's time, only changes in local inh - if(!globalInhibition_ and isUpdateRound_()) { - inhibitionRadius_ = updateInhibitionRadius_(); - } inhibitColumns_(boostedOverlaps_, activeVector); // Notify the active SDR that its internal data vector has changed. Always @@ -845,6 +840,13 @@ void SpatialPooler::calculateOverlap_(const SDR &input, void SpatialPooler::inhibitColumns_(const vector &overlaps, vector &activeColumns) const { + + //update inhibition radius if it's time, only changes in local inh + if(!globalInhibition_ and isUpdateRound_()) { + inhibitionRadius_ = updateInhibitionRadius_(); + } + + //compute density (desired output SDR sparsity) Real density = localAreaDensity_; if (numActiveColumnsPerInhArea_ > 0) { UInt inhibitionArea =