If I understand correctly, I think the official TM algorithm already does this. If a segment has “max new synapse count” active synapses when its post-synaptic cell becomes predicted active, then it will not grow any additional synapses.
The relevant pseudocode from BAMI:
46. newSynapseCount = (SAMPLE_SIZE -
47. numActivePotentialSynapses(t-1, learningSegment))
48. growSynapses(learningSegment, newSynapseCount)
Here, “SAMPLE_SIZE” is the more commonly referred to “max new synapse count”. When a new dendrite segment is grown, it connects “max new synapse count” synapses with winners from the previous timestep. If that same cell is later correctly predicted (such as after some bursting minicolumns), newSynapseCount will evaluate to zero in the above equation, so no new synapses will be grown.
In your example, you are not using resets, which means you are also convoluting the original topic with the “repeating inputs” problem (this makes things a little more difficult to visualize). Not a big issue, but thought I would mention it. Lets walk through your example with the above point from the TM algorithm in mind (we’ll still forego any resets since that is the scenario you described). I’m assuming (as you did in your example) that the system is configured for one-shot learning.
- Input A bursts, and winner cells A’ are selected
- Input B bursts, and winner cells B’ are selected, connecting to A’
- Input C bursts, and winner cells C’ are selected, connecting to B’
- Input A bursts, and winner cells A’’ are selected, connecting to C’. Cells for B’ are predicted (because A’ is also active due to the bursting A minicolumns)
- Input B causes cells B’ to become active, and they strengthen their connection to A’. (note: no connections to A’’ are created, for the reasons described above). Cells for C’ are predicted.
- Input C causes C’ to become active. Cells for A’’ are predicted.
- Input A causes A’’ to become active. No predictions (see step 5 for why)
- Input B bursts, and winner cells B’’ are selected, connecting to A’‘. Cells for C’ are predicted (because B’ is also active doe to the bursting B minicolumns)
- Input C causes C’ to become active, and they strengthen their connection to B’. (note: no connections to B’’ are created, for the reasons described above). Cells for A’’ are predicted.
Rinse and repeat. Hopefully you see the pattern. Each time the long ABCABCABCABC sequence reaches the end of what it has learned, there is a burst, one more element is added to the end of the sequence, and you then cycle back through until you reach the end again. There is an unrelated issue with learning this type of repeating sequence without resets (but that is off topic, so you can search “repeating inputs” here on the forum if you are interested in more details about that)
Now lets move to sequence D, B, E:
- Input D bursts, and winner cells D’ are selected.
- Input B bursts, and winner cells B’‘’ are selected, connecting to D’. Cells C’ and C’’ are predicted (because B’ and B’’ are also active due to the bursting B minicolumns)
- Input E bursts, and winner cells E’ are selected, connecting to B’‘’
- Input D bursts, and winner cells D’’ are selected, connecting to E’. Cells for B’‘’ are predicted (because D’ is also active due to the bursting D minicolumns)
- Input B causes cells B’‘’ to become active, and they strengthen their connection to D’. (note: no connections to D’’ are created, for the reasons described above). Cells for E’ are predicted.
- Input E causes cells E’ to become active. D’’ is predicted.
- Input D causes D’’ to become active. No predictions (see step 5 for why)
- Input B bursts, and winner cells B’‘’’ are selected, connecting to D’‘. Cells for E’, C’, and C’’ are predicted (because B’‘’, B’‘, and B’ are also active)
- Input E causes cells E’ to become active and strengthen their connection to B’‘’. (note: no connections to B’‘’’ are created, for the reasons described above). Cells for D’’ are predicted.
As you can see, the behavior for this one is very similar to the previous repeating sequence, and the connections formed do not cause any ambiguity between the two. When a burst happens on any shared elements (B in this scenario), you get multiple predictions due to the lost context, but the system quickly recovers in the subsequent timesteps.
Let me know if anything is inaccurate with this example (it is possible that I still have gaps in my understanding, so always good to be corrected when I get things wrong).