Network API and Algorithms API

Hi HTM community! I wonder if there are any differences between a model with encoder+SP+TM+Classifier implementation based on Algorithms API and model with same classes based on Network API… I believe there aren´t but just to make it clear.

And what about time cost? I´ve been working with the bindings version of SP and TM for an algorithms API based model which goes far better than the standar python implementation but still wondering if there are better options.
Thanks in advanced!

No there should not be. The Network API is just a flexible framework for the algorithms to run within.

Hopefully, the Network API will not affect time too much. I know that @mrcslws has investigated this in the past. Care to share your findings?

Sure. I found that in our latest research models, the Network API has roughly a 30% overhead: Experiment: Make L4L2Experiment use raw algorithms by mrcslws · Pull Request #744 · numenta/htmresearch · GitHub

This overhead comes mainly from the fact that every region typically converts back-and-forth between binary arrays [0 1 0 0 0 0 1 0 0 ...] and lists of indices [1, 6, ...]. This is because the Network API doesn’t support variable-length arrays, so lists of active cells need to be passed around as binary arrays.

With encoder+SP+TM+Classifier, the biggest performance hit will be: every timestep, the TM has to populate a 65536-length array to store the active cells, and then the Classifier converts that array back to a list of indices.

1 Like

@rhyolight I came across Subutai´s video on Network API just after posting this hahah
@mrcslws That´s really helpful to know!

Thanks a lot to both of you and keep on doing the great job!:ok_hand: