Skip to content

Commit 9e24912

Browse files
committed
Merge branch 'master_community' into log_boosting_fn
2 parents bf0c9ec + e35be37 commit 9e24912

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/examples/hotgym/HelloSPTP.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ Real64 BenchmarkHotgym::run(UInt EPOCHS, bool useSPlocal, bool useSPglobal, bool
192192

193193
if(EPOCHS == 5000) { //these hand-written values are only valid for EPOCHS = 5000 (default), but not for debug and custom runs.
194194
NTA_CHECK(input == goldEnc) << "Deterministic output of Encoder failed!\n" << input << "should be:\n" << goldEnc;
195-
NTA_CHECK(outSPglobal == goldSP) << "Deterministic output of SP (g) failed!\n" << outSP << "should be:\n" << goldSP;
196-
NTA_CHECK(outSPlocal == goldSPlocal) << "Deterministic output of SP (l) failed!\n" << outSPlocal << "should be:\n" << goldSPlocal;
197-
NTA_CHECK(outTM == goldTM) << "Deterministic output of TM failed!\n" << outTM << "should be:\n" << goldTM;
195+
if(useSPglobal) { NTA_CHECK(outSPglobal == goldSP) << "Deterministic output of SP (g) failed!\n" << outSP << "should be:\n" << goldSP; }
196+
if(useSPlocal) { NTA_CHECK(outSPlocal == goldSPlocal) << "Deterministic output of SP (l) failed!\n" << outSPlocal << "should be:\n" << goldSPlocal; }
197+
if(useTM) { NTA_CHECK(outTM == goldTM) << "Deterministic output of TM failed!\n" << outTM << "should be:\n" << goldTM; }
198198
NTA_CHECK(static_cast<UInt>(an *10000.0f) == static_cast<UInt>(goldAn *10000.0f)) //compare to 4 decimal places
199199
<< "Deterministic output of Anomaly failed! " << an << "should be: " << goldAn;
200200
NTA_CHECK(avgAnom10.getCurrentAvg() <= 0.8f) << "Deterministic average anom score failed:" << avgAnom10.getCurrentAvg();

src/htm/algorithms/Connections.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define NTA_CONNECTIONS_HPP
2424

2525
#include <map>
26+
#include <unordered_map>
2627
#include <set>
2728
#include <utility>
2829
#include <vector>
@@ -630,8 +631,8 @@ class Connections : public Serializable
630631
Permanence connectedThreshold_; //TODO make const
631632

632633
// Extra bookkeeping for faster computing of segment activity.
633-
std::map<CellIdx, std::vector<Synapse>> potentialSynapsesForPresynapticCell_; //TODO use unordered_map
634-
std::map<CellIdx, std::vector<Synapse>> connectedSynapsesForPresynapticCell_;
634+
std::unordered_map<CellIdx, std::vector<Synapse>> potentialSynapsesForPresynapticCell_;
635+
std::unordered_map<CellIdx, std::vector<Synapse>> connectedSynapsesForPresynapticCell_;
635636
std::map<CellIdx, std::vector<Segment>> potentialSegmentsForPresynapticCell_;
636637
std::map<CellIdx, std::vector<Segment>> connectedSegmentsForPresynapticCell_;
637638

src/htm/algorithms/TemporalMemory.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,10 @@ void TemporalMemory::activateCells(const SDR &activeColumns, const bool learn) {
438438
columnActiveSegmentsBegin, columnActiveSegmentsEnd,
439439
columnMatchingSegmentsBegin, columnMatchingSegmentsEnd;
440440

441-
std::tie(column, activeColumnsBegin, activeColumnsEnd, columnActiveSegmentsBegin,
442-
columnActiveSegmentsEnd, columnMatchingSegmentsBegin, columnMatchingSegmentsEnd
441+
std::tie(column,
442+
activeColumnsBegin, activeColumnsEnd,
443+
columnActiveSegmentsBegin, columnActiveSegmentsEnd,
444+
columnMatchingSegmentsBegin, columnMatchingSegmentsEnd
443445
) = columnData;
444446

445447
const bool isActiveColumn = activeColumnsBegin != activeColumnsEnd;

0 commit comments

Comments
 (0)