# Temporal Pooler Implementation

**URL:** <https://discourse.numenta.org/t/temporal-pooler-implementation/324>\
**Category:** Engineering\
**Created:** [May 13, 2016, 6:10pm UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324 "2016-05-13T18:10:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franky](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/franky/32/199_2.png) [@Franky](https://discourse.numenta.org/u/Franky)\
**Post date:** [May 13, 2016, 6:10pm UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324/1 "2016-05-13T18:10:07Z")

</div>

Hey Guys, I want to implement a version of the Temporal Pooler but I do not know how it operates.  
I understand the function, but I do not understand the mechanics behind it.

It should be some form of higher order markov chain?

Did read the materials and check some videos but for some reason the mechanics eludes me. Any help or pointers would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Franky](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/franky/32/199_2.png) [@Franky](https://discourse.numenta.org/u/Franky)\
**Post date:** [May 13, 2016, 6:22pm UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324/2 "2016-05-13T18:22:00Z")

</div>

To answer my own question I just found this in another thread and will give it a spin;

> **[BaMI-Temporal-Memory.pdf](https://numenta.com/assets/pdf/biological-and-machine-intelligence/0.4/BaMI-Temporal-Memory.pdf)**
>
> 737.81 KB

---

<div class="post-metadata">

**Author:** ![subutai](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/subutai/32/106_2.png) [@subutai](https://discourse.numenta.org/u/subutai)\
**Post date:** [May 13, 2016, 6:37pm UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324/3 "2016-05-13T18:37:50Z")

</div>

@Franky - that’s probably the best place to look, and contains updated pseudocode. To check some of the details you may also want to look at this Python implementation, which is designed to be relatively easy to read:

[https://github.com/numenta/nupic/blob/master/src/nupic/research/temporal\_memory.py](https://github.com/numenta/nupic/blob/master/src/nupic/research/temporal_memory.py)

---

<div class="post-metadata">

**Author:** ![Franky](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/franky/32/199_2.png) [@Franky](https://discourse.numenta.org/u/Franky)\
**Post date:** [May 14, 2016, 7:51pm UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324/4 "2016-05-14T19:51:25Z")

</div>

Thanks @subutai! Do you have information regarding the new TP and old TP? I have just seen it mentioned there are two different versions, but not found any documentation.

Best  
Franky

---

<div class="post-metadata">

**Author:** ![cogmission](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/cogmission/32/11_2.png) [@cogmission](https://discourse.numenta.org/u/cogmission)\
**Post date:** [May 14, 2016, 8:10pm UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324/5 "2016-05-14T20:10:49Z")

</div>

Hi Franky,

The old [CLA Whitepaper](http://numenta.org/resources/HTM_CorticalLearningAlgorithms.pdf) (circa 2011), documents the process outlined as the old TP. The new TemporalMemory is pretty much sufficiently documented by the comments in the code. Beginning with the `compute()` method, the logic unfolds and you can follow the method documentation to see how the algorithm progresses as the method documentation reads like pseudocode.

---

<div class="post-metadata">

**Author:** ![Franky](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/franky/32/199_2.png) [@Franky](https://discourse.numenta.org/u/Franky)\
**Post date:** [May 14, 2016, 8:11pm UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324/6 "2016-05-14T20:11:49Z")

</div>

Thanks Cogmission for clarifying that!  
Much appreciated.

---

<div class="post-metadata">

**Author:** ![cogmission](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/cogmission/32/11_2.png) [@cogmission](https://discourse.numenta.org/u/cogmission)\
**Post date:** [May 15, 2016, 2:31am UTC](https://discourse.numenta.org/t/temporal-pooler-implementation/324/9 "2016-05-15T02:31:35Z")

</div>

Hi Guys,

Incidentally, It would be nice that when @mrcslws finishes [https://github.com/numenta/htm.java/issues/421](https://github.com/numenta/htm.java/issues/421) - that the documentation of the `compute()` method be just as clear and outline the algorithm steps just like the current one does?

Just saying this because NuPIC adheres to an excellent standard for method documentation and here in the algorithms it really is helpful to be able to see what is going to happen via a pseudocode type description. I’m not saying that Marcus wasn’t going to do it _anyway_ 😛 - he most probably would, I just want to make sure we keep on the lookout for this important quality… I hope I’m not over-explaining? I do this because this medium seems to tend to invite misinterpretation 😛 (Ok now THAT’s over explaining)
