# HTM algorithms in Scheme

**URL:** <https://discourse.numenta.org/t/htm-algorithms-in-scheme/2470>\
**Category:** Implementations\
**Tags:** htm-implementations, temporal-memory\
**Created:** [June 28, 2017, 5:03pm UTC](https://discourse.numenta.org/t/htm-algorithms-in-scheme/2470 "2017-06-28T17:03:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogert](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rogert/32/1294_2.png) [@rogert](https://discourse.numenta.org/u/rogert)\
**Post date:** [June 28, 2017, 5:03pm UTC](https://discourse.numenta.org/t/htm-algorithms-in-scheme/2470/1 "2017-06-28T17:03:20Z")

</div>

(Jun '19 update: original standalone Scheme SP and TM have been archived: may be useful as an intro to HTM-scheme but the libraries in HTM-scheme/algorithms have better code. Algorithms in current use (in the [combined\_sequences project](https://discourse.numenta.org/t/htm-scheme-and-an-htmresearch-project/4855)) are apical\_tiebreak\_temporal\_memory.ss and column\_pooler.ss. See algorithms/htm\_concept.ss for an intro to HTM-scheme data structures and coding approach.)

[Hierarchical Temporal Memory in Scheme](https://github.com/rogerturner/HTM-scheme) [(previously)](https://discourse.numenta.org/t/spatial-pooler-in-scheme/2419) now includes a standalone R6RS Scheme translation of temporal\_memory.py and hello\_tm.py

The “Temporal Memory Algorithm” section of [temporal-memory.ss](https://github.com/rogerturner/HTM-scheme/blob/master/HTM-scheme/algorithms/temporal_memory.ss#L231) is annotated with the pseudocode from BaMI [Temporal-Memory-Algorithm-Details.pdf](https://numenta.com/assets/pdf/temporal-memory-algorithm/Temporal-Memory-Algorithm-Details.pdf)
