Skip to content
Hierarchical Temporal Memory in Scheme: some algorithms and experiments from numenta/htmresearch translated to Scheme
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
HTM-scheme/algorithms
archive
projects
tests/algorithms
.gitignore
CRANKY.md
LICENSE.txt
README.md

README.md

HTM algorithms in Scheme

Scheme translations of some Numenta HTM (Hierarchical Temporal Memory) algorithms and experiments.

Translated from Numenta htmresearch and nupic. Directory structure, file names, and source organization echo the htmresearch repository; organization of the code by function, and function and variable names, parallel Numenta code where possible: scheme and Numenta python code can be read side-by-side. Algorithms and project computation code are R6RS Scheme with a few Chez Scheme extensions.

algorithms/htm_concept.ss includes brief notes on the main data structures used, which are aimed at minimising space requirements.

Plotting uses Racket packages; example output from the combined_sequences experiment (replicating figure 6 in Numenta paper):

Figure 6

The HTM-scheme combined_sequences project can also reproduce some of the experiments from the Numenta "Columns" paper:

Fig3(B) One cortical column                       (C) Three cortical columns

Figure 3B/C

The algorithms under ongoing development are R6RS libraries in HTM-scheme/HTM-scheme/algorithms, and are named with the path from HTM-scheme root, so can be imported to a top level program in the directory enclosing HTM-scheme.

Archived standalone-spatial-pooler.ss and standalone-temporal-memory.ss are older self-contained Scheme top-level programs including (obsolete) library code, some tests, and hello_sp, sp_tutorial, and hello_tm examples. They do not depend on other libraries, so to try these just install Racket or Chez Scheme, Open file in DrRacket, Run, then enter (hello-sp), (sp-tutorial), or (hello-tm) -- or in Chez Scheme:

$ cd HTM-scheme/archive
$ scheme
Chez Scheme Version 9.5.2
Copyright 1984-2019 Cisco Systems, Inc.

> (load "standalone-spatial-pooler.ss")
> (hello-sp)
See nupic/examples/sp/hello_sp.py
Random 1:   0.0% (12 99 145 167 198 212 364 412 516 564 569 640 748 758 773 ... 4030)
Random 2:  13.4% (50 145 153 214 276 379 399 432 538 574 578 663 673 748 824 ... 4034)
Random 3:   8.5% (12 42 83 124 297 424 451 613 634 666 784 847 859 860 895 ... 4030)
Repeat 3: 100.0% (12 42 83 124 297 424 451 613 634 666 784 847 859 860 895 ... 4030)
Noise .1:  97.6% (12 42 83 124 297 424 451 613 634 666 784 847 859 860 895 ... 4030)
Noise .3:  87.8% (12 42 124 297 424 451 613 634 666 784 847 859 860 895 918 ... 4030)
ok

HTM Theory Reading List

You can’t perform that action at this time.