Skip to content

Commit

Permalink
Refactor of ApicalTiebreakSequenceMemory to make semantics of code
Browse files Browse the repository at this point in the history
clearer.
  • Loading branch information
fcr committed Apr 28, 2021
1 parent 73ad638 commit d372154
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py/htm/advanced/algorithms/apical_tiebreak_temporal_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,8 @@ def compute(self,

apicalInputSDR = SDR(self.apicalInputSize)

basalInputSDR = SDR(self.basalInputSize)
basalInputSDR.sparse = self.activeCells
activeCellsSDR = SDR(self.columnCount * self.cellsPerColumn)
activeCellsSDR.sparse = self.activeCells

if apicalGrowthCandidates is None:
apicalGrowthCandidates = apicalInput
Expand All @@ -1084,11 +1084,11 @@ def compute(self,
self.prevPredictedCells = self.predictedCells

apicalInputSDR.sparse = self.prevApicalInput
self.activateCells(activeColumns, basalInputSDR, apicalInputSDR, self.winnerCells, self.prevApicalGrowthCandidates, learn)
self.activateCells(activeColumns, activeCellsSDR, apicalInputSDR, self.winnerCells, self.prevApicalGrowthCandidates, learn)

apicalInputSDR.sparse = apicalInput
basalInputSDR.sparse = self.activeCells
self.depolarizeCells(basalInputSDR, apicalInputSDR, learn)
activeCellsSDR.sparse = self.activeCells
self.depolarizeCells(activeCellsSDR, apicalInputSDR, learn)

self.prevApicalInput = apicalInput.copy()
self.prevApicalGrowthCandidates = apicalGrowthCandidates.copy()
Expand Down

0 comments on commit d372154

Please sign in to comment.