Grid-modules => SDR?

I’ve read this :

My question is if you have 1D grid modules how do you generate SDR, as shown in the example.

I mean what are the steps/algorithm.

I suspect you represent grid cell module by a coefficient i.e. if coef = 5, then grid-cells that activate the module are :

A 1D grid cell encoder works like this (in a algorithmic sense):

  • Let’s say we want to encode the value x using N grid modules where each module have M bits.
  • For each of the N module:
    • Generate a scaling factor s and bias b (from a reasonable range)
    • Compute x’ = x*s+b (scale the value then add a bias to it)
    • Compute I = round(fmod(x’, M) + sign(x’)*M) mod M (handle negative values then wrap around into grid space)
    • Generate an empty sdr of length M then set sdr[I] = 1
  • Concatenate all sdr generated by all modules
  • You should end up with a SDR of length M*N

Here’s my Python implementation from a project a few days before.

Edit: Fix formula


How about encoding an SDR value (instead of real-value) via grid-cell-modules to a transformed SDR.

Is this logically feasible ?

Trying to wrap my mind around it ! if it make sense.

Would it be something akin to Spatial pooler ?

Yeah… It sounds like a Spatial Pooler. To be more accurate, it sounds like a SP with potential radius = inf, local radius = module size and local area activation = 1 (with some other twists).

I’m not sure if it makes biological sense tho.