Grid Cell Encoder


Hi all,

The community fork now includes an encoder which converts 2-D coordinates into plausible grid cell module activity:

To generate pictures like this one, call:
python3 -m nupic.encoders.grid_cell_encoder

See also the help message:
python3 -m nupic.encoders.grid_cell_encoder --help



@dmac could you please explain me your figure? How can I use your encoder for a scalar value or for an image (32 x32 Mnist image)? Thanks



This encoder is only available in python, so you can find it in our new location for python-only code: REPO/py/, so py/nupic/encoders/

There’s a runable example which produces the above plots.

It’s not suitable for scalars, while great for image (MNIST), you need to provide 2D coordinates, so encode([x, y], sdr_gc)



@dmac: I try to understand the idea of GC encoder using an example:,
SDR-length =10bits
Number of GC-Module partitions = 2, with gcPart1(scale1, Orientation1), gcPart2(scale2, orientation2). In your algorithm, a group of 5 first SDR-bits shares gcPart1 and Bits from 6 to 10 share gcPart2.
A bit in each group owns a grid cell with the same scale, same orientation, but different offsets. By this setup, the GC encoder has 10 grid cells.
My question: is there any biological explain for this setup?