Implementation of Hierarchical temporal memory. http://en.wikipedia.org/wiki/Hierarchical_temporal_memory