Coder Social home page Coder Social logo

pyhtm's Introduction

pyHTM - Hierarchical Temporal Memory in Python

Note: Numenta reserves certain patent rights. See Intellectual Property for details.

Summary

This project is an unofficial implementation of the Cortical Learning Algorithms version of HTM, as described in v0.2 of the writeup. Ultimately, pyHTM will demonstrate learning and categorization of various sensory inputs, and display the results.

This implementation will favor code readability over optimization when those options are mutually exclusive. If you want to understand what’s going on, just dig into src/htm_main.py and trace the code (using the Numenta paper as a reference).

The project is very young, and still remains unproven in terms of correctness. I welcome bug reports, forks and pull requests.

Quickstart

It’s preferred to run this inside a virtualenv:

git clone git://github.com/carver/pyHTM.git
cd pyHTM
pip install -r requirements.txt
python src/htm_main.py

Goals

  • Near Term

    • Build diagnostic UI tools to show network state

    • Confirm correctness of algorithm (as defined by Numenta) ← current

  • Medium Term

    • Build showcase of effectiveness on both trivial and real-world data

    • Serialize network state to disk to pause & continue

  • Long Term

    • Build UI to configure and run HTM networks

    • Optimize for speed, never sacrificing code readability.

Status

Mar 23: New API for execution

  • htm.execute() split into two distinct options: execute and executeOnce

  • executeOnce takes a single data structure (2-d list of binary values) and runs a single cycle

  • execute takes an iterable and runs executeOnce until the iterable runs out (or until the number of cycles specified by ‘ticks’ )

Feb 20: can have fewer columns than input pixels

  • Added new test to recognition_static

  • Input compression works at 3.5x; this is not a limit, just as high as I tested today

  • Specifically, a 14x14 grid of pixels, with a 4x4 network of columns, can recognize 4 distinct images

Feb 18: Pass all tests again!

  • A mutable data bug was causing failure for recognition of 4 static images, fixed

  • Updated the htm.execute API to use a data generator instead of a function that mutates a data structure (what was I thinking?)

  • Next up: temporal recognition tests

Feb 1: Added test for recognition of 4 static images (does not yet pass all tests) @see src/carver/tests/recognition_static.py

Intellectual Property

Numenta encourages non-commercial experimentation - ‘`Numenta promises that it will not assert its current patent rights against development or use of independent HTM systems, as long as such development or use is for research purposes only, and not for any commercial or production use. '’ (source)

The license on my code is also non-commercial, so if you want a commercial license, you’ll have to work it out with both Numenta and myself.

A section of this code, found in the numenta package, is a direct translation from the pseudocode in their writeup. Despite pretty significant changes in the translation to python, I am assuming the Numenta copyright still holds (I only have a basic understanding of copyright law). The rest of the implementation is in the carver.htm package, and is licensed under the Numenta Non-commercial License; see license.txt for details.

Markdown Rant

Markdown reliably did everything in ways other than I expected it to, and did it with an ugly smile. You’ll notice a commit history on README.markdown with profanity. I was pleasantly surprised to find the alternative: asciidoc. It comes with a cheat sheet and a web preview, and looks beautiful. Well, it looked beautiful on the web preview, before Github applied their dull-gray css.

pyhtm's People

Contributors

carver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyhtm's Issues

Reusing your code for Ruby HTM

Jason (@carver),

I'm about tostart an implementation of the HTM CLA algorithms in Ruby and I'd like to start from your Python implementation. Is this OK with you ? Of course I will mention your name and project in the README file.

Laurent (@ljulliar)

HTM Network "over-recognizes" objects

I tested 4 static "images", and the network seems to think two of them are identical, despite them being visually quite different.

Failing test in:
src/carver/tests/recognition_static.py

AssertionError: htm thought it recognized a sea_anemone, when it saw a hermitcrab (100.0% match)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.