HTM - Hierarchical Temporal Memory cortical learning algorithms Ruby implementation

Dependency Status Build Status Code Climate

Numenta's Hierarchical Temporal Memory (HTM) is a machine learning technology that aims to capture the structural and algorithmic properties of the neocortex.

This project is an unofficial attempt to implement those algorithms. The code is based on Numenta's paper version 0.2.1

HTM networks are modeled on the neocortex, the seat of human intelligence. They capture the essence of how humans learn, recognize patterns, and make predictions. At the heart of every HTM network is a set of learning algorithms which model the organization and behavior of a layer of neurons in the neocortex. In the same way that humans learn from their environment, the HTM cortical learning algorithms perform the difficult task of discovering the temporal structure in large and complex data streams. By observing how data changes over time an HTM network learns what patterns are significant and causally related. After learning, an HTM network can recognize novel patterns and make predictions.


Add this line to your application's Gemfile:

gem 'htm'

And then execute:

$ bundle

Or install it yourself as:

$ gem install htm

Inside of your Ruby program do:

require 'htm' pull it in as a dependency.


The following API documentation is available :


See the examples folder

Suggested Reading


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request