@@ -365,12 +365,22 @@ const vector<Real> &SpatialPooler::getBoostedOverlaps() const {
365365}
366366
367367void SpatialPooler::initialize (
368- const vector<UInt> inputDimensions, const vector<UInt> columnDimensions,
369- UInt potentialRadius, Real potentialPct, bool globalInhibition,
368+ const vector<UInt>& inputDimensions,
369+ const vector<UInt>& columnDimensions,
370+ UInt potentialRadius,
371+ Real potentialPct,
372+ bool globalInhibition,
370373 Real localAreaDensity,
371- UInt stimulusThreshold, Real synPermInactiveDec, Real synPermActiveInc,
372- Real synPermConnected, Real minPctOverlapDutyCycles, UInt dutyCyclePeriod,
373- Real boostStrength, Int seed, UInt spVerbosity, bool wrapAround) {
374+ UInt stimulusThreshold,
375+ Real synPermInactiveDec,
376+ Real synPermActiveInc,
377+ Real synPermConnected,
378+ Real minPctOverlapDutyCycles,
379+ UInt dutyCyclePeriod,
380+ Real boostStrength,
381+ Int seed,
382+ UInt spVerbosity,
383+ bool wrapAround) {
374384
375385 numInputs_ = 1u ;
376386 inputDimensions_.clear ();
@@ -583,7 +593,7 @@ void SpatialPooler::updateInhibitionRadius_() {
583593
584594void SpatialPooler::updateMinDutyCycles_ () {
585595 if (globalInhibition_ ||
586- inhibitionRadius_ >
596+ inhibitionRadius_ >=
587597 *max_element (columnDimensions_.begin (), columnDimensions_.end ())) {
588598 updateMinDutyCyclesGlobal_ ();
589599 } else {
@@ -869,7 +879,8 @@ void SpatialPooler::inhibitColumnsLocal_(const vector<Real> &overlaps,
869879
870880
871881 if (wrapAround_) {
872- for (auto neighbor: WrappingNeighborhood (column, inhibitionRadius_,columnDimensions_)) {
882+ for (auto neighbor: WrappingNeighborhood (column, inhibitionRadius_,columnDimensions_)) { // TODO if we don't change inh radius (changes only every isUpdateRound()),
883+ // then these values can be cached -> faster local inh
873884 if (neighbor == column) {
874885 continue ;
875886 }
0 commit comments