@@ -177,15 +177,6 @@ void TMRegion::initialize() {
177177}
178178
179179
180- bool TMRegion::isConnected_ (string name) const {
181- const auto in = getInput (name);
182- const auto out = getOutput (name);
183- const bool hasOutput = (out != nullptr ) and out->hasOutgoingLinks ();
184- const bool hasInput = (in != nullptr ) and in->hasIncomingLinks ();
185- return hasInput or hasOutput;
186- }
187-
188-
189180void TMRegion::compute () {
190181
191182 NTA_ASSERT (tm_) << " TM not initialized" ;
@@ -244,36 +235,30 @@ void TMRegion::compute() {
244235 NTA_LOG_LEVEL = htm::LogLevel::LogLevel_Verbose;
245236 NTA_CHECK (NTA_LOG_LEVEL == LogLevel::LogLevel_Verbose) << " setting Verbose failed, man" ;
246237 // to output the NTA_DEBUG statements below
247- if (isConnected_ (" bottomUpOut" ) ) {
248238 SDR& sdr = out->getData ().getSDR ();
249239 tm_->getActiveCells (sdr); // active cells
250240 if (args_.orColumnOutputs ) { // output as columns
251241 sdr = tm_->cellsToColumns (sdr);
252242 }
253243 NTA_DEBUG << " bottomUpOut " << *out << std::endl;
254- }
244+
255245 out = getOutput (" activeCells" );
256- if (isConnected_ (" activeCells" )) {
257246 tm_->getActiveCells (out->getData ().getSDR ());
258247 NTA_DEBUG << " active " << *out << std::endl;
259- }
248+
260249 out = getOutput (" predictedActiveCells" );
261- if (isConnected_ (" predictedActiveCells" ) ) {
262250 tm_->activateDendrites ();
263251 tm_->getWinnerCells (out->getData ().getSDR ());
264252 NTA_DEBUG << " winners " << *out << std::endl;
265- }
253+
266254 out = getOutput (" anomaly" );
267- if (isConnected_ (" anomaly" ) ) {
268255 Real32* buffer = reinterpret_cast <Real32*>(out->getData ().getBuffer ());
269256 buffer[0 ] = tm_->anomaly ; // only the first field is valid
270257 NTA_DEBUG << " anomaly " << *out << std::endl;
271- }
258+
272259 out = getOutput (" predictiveCells" );
273- if (isConnected_ (" predictiveCells" ) ) {
274260 out->getData ().getSDR () = tm_->getPredictiveCells ();
275261 NTA_DEBUG << " predictive " << *out << std::endl;
276- }
277262}
278263
279264
0 commit comments