Skip to content

Commit 23af855

Browse files
committed
review
1 parent 2b21175 commit 23af855

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/htm/algorithms/SpatialPooler.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,8 @@ void SpatialPooler::updateDutyCyclesHelper_(vector<Real> &dutyCycles,
744744

745745

746746
void SpatialPooler::updateBoostFactors_() {
747-
if(boostStrength_ < htm::Epsilon) return; //skip for disabled boosting
748-
if (globalInhibition_) {
747+
if(boostStrength_ == SpatialPooler::BOOSTING_DISABLED) return;
748+
else if (globalInhibition_) {
749749
updateBoostFactorsGlobal_();
750750
} else {
751751
updateBoostFactorsLocal_();
@@ -759,13 +759,11 @@ void applyBoosting_(const UInt i,
759759
const Real boost,
760760
vector<Real>& output) {
761761

762-
if(boost == SpatialPooler::BOOSTING_DISABLED) { //boosting disabled, skip
763-
return;
764-
} else if(boost == SpatialPooler::BOOSTING_LOG) {
762+
if(boost == SpatialPooler::BOOSTING_LOG) { //logarithmic boosting
765763
output[i] = log2(actualDensity[i]) / log2(targetDensity);
766-
} else { //exponential boost
764+
} else if(boost > 0) { //exponential boost
767765
output[i] = exp((targetDensity - actualDensity[i]) * boost);
768-
}
766+
} //else: BOOSTING_DISABLED
769767
}
770768

771769

0 commit comments

Comments
 (0)