What is Spatial Pooler

hi, I’m sorry for my question, I have a problem in HTM I have some question about spatial Pooler I watch the videos of matt on HTM school, but I still have some question because I’m not perfect in the English language:

  1. First, we encode our input to a binary code then we represent this binary input to SDR but I don’t instrestand why we use spatial Pooler (matt said " maintain a fixed sparsity " and " maintain the semantic meaning") why and how did this
  2. why we must determine which of the columns of cells “win”
  3. what is the difference between blue and gray ball in those images and why the input is change
    If anyone can answer me or explain me what is SP and why we use it
1 Like

All the inputs do not need to have the same percentage of “on” bits to “off” bits. The inputs in fact do not need to be very sparse either. They only need to encode semantic meaning. The Spatial Pooler takes each of the inputs and generates an output SDR. Every output SDR always has the same percentage of “on” bits to “off” bits. This is what is meant by “fixed sparsity”. Additionally, the output SDRs will preserve the semantic meaning of the inputs.

By “semantic meaning”, that means various percentages of the “on” bits in the SDR represent different concepts. With a date encoder, for example, semantic meaning refers to things like day of the week, time of day, and weekends. If 25% of the “on” bits in the input represent “Monday”, for example, then 25% of the minicolumns chosen as winners by the Spatial Pooler should also represent “Monday”.

This is the part which ensures a fixed sparsity. For example, if we want to generate SDRs which have 2% “on” bits and 98% “off” bits, then all we have to do is select the top 2% of minicolumns as “winners” to be activated, and all the other minicolumns are inhibited.

I didn’t understand this question. Could you rephrase it? I scanned through the two HTM School videos for Spatial Pooling, but I didn’t spot what you were talking about with respect to the colors blue and gray. I do see green and grey circles over the input space in some of the visualizations, but I’m not sure whether that is what you are referring to. Could you mention which of the two videos you are talking about, and at what timestamp in the video?


Its true that the encoding bit string also has a fixed sparsity and maintains the semantic meaning of the input, but the SP distributes the semantics across a broader space. It is possible to feed the active encoding bits directly into the TM, but this makes for a heavy load on each. Also the SP has its own learning mechanism, where the SP columns connect more strongly to those encoding bits which helped it to successfully activate.


yes, thanks your explanation is very helpful and I updated my publication.


@Paul_Lamb , @sheiser1
thanks for those explications, I have a last question:
the input of spatial Pooler is a set of SDR and the output is one SDR or what???
how can explain me this photo, please

1 Like

I geuss this helpful :smile:

1 Like

The input to the SP is an encoding bit string, looking something like:


The output of the SP is a column SDR, looking something like:

00000000100001000000110000000011…001 (length=2048)

Each of the 1’s in this SP output represents a column of cells in that image. Most columns are grey (with no active or predicted cells) while some have red (active) cells and others have yellow (predictive) cells. The image has been scaled down for visual clarity, but if it were full sized there would be 2048 columns.

Its the job of the TM (temporal memory) to choose which cell(s) within the activated columns will activate. ~40 columns out of the 2048 will activate (represented by the 1-bits in the SDR output from the SP).

I think a good place to start would be the HTM School videos on youtube. Matt Taylor does a really great job of explaining and visualizing this whole process.


thanks @sheiser1 :slight_smile:
but what I can’t understand in the first photo the encoder code the input to binary vectores but in the second photo the encoder encode the input into SDRs .

1 Like

A binary vector is a bit array (an SDR is also a bit array). I think the point being communicated here is that the output of an encoder doesn’t necessarily need to be very sparse.


thanks a lot :slight_smile:

1 Like

A post was split to a new topic: HTM and NLP