Compiling all the information into something cohesive

I wrote an integer encoder a while back that might meet your needs. The encoding was inspired by a series of discussions about grid cell modules. Given a series of partition widths (I chose prime values for reasons explained in the post), the representation stores the encoded number as a series of bits (one per partition) indicating the number modulo by each of the partition widths. The representation has excellent capacity and maintains sparseness as well. It does not provide much in the way of semantic overlap for nearby values, opting instead to encode that information as bit shifts in the representation.

I included some JavaScript code to provide a reference implementation, but it’s fairly straight-forward to implement in any language. Please have a look and let me know if you find it useful.

2 Likes