Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

fix iter bug #1453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/nupic/algorithms/SDRClassifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ vector<Real64> SDRClassifier::calculateError_(const vector<UInt> &bucketIdxList,

void SDRClassifier::softmax_(vector<Real64>::iterator begin,
vector<Real64>::iterator end) {
vector<Real64>::iterator maxItr = max_element(begin, end);
Real64 maxValue = *max_element(begin, end);
for (auto itr = begin; itr != end; ++itr) {
*itr -= *maxItr;
*itr -= maxValue;
}
range_exp(1.0, begin, end);
Real64 sum = accumulate(begin, end, 0.0);
Expand Down