Swarming: Understanding the code

Hi community,

I have spent about 6 weeks reading and understanding HTM. I think with all the papers and resources provided, I have obtained a good picture at the conceptual level. After watching the Hot Gym Prediction[1] tutorial, I understand that for any application, determining the model is the first step and the easiest way to go about this is by running a swarm on your data. With the help of [2], [3] and several discussions on the forum I was able to understand swarming and get predictions for my data. This is my status quo. I wanted to understand swarming at its implementation level, for which I started out with the permutations_runner.py[4].
However the code base is so huge that I feel lost. So here is my questions:

1> What would you suggest is the best way to understand swarming (and eventually all of HTM) at implementation level?
The reason I wish to do this is to be able to tweak the various parameters to better optimise swarming.
For example, instead of giving random initialisation to the scalar parameters in PSO, could I feed in more intelligent guesses?

For experimenting with such aspects, I need to first understand the existing code, don’t I?
Help in any form is welcome and appreciated.
Thanks in advance.
Janaki :slight_smile:

[1] https://www.youtube.com/watch?v=S-0thrzOHTc
[2] https://github.com/numenta/nupic/wiki/Swarming-Algorithm
[3] https://github.com/numenta/nupic/wiki/Running-Swarms
[4] https://github.com/numenta/nupic/blob/master/src/nupic/swarming/permutations_runner.py

1 Like

One thing to understand is that swarming really doesn’t have anything to do with HTM. We call it swarming because it is an implementation of a “particle swarm” algorithm that tries to identify the most performant set of parameters for some function. Hopefully you’ve seen this video? If not, perhaps it should be on the Running Swarms wiki.

If you are trying to get your head around HTM, I would suggest not spending too much time investigating our swarming code. It is just a tool, and we have plans to rewrite it into a more general module for future use.