• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    Clojure
  • Created over 10 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hierarchical Temporal Memory in Clojure

Comportex

Comportex logo

Comportex is an implementation of Hierarchical Temporal Memory as a Clojure library. It is not a port of NuPIC, it is a separate implementation based initially on the Numenta CLA white paper but significantly evolved.

In the spirit of Clojure, Comportex is more a library than a framework. The user controls simulations, and decides what to do with them. If you want to take the set of active cells and use them to generate predictions or anomaly scores, that is up to you. It's not going to do it automatically.

Comportex is not yet stable. Our aims are to:

  1. understand the theory deeply by implementing it and experimenting with it;
  2. help others to understand the theory via visual explanations; and
  3. further develop the theory by attempting to apply it to new problem types.

Documentation

For an applied exploration of HTM using Comportex, try the essay Predicting power consumptions with HTM by Marcus Lewis.

The core API is in the namespace core, and it is typically used with the layer implementation in layer and the encoder implementations in encoders.

Parameter descriptions can be found in org.nfrac.comportex.layer.params.

Minimum Viable Snippet

(require '[org.nfrac.comportex.core :as cx])
(require '[org.nfrac.comportex.layer :as layer])
(require '[org.nfrac.comportex.encoders :as enc])

(def sensor [:val (enc/unique-encoder [127] 21)])
(def params {})
(def htm
  (cx/network {:layer-a (layer/layer-of-cells params)}
              {:input sensor}))
(def htm2 (cx/htm-step htm {:val "hi"}))
(-> htm2 :layers :layer-a (cx/layer-state) :active-columns)
; #{186 641 898 830 490 805 776 819 758 627 630 485 515 618 872 143 220 392 133 38}

Usage

Get Leiningen first.

Use git to clone this repository. Then, e.g. to start an interactive session:

cd comportex
lein repl

See A sample workflow with the REPL.

Or, for a better experience, check out the Notebook (browser-based REPL with super powers) in Sanity.

Demos

A list of demos can be found in src/org/nfrac/comportex/demos/ and, again, remember that they can also be run with Sanity.

Javascript API

A minimal Javascript API is included, and a small demo which shows how to use it. First, compile to javascript:

lein cljsbuild once

Then load public/comportexjs.html in your browser.

Related projects

Hello

License

Copyright Β© 2014-2016 Felix Andrews and Marcus Lewis.

Distributed under the GNU Affero General Public Licence, Version 3, the same as NuPIC.

DOI

More Repositories

1

clortex

(pre-alpha) Implementation of Jeff Hawkins' Hierarchical Temporal Memory & Cortical Learning Algorithm
Clojure
183
star
2

flink-htm

Distributed, streaming anomaly detection and prediction with HTM in Apache Flink
Java
136
star
3

nupic.studio

NuPIC Studio is a powerful allΒ­-in-Β­one tool that allows users create a HTM neural network from scratch, train it, collect statistics, and share it among the members of the community.
Python
94
star
4

htm

Hierarchical Temporal Memory implementation in Golang
Go
63
star
5

htm-school-viz

Visualizations supporting HTM School
JavaScript
61
star
6

sanity

See your HTM run.
Clojure
54
star
7

building-htm-systems

Supporting code for Building HTM Systems document.
JavaScript
29
star
8

river-view

Public Temporal Streaming Data Service Framework
HTML
28
star
9

nupic.audio

Audio (analog, digital) experiments using NuPIC HTM/CLA
Python
26
star
10

nupic.critic

Music critic hack from 2014 Spring Hackathon
Python
25
star
11

htm.js

Lightweight Browser-Based Javascript Hierarchical Temporal Memory
JavaScript
21
star
12

htmengine-traffic-tutorial

HTM Engine example application: live NYC traffic anomaly detection.
JavaScript
20
star
13

skeleton-htmengine-app

Bare-bones example of an htmengine application
Python
18
star
14

nupic.visualizations

Web application for interactive graphs, anomaly highlighting and online monitoring.
JavaScript
17
star
15

sanity-nupic

NuPIC backend for Sanity
Python
17
star
16

HTMpandaVis

3D Visualization tool for HTM systems
Python
17
star
17

nostradamIQ

[Work in progress!!!] - sensing our Worlds' disasters.
JavaScript
16
star
18

cell-viz

JavaScript
11
star
19

nupic-history-server

Runs NuPIC behind a web server, exposing internals. For HTM School.
Python
11
star
20

htm.JavaScript

Port of htm.java to JavaScript
JavaScript
10
star
21

influx.htm

A data interface for InfluxDB that makes it easier to use with HTM systems.
Python
10
star
22

mine-hack

Hackathon project with Minecraft
Python
9
star
23

hitc

HTM In The Cloud
Python
7
star
24

htm-2d-object-modeling

https://discourse.numenta.org/t/2d-object-recognition-project/5465
Python
5
star
25

river-runner

Runs River View data through NuPIC easily
Python
5
star
26

simplehtm

Simple HTM implementation.
JavaScript
5
star
27

menorah

Menorah is a NuPIC experiment framework for River View.
Python
5
star
28

HTM.Julia

Julia's CLA
4
star
29

image2sdr

NodeJS service to generate SDRs for images
JavaScript
4
star
30

htmjava-nab

Clojure wrapper for HTM.Java and runner for Numenta Anomaly Benchmark
Clojure
4
star
31

smartthings.htm.bridge

A bridge for smartthings apps to post data to, which will in turn run data through HTM REST API
JavaScript
4
star
32

community.research

Community research repository for NuPIC.
Java
3
star
33

soda-tap

WIP: Indexing Socrata Open Data API for streaming temporal data
Python
2
star
34

nupic.ca

NuPIC Cellular Automata Predictions
Python
2
star
35

nupic.devtools

Some development tools I've created while working on NuPIC (https://github.com/numenta/nupic)
Python
2
star
36

simon

"Simon" game for Raspberry Pi, reversed so user sets pattern and NuPIC replays
Python
2
star
37

nupic-example-code

Community contributions of example code using NuPIC and NuPIC Core
Python
2
star
38

riverpy

Python API client for River View
Python
1
star
39

NAB-Dockerfile

1
star