Research Article

A New Hierarchical Temporal Memory Algorithm Based on Activation Intensity

Algorithm 1

Temporal memory learning algorithm based on activation intensity.
Input: active columns at time t, activation intensity vector at t and t − 1 ,
(1) for each column colj in HTM //first phase: cell activation
(2)  if colj is active then //predictive cells at t − 1 on active column will become active cell at t
(3)   for each cell cei on colj
(4)    if cei has activeSegments(t − 1)
(5)     activeCells(t) ← cei
(6)     learningSegments(t) = activeSegments(t − 1)
(7) else //if active column has no predict cells at t − 1, all cells become active cells at t
(8)  activeCells(t) ← ceii ∈ (1,…, nce)
(9)  learningSegments(t) = bestMatchingSegment(colj)
(10) for each segment d in learningSegments(t) //second phase: cell synapse updating
(11)  for each synapse s on d
(12)   if s.presynapticCell in activeCells (t − 1) and//reinforcement
(13)    s.permanence+ =   = 
(14)   else //punishment
(15)    s.permanence+ =  = 
(16) for each segment d on all columns//third phase: predictive cell selection
(17)  for each synapse s on d
(18)   if s.presynapticCell in activeCells (t) then
(19)    if s.permanence > θc numActiveConnected++
(20)  if numActiveConnected > θa
(21)   activeSegments(t) ← d
(22)   predictiveCells(t) ← cell(d)