HTM prediction model with good accuracy but low activation levels

The active columns are defined by the Spatial Pooler, not the Temporal Memory. The TM activates cells within active columns. To get the active columns from the follow the instructions [here(NuPIC Usage FAQ), specifically:

# Extract the spatial pooler
spRegion = model._getSPRegion()
sp = spRegion.getAlgorithmInstance()

Use this API for the SP.

# Extract the temporal memory
tmRegion = model._getTPRegion()
tm = tmRegion.getSelf()._tfdr

Here is the API for the Backtracking TM.

# Get the active cells
tm.infActiveState["t"]

These active cells are in a 1d array. They need to be transformed into SP columns.

1 Like