I’m really confused on the Temporal Memory pseudocode implementation, specifically the getSegmentActiveSynapses function and how it applies to TM inference in phase 1 from TM BaMI:
if learning_cell_chosen == False:
l,s = getBestMatchingCell(c, t-1)
learnState(c, i, t) = 1
sUpdate = getSegmentActiveSynapses (c, i, s, t-1, true)
segmentUpdateList.add(sUpdate)
getSegmentActiveSynapses(c, i, t, s, newSynapses= false): Return a segmentUpdate data structure containing a list of proposed changes to segment s. Let activeSynapses be the list of active synapses where the originating cells have their activeState output = 1 at time step t. (This list is empty if s = -1 since the segment doesn’t exist.) newSynapses is an optional argument that defaults to false. If newSynapses is true, then newSynapseCount - count(activeSynapses) synapses are added to activeSynapses. These synapses are randomly chosen from the set of cells that have learnState output = 1 at time step t.
My questions may be completely obvious, but a bit of clarification would be immensely helpful:
- for an HTM Cortical Column with 2048 mini-columns of 32 cells per column, newSynapseCount is 32?
- When newSynapses = false, activeSynapses is basically just a list of whatever cells were in an active state at the previous time step?
- When newSynapses = true, activeSynapses is a list whatever cells were in an active state at the previous time step plus a random set of cells that were in a learn state at the previous time step up to 32 synapses in size?
I’ll definitely have more questions on the TM pseudocode, but I think understanding this would be a good starting point for me. I’d really appreciate some guidance.
1 Like
I agree. This part of the white-paper is not so easy to digest. I’m wondering about this part of the algorithm myself.
- for an HTM Cortical Column with 2048 mini-columns of 32 cells per column, newSynapseCount is 32?
After the pseudo code, the white-paper provides more details:
> The implementation of potential synapses is different from the implementation in the spatial pooler. In the spatial pooler, the complete list of potential synapses is represented as an explicit list. In the temporal memory, each segment can have its own (possibly large) list of potential synapses. In practice maintaining a long list for each segment is computationally expensive and memory intensive. Therefore in the temporal memory, we randomly add active synapses to each segment during learning (controlled by the parameter newSynapseCount).
While in the brain the number of distal synapses is enormous the HTM model reduces this number due to technical (memory + processing speed) constraints. Each segment starts with a small amount and can add synapses over time. Based on my understanding though, this number of synapses added is completely arbitrary (i.e. depends on the model designer / technical resources). I don’t think there is a relationship to the number of cells in a column (as in your example).
- When newSynapses = false, activeSynapses is basically just a list of whatever cells were in an active state at the previous time step?
- When newSynapses = true, activeSynapses is a list whatever cells were in an active state at the previous time step plus a random set of cells that were in a learn state at the previous time step up to 32 synapses in size?
Yes. This is also my understanding. It returns a list of active synapses which link to active cells. Of course, it would be great if somebody from Numenta could confirm this.
1 Like
Hmm, yea I guess they arbitrarily chose 128 segments per synapse, 128 synapses per segment, and 32 maximum new synapses each step. Maybe they did this through trial and error testing of what seems to work best.
The TM implementation has been hurting my brain