SDR representation

I want to understand, how to pass from SDR representation (as array of 0/1) to “Matrix” view representation, I cannot see the relation between the Int Array (0…1) and the matrix representation (32x32 columns for exemple).

1 Like

is it something like N columns (with K ones) and M neurons per column (All ones if Burst, 0–1--0 if Contextual) ???

Hi @zahir_hamroune,

Sparse arrays are marked by their “positions”. So a “dense” array of:


in “sparse” syntax would be:


…indicating the “on” positions only…

In order to convert from sparse to dense, you have to know the matrix dimensions, and then fill in all the un-specified positions with “zeros”…

Hope that helps?

@cogmission I’m not sure that 0,3 corresponds to the position of matrix position (i,j)
I think the sparse input 1,0,0,1 could be encoded to this matrix: (one of C(n,k)=k!/(n-k)!n! )

M(cells by col) X N (# cols)


is it right my understanding?

Are you talking about a specific matrix implementation in NuPIC? Or does this question have something to do with topology?

Right, my question is about the implementation in NuPIC

Can you point specifically to the code under question?

I cannot see any matrix representation of SDR, in


it manipulates Vector only so I’m bit confusd with the Matrix Representation topology

But you brought up the matrix, didn’t you? Where did you see someone talking about matrices then? I don’t mean to be too direct, I just don’t understand what you are asking.

Ok imagine we have a category “A” wich is 100110 is it the SDR ?. is it right that we have 6 Cells (3 cells active + 3 non active) ?
then imagine we receive later “B” with SDR representation 010011
in my understanding for A we will have a “matrix” with N=6 Columns (only K=3 active) and then each Column we will arrange M=2 cells corresponding to the different context for example for “A” we can choose eaither

Context 1 of “A”=100110
Context 2 of “A”=100110

and for “B”

Context 1 of “B”=010011 may be
Context 2 of “B”=010011 may be

according to page 2480
each layer is Matrix (NxM cells) ?

The Spatial Pooler algorithm is responsible for selecting active columns only (it is the Temporal Memory algorithm which selects which cells in the columns to become active). So in your example, the SP representation of “A” would be (0,3,4) and would not indicate the context. “B” would be (1,4,5).

I don’t think it is useful to apply the “matrix” concept here to minicolumns. When you say “Columns” I don’t know if you are talking about columns in the matrix, or minicolumns. I would rather just treat these things as arrays unless there is an explicit topology to the input space.

Ok I described the TM functional, and Yes Columns in my mind is Mini-Columns that encapsulate “contextual” cells

At the Columns level ==> SP responsability
Mini-cols (context) ==> TM Responsability

Not quite.

Mini-columns (sometimes just called “columns”) ==> SP responsibility
Cells (context) ==> TM responsibility

What do you mean “columns” here? The SP translates a set of active cells in an input space into a set of active “minicolumns”.

The TM activates cells within those minicolumns.

Ok I think it is clear if I resume if A=1001, then the space size is N=4, then SP will activate (0,3), so there is K=2 active mini-columns of N=4 mini-columns,
then within 0 and 3 the activated mini-columns , TM will activate a set of Cells (if M cells=Bursting, if 1 cell = selected)

1 Like

I think you have a major misunderstanding here. The SP will convert this input activation to a completely different activation dependent upon it’s initialization parameters. I think you should review the material about the spatial pooling algorithm.

1 Like

Good point. I assumed in my above responses that “1001” represents the active minicolumns after SP, not the active cells in the input space.