I’ve read this : https://numenta.com/blog/2018/05/25/how-grid-cells-map-space/
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 :
5,10,15,20,25,30,…
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.
gc_decoder.ipynb
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is an experiment to decode HTM Grid Cell encoders using Machine Learning. I've been thinking about this problem for quite a long time - Grid Cells provide a low ambiguous, deterministic way to encode real values into SDR. But unlike Scalar Encoder, there's no known way to decode a GridCell. (Yeah, we could use a SDR classifer, but that sucks, It's slow and all...) So here we go. Let's try to decode GridCells using ML!"
]
},
{
This file has been truncated. show original
Edit: Fix formula
3 Likes
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.
Have a question regarding the encoding of GridCells to SDR. As I understood, Grid Cells encode the location as described in some papers ( DOI:10.1038/nature03721 )
Why we are trying to encode the GridCell code to SDR code?
in my case because i was trying to implement HTM in a module manner where inter-module communication happens in SDR.
Also HTM theory should be SDR all the way …