htm-community / htm.core

Actively developed Hierarchical Temporal Memory (HTM) community fork (continuation) of NuPIC. Implementation for C++ and Python
http://numenta.org
GNU Affero General Public License v3.0
147 stars 74 forks source link

Implement Column Pooler from htmresearch #94

Open breznak opened 5 years ago

breznak commented 5 years ago

Column Pooler, CP, is implemented in python in HTM research. Used for sensory-motor experiments, it extends functionality of TM.

ctrl-z-9000-times commented 5 years ago

Ive never heard of a column pooler, so what does it do? What features does the column pooler have which the SP / TM don't have?

breznak commented 5 years ago

there are papers on Column pooler and sensory-motor learning, "touch" experiments, invariant object representation. See eg https://numenta.com/assets/pdf/posters/CosynePoster_2017.pdf

ctrl-z-9000-times commented 5 years ago

We should incorporate the paper "Kropff & Treves 2008" into the column pooler. This paper describes simple modifications to the SP which make viewpoint invariance form naturally.

Thanh-Binh commented 5 years ago

@ctr-z-9000-times do you mean porting ColumnPooler from Python into c++? Or complete new ones?

ctrl-z-9000-times commented 5 years ago

I don't know, why do you ask? Im hoping to make a plan for this, but i dont have a plan yet.

ctrl-z-9000-times commented 5 years ago

@Thanh-Binh ,

do you mean porting ColumnPooler from Python into c++? Or complete new ones?

I'd like to write the column pooler in C++, because C++ is fast and its the common language that all other languages have bindings for. After done, it should be very similar to the current python version.

Conceptually, the column pooler is similar to the (SP + TM) system; it does many of the same things. I hope we can copy-paste a lot of code from SP&TM to Column Pooler.

Python Column Pooler: https://github.com/numenta/htmresearch/blob/master/htmresearch/algorithms/column_pooler.py

Thanh-Binh commented 5 years ago

@ctr-z-9000-times: understood. The c++ porting is straight forwards

ctrl-z-9000-times commented 5 years ago

FYI: The column pooler should also implement multiple proximal segments. Each cell's overlap is the maximum of its segment's overlaps.

ctrl-z-9000-times commented 5 years ago

I've started work on branch columnPooler2 https://github.com/htm-community/nupic.cpp/tree/columnPooler2

See file: src/nupic/algorithms/ColumnPooler.cpp So far it is an incomplete list of todo notes.

ctrl-z-9000-times commented 5 years ago

FYI everyone, the ColumnPooler should contain a complete and working SpatialPooler. To get just the SP functionality without any of the new stuff you'd use:

@Thanh-Binh, IIRC the Temporal Pooler was an early incarnation of the Column Pooler.

breznak commented 5 years ago

the ColumnPooler should contain a complete and working SpatialPooler.

does it have to, do we want to mix the functionality? Mostly if stuff like inhibition, boosting etc need to be implemented in CP.

OT, but if CP does need to implement the above for its own functionality, should we scratch the SP implementation and just make the class create instance of CP that acts as a SP as you described .. ?

o get just the SP functionality without any of the new stuff you'd use:

ctrl-z-9000-times commented 5 years ago

does it have to [...] ?

Yes. The column pooler needs everything in the SP and a more. In branch columnPooler2 where I'm keeping the work, I have copied the MNIST example and modified it to use a CP instead of an SP, and it currently scores 93% using all of the same parameters as the SP which scored 95%.

should we scratch the SP implementation?

No, at least not until the CP is far more complete, and we prove that it works as I'm advertising. Even if we could replace everything with it, it might be nice to keep the old stuff around for all of the same reasons why we will probably keep the python implementations of the algorithms.

ctrl-z-9000-times commented 5 years ago

More info about Kropff & Treves 2008:

ctrl-z-9000-times commented 5 years ago

I have a hypothesis about how the column pooler could function as a temporal memory. Im discussing it at https://discourse.numenta.org/t/column-pooler-as-a-temporal-memory/5384

ctrl-z-9000-times commented 5 years ago

Update: I have a prototype of the column pooler with the experimental changes described in the previous post. I'm testing it on sequence recognition where it currently scores 75% accuracy on a 50 category recognition task. I'm going to continue experimenting with the goal of making it work well enough to use in place of a temporal memory. Then I'm going to write a report about it.

ctrl-z-9000-times commented 5 years ago

I'd like to reproduce Numenta's Columns paper. They generate several artifical datasets to test their creation, which we should emulate. It does not need to be an exact reproduction, just close enough to verify the critical properties of the ColumnPooler. These properties include:

https://www.frontiersin.org/articles/10.3389/fncir.2017.00081/full

dkeeney commented 5 years ago

Sounds good to me. When you get the algorithm operational I will build a NetworkAPI plugin for it.