# Does Encoders produce sparse binary vectors or SDRs?

**URL:** <https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712>\
**Category:** Numenta Theory\
**Created:** [March 28, 2018, 7:37pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712 "2018-03-28T19:37:30Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbdulRahman.Mansour](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/abdulrahman.mansour/32/2237_2.png) [@AbdulRahman.Mansour](https://discourse.numenta.org/u/AbdulRahman.Mansour)\
**Post date:** [March 28, 2018, 7:37pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/1 "2018-03-28T19:37:31Z")

</div>

In the HTM School YouTube channel in the videos that were made by this great man Matt Taylor, I found that Encoders should result in a sparse binary vector and the sparse binary vector for each variable coming from separate encoders will be placed in its appropriate place in the Input Space, and then Spatial Poolers checks its connections with the Input Space and produce the SDR.

That really makes sense to me, but in some papers, I found that Encoders will result in SDRs and I didn’t get it actually.

So, my question here is, how would the Encoders produce SDRs? And, how would the Spatial Pooler deal with and be connected to multiple SDRs instead of being connected to only the Input Space? I just can’t get it.

---

<div class="post-metadata">

**Author:** ![sheiser1](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/sheiser1/32/766_2.png) [@sheiser1](https://discourse.numenta.org/u/sheiser1)\
**Post date:** [March 28, 2018, 8:02pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/2 "2018-03-28T20:02:09Z")

</div>

> [@AbdulRahman.Mansour](#):
>
> I just can’t get it.

You absolutely can! It’s just a learning curve getting your mind around it. Firstly the encoders themselves don’t actually produce SDR’s, they produce bit strings that get concatenated together. The Spatial Pooler then takes this total encoding bit string and produces an SDR. I’d check out the 1st HTM school video on SP if you haven’t already.

[![](https://img.youtube.com/vi/R5UoFNtv5AU/maxresdefault.jpg "Spatial Pooling: Input Space & Connections (Episode 7)") ](https://www.youtube.com/watch?v=R5UoFNtv5AU)

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [March 28, 2018, 9:06pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/3 "2018-03-28T21:06:25Z")

</div>

It is important that encoders produce representations with consistent density, but they do not have to be sparse. They must have semantic meaning, however.

---

<div class="post-metadata">

**Author:** ![AbdulRahman.Mansour](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/abdulrahman.mansour/32/2237_2.png) [@AbdulRahman.Mansour](https://discourse.numenta.org/u/AbdulRahman.Mansour)\
**Post date:** [March 29, 2018, 3:10pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/4 "2018-03-29T15:10:17Z")

</div>

Yes, I’ve already watched this video, this is where he explains how are Encoders’ outputs are put into the Input Space and then the Spatial Pooler formulate the one single SDR that will enter the Temporal Pooler.

But the most important thing for me now that you agree that Encoders don’t produce SDR’s directly.

---

<div class="post-metadata">

**Author:** ![AbdulRahman.Mansour](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/abdulrahman.mansour/32/2237_2.png) [@AbdulRahman.Mansour](https://discourse.numenta.org/u/AbdulRahman.Mansour)\
**Post date:** [March 29, 2018, 3:14pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/5 "2018-03-29T15:14:00Z")

</div>

Yes, exactly that is what makes sense.

Thank you very much.

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [March 29, 2018, 3:22pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/6 "2018-03-29T15:22:19Z")

</div>

Remember encoders are representing sensory data as they might be represented by sensory neuron firings. An encoder can have a _lot_ of tricks to identify and encode semantics. I suggest if you are creating an encoder that you try to keep your encodings sparse. All of our encoders produce pretty sparse encodings.

---

<div class="post-metadata">

**Author:** ![AbdulRahman.Mansour](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/abdulrahman.mansour/32/2237_2.png) [@AbdulRahman.Mansour](https://discourse.numenta.org/u/AbdulRahman.Mansour)\
**Post date:** [March 29, 2018, 3:36pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/7 "2018-03-29T15:36:59Z")

</div>

But eventually, they will have to be put into one Input Space to be able to formulate the single SDR that enters the Temporal Pooler, right?

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [March 29, 2018, 3:46pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/8 "2018-03-29T15:46:03Z")

</div>

Yes, one encoder could split up its space and encode it in different ways. This is like SDRs concatenated together into a larger encoding. We call this a `MultiEncoder` in NuPIC.

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [March 29, 2018, 6:58pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/9 "2018-03-29T18:58:37Z")

</div>

Asked on twitter about this and got an answer from guess who? 😛

> <https://twitter.com/SubutaiAhmad/status/979423596547162112>

---

<div class="post-metadata">

**Author:** ![AbdulRahman.Mansour](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/abdulrahman.mansour/32/2237_2.png) [@AbdulRahman.Mansour](https://discourse.numenta.org/u/AbdulRahman.Mansour)\
**Post date:** [March 30, 2018, 2:46pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/10 "2018-03-30T14:46:57Z")

</div>

That’s too much for me 😅 he is a great a man.

Actually, I’m having a little trouble understanding this, can you explain it in another way?

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [March 30, 2018, 3:24pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/11 "2018-03-30T15:24:28Z")

</div>

Your question “do encoders produce SDRs” is also like asking if biological encoders produce SDRs. So I was asking on twitter if our eyes, ears, etc have nerve input to the brain that are sparse. This chart is just some evidence that representations in these signals are sparse.

---

<div class="post-metadata">

**Author:** ![AbdulRahman.Mansour](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/abdulrahman.mansour/32/2237_2.png) [@AbdulRahman.Mansour](https://discourse.numenta.org/u/AbdulRahman.Mansour)\
**Post date:** [March 30, 2018, 7:18pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/12 "2018-03-30T19:18:58Z")

</div>

Thank you very much for illustrating.

But eventually, if we have only one single HTM model, all of these SDRs coming out from multiple Encoders should be combined somehow to produce only one SDR that will be fed to the HTM model, right?

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [March 30, 2018, 7:34pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/13 "2018-03-30T19:34:33Z")

</div>

Sensory arrays like somatic nerves encode data that [flows into many cortical columns](https://en.wikipedia.org/wiki/Cortical_homunculus). Each cortical column learns the patterns it observes. So a sensory array might split up its encoding topologically and different “HTM models” would processes different parts. Theoretically, they will work together to represent objects.

But today in NuPIC we pretty much just create encoders meant to feed into one model.

---

<div class="post-metadata">

**Author:** ![AbdulRahman.Mansour](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/abdulrahman.mansour/32/2237_2.png) [@AbdulRahman.Mansour](https://discourse.numenta.org/u/AbdulRahman.Mansour)\
**Post date:** [March 30, 2018, 7:48pm UTC](https://discourse.numenta.org/t/does-encoders-produce-sparse-binary-vectors-or-sdrs/3712/14 "2018-03-30T19:48:20Z")

</div>

Thank you very much again.

You are really making this forum a great one 😊
