Skip to content

Commit

Permalink
TMRegion: remove the hack for NTA_DEBUG
Browse files Browse the repository at this point in the history
which is superfulous and should not inverfere with the logic of the
region
  • Loading branch information
breznak committed Nov 2, 2019
1 parent 34f9b6f commit 4560ce7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bindings/py/tests/regions/network_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def testBuiltInRegions(self):
"""
import htm
net = engine.Network()
net.setLogLevel(htm.bindings.engine_internal.LogLevel.Verbose) # Verbose shows data inputs and outputs while executing.
#net.setLogLevel(htm.bindings.engine_internal.LogLevel.Verbose) # Verbose shows data inputs and outputs while executing.

encoder = net.addRegion("encoder", "ScalarSensor", "{n: 6, w: 2}");
sp = net.addRegion("sp", "SPRegion", "{columnCount: 200}");
Expand Down
10 changes: 5 additions & 5 deletions src/htm/regions/TMRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void TMRegion::compute() {
out = getOutput("bottomUpOut");
//set NTA_LOG_LEVEL = htm::LogLevel::LogLevel_Verbose
//to output the NTA_DEBUG statements below
if (out && (out->hasOutgoingLinks() || NTA_LOG_LEVEL == LogLevel::LogLevel_Verbose)) {
if (out && out->hasOutgoingLinks() ) {
SDR& sdr = out->getData().getSDR();
tm_->getActiveCells(sdr); //active cells
if (args_.orColumnOutputs) { //output as columns
Expand All @@ -241,24 +241,24 @@ void TMRegion::compute() {
NTA_DEBUG << "bottomUpOut " << *out << std::endl;
}
out = getOutput("activeCells");
if (out && (out->hasOutgoingLinks() || NTA_LOG_LEVEL == LogLevel::LogLevel_Verbose)) {
if (out && out->hasOutgoingLinks() ) {
tm_->getActiveCells(out->getData().getSDR());
NTA_DEBUG << "active " << *out << std::endl;
}
out = getOutput("predictedActiveCells");
if (out && (out->hasOutgoingLinks() || NTA_LOG_LEVEL == LogLevel::LogLevel_Verbose)) {
if (out && out->hasOutgoingLinks() ) {
tm_->activateDendrites();
tm_->getWinnerCells(out->getData().getSDR());
NTA_DEBUG << "winners " << *out << std::endl;
}
out = getOutput("anomaly");
if (out && (out->hasOutgoingLinks() || NTA_LOG_LEVEL == LogLevel::LogLevel_Verbose)) {
if (out && out->hasOutgoingLinks() ) {
Real32* buffer = reinterpret_cast<Real32*>(out->getData().getBuffer());
buffer[0] = tm_->anomaly;
NTA_DEBUG << "anomaly " << *out << std::endl;
}
out = getOutput("predictiveCells");
if (out && (out->hasOutgoingLinks() || NTA_LOG_LEVEL == LogLevel::LogLevel_Verbose)) {
if (out && out->hasOutgoingLinks() ) {
out->getData().getSDR() = tm_->getPredictiveCells();
NTA_DEBUG << "predictive " << *out << std::endl;
}
Expand Down

0 comments on commit 4560ce7

Please sign in to comment.