Thursday, April 14, 2011

Speed optimization of HTM Psuedocode

The sample code as published loops through every cell twice in order to determine if it will be predictive or active.

Each cell stores small lists of other cells which if were active may be used to set this cell in predict mode.
After activating a subset of cells we must go through all cells to calculate the values to the small lists.
The small lists designate which cells to base prediction from.

The following example is highly visual and depends on being very familiar with how activations and predictions are carried out over several cells.

The current algorithm calculates prediction in a way which  is analogous to following an explosions fallout backwards.One must look at each fragment on the ground to determine if they came from a larger chunk landing somewhere else. The problem with this is every point on the floor must be scanned for pieces.
As the square feet increases to billions of inches we have speed issues on non-parallel processors.

Under development is an algorithm which is able to follow a large chunk hitting the ground and breaking into smaller pieces. Where the smaller pieces land is what is added to the area where the large chunk hit. This gives us a list of positions at each landing point. This list tells us where the smaller fragments will go. During runtime the computer recursively calls out these points and increments a simpler version of individual segment update lists.

Psuedocode for the fast algorithm is in the works and as follows:
For each cell on plist set to predict if past threshold.

For each column on alist set all cells active or set cells in predict mode active.
-when each cell is set active
--point cells on WASactive list to this one
--jump to its connections and increment their predict and add to plist2.
--add the active cell to the active list (This is also the learncell)

For each cell on plist inc if over threshold indexes

Copy plist2 to plist, clear plist2
Copy alist to wasactive

Update: it evolved into something with nodes having two segments.

No comments:

Post a Comment