etaler / Etaler

A flexable HTM (Hierarchical Temporal Memory) framework with full GPU support.
BSD 3-Clause "New" or "Revised" License
89 stars 14 forks source link

grid cells functionality #22

Closed alior101 closed 5 years ago

alior101 commented 5 years ago

implement a 2D arrays of cells featuring bumps at hex grid. Every cell can move the bump via input to its proximal dendrites. Based on continuous attractors network dynamics as in https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1000291

marty1885 commented 5 years ago

I have been looking forward to this for a long time! But not being a neural scientist, I don't have much clue on how to implement it. Any suggestions?

alior101 commented 5 years ago

Yes. I'm working on such implementation but not in opencl. I'll share it with you once it's done and maybe you can speed it up by converting it into an opencl kernel. I'll let you know once it's ready - I'll add it as part of the examples in etaler and PR.

marty1885 commented 5 years ago

I'll see what I can do. May you also add some tests so I known my optimization and OpenCL implementation is correct?

alior101 commented 5 years ago

sure

marty1885 commented 5 years ago

@alior101 FYI, If your code is relaying on my GridCell2D code. Please pull from the latest commit. I have fixed a fatal bug in the encoder. (You'll need to setup TBB for CMake for the latest commit to build properly.)

alior101 commented 5 years ago

Hi Martin, Just from reading the code (sorry - I still didn't use it) I saw two issues (plz forgive me if i misunderstood your code):

  1. a "bump" in grid cells is more than one cell active ... it's actually like a Gaussian of cells where the middle one is the most active and activity is dropping along the radial axis. This allows a better GC sampling by the downstream cells...
  2. The scales (as opposed to angles and phase) is less random and more structural and in a clever 1.41 - 1.5 range (see https://advances.sciencemag.org/content/1/11/e1500816 and https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3866454/ ) to allow a better tessellation of the space
marty1885 commented 5 years ago

No prob, just in case you are using my code and are being hit with weird problems. :smile:

My implementation is based on Numenta's paper and Matt's video. Particularly this one: https://www.youtube.com/watch?v=mP7neeymcUY

  1. Yes, very true, but since HTM processes SDRs, I can only make cells on or off. Thus the algorithms finds the closest N cells to the bump and turn the N cells on.

  2. Sounds interesting. I only set the scale to 0.3~1 because arbitrary values and I'm more then happy to change them, especially since the changes are based on evidences. May you elaborate more on the sunject?