That one is “low code intrusiveness”~ minimum number of changes needed in the current code to implement the optimizations. or it could also be “I don’t need no optimizations”)
@chhenning do you have some say for Eigen (vs Blaze) as pybind11 has support for Eigen?
Also, I’m going to do some refactoring in encoders,SP,TM (maybe touch regions) regarding introducing a common typedef for “SDRvector”, I should probably coordinate this work with your removal of some classes (after you have the PR).
@breznak I’m very open for discussing the selection of the right matrix lib. My thinking is that we need a proper benchmark to make the right choice. I’m willing to work on that.
would like to start with the “common type for regions I/O”, and vectorization… Your pybind changes don’t touch the individual files in src/nupic/algorithms/ , do they?
do we know of more people interested in this change who would be willing to contribute? As I can prepare/refactor the stuff above, but I don’t have much actuall exp with the graphics/math libraries. So learning without guidance would take me longer…
I also have some private code for running the Hotgym in c++, so I’ll clean it up and we can set up pure c++ benchmarks (imho easier and more fool proof game).
That’s sth I’d like to understand in the PR, do you remove the Regions and NAPI “framework”/functionality? Sorry to being dense on your changeset, I just need to understand the direction.
Cool, so other tasks can go in parallel with the Py3 work!
To be exact I have not removed “Regions”. The only region I have reimplemented is PyRegion using pybind11 functionality. I have named that class PyBindRegion…
What I have further done is remove nupic’s py_support folder.
Right now the engine is an integral part of nupic.core and supports the inclusion of python regions, like “anomaly_region.py” for instance. For that I need to use embedded python via pybind11.
Until we refactor the “engine” we’ll have to build nupic.core with pybind11 and therefore python c api headers.
I think I know how make topology in the spatial pooler run a lot faster. I call it poor mans topology, use many small spatial poolers arranged over a topological area, and each spatial pooler has global inhibition. It’s not a perfect solution but it should run as fast as the no-topology case.
I have experimented with this method with my own HTM implementation with success on the MNIST dataset. I use a (10 x 10) grid of spatial poolers, each with 100 mini-columns, and an input radius of about 2.8 pixels for a total of 106 potential synapses to each mini-column. It takes 4 minutes to run through the MNIST dataset and it scores ~95%.
Any thoughts? Is this something you’d all want in the community fork?
nupic.cpp brought a lot of performance optimizations, partly due to cleaned up code, and mainly thanks to Connections optimization https://github.com/htm-community/nupic.cpp/milestone/9 by @dmac !
Another great feature is that Spatial pooler (SP) is now using the optimized Connections structure (moved from SparseMatrix) which is shared with Temporal memory, a highly optimized code.
SP is no longer a bottleneck in HTM pipeline, and further optimizations are planned as stated above (esp to SP’s local inhibition)