Here I have another idea of TP implementation.

You keep an accumulator (1D array of int) of size 2048 where every time there is a bit in a position X you increment that element. The input is the TM Predicted SDR.

Now come the interesting part … the Accumulator is decaying… what do I mean… here is the formula :

```
val = exp(- (t/n))
```

where t is the time step and ‘n’ is parameter that control how fast to decay …

On every time step we take winner-takes all (biggest values) with the required sparsity.

Now we have value that changes according to the underling data, next thing is to pass this pattern trough a Spatial Pooler … and we have stable and unique pattern.

What do you think ?