-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SP Cleanup: Use only sp.avgConnectedSpanForColumnND #119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 1D/2D were supposted to be optimizations originally. Please verify the speed with 1D, you can use ConnectionsPerformanceTest.*SP() - and adapt the code to use 1D variant. Confirm the speed of nD is not much worse than 1D
return (rowSpan + colSpan) / 2.0f; | ||
} | ||
|
||
|
||
Real SpatialPooler::avgConnectedSpanForColumnND_(UInt column) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's interesting that the current SP does not use the 1D/2D, but only nD already?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm evaluation the performance impact of ND vs 1D, where algorithmically the 1D is really simpler.
- Global Inh
[ RUN ] HelloSPTPTest.performance
starting test. DIM_INPUT=10000, DIM=2048, CELLS=10
EPOCHS = 1000
starting: 1000 iterations.Total elapsed time = 0 seconds
[ OK ] HelloSPTPTest.performance (1027 ms)
[----------] 1 test from HelloSPTPTest (1027 ms total)
- Local, 1D (to be removed):
[ RUN ] HelloSPTPTest.performance
starting test. DIM_INPUT=10000, DIM=2048, CELLS=10
EPOCHS = 1000
starting: 1000 iterations.Total elapsed time = 74 seconds
/home/mmm/devel/HTM/htm-community/nupic.cpp/src/test/unit/algorithms/HelloSPTPTest.cpp:101: Failure
Value of: timeTotal <= CI_avg_time
Actual: false
Expected: true
HelloSPTP test slower than expected! (74,should be 45
[ FAILED ] HelloSPTPTest.performance (74195 ms)
[----------] 1 test from HelloSPTPTest (74195 ms total)
- local, ND (proposed default, resp. only choice):
[ RUN ] HelloSPTPTest.performance
starting test. DIM_INPUT=10000, DIM=2048, CELLS=10
EPOCHS = 1000
starting: 1000 iterations.Total elapsed time = 75 seconds
/home/mmm/devel/HTM/htm-community/nupic.cpp/src/test/unit/algorithms/HelloSPTPTest.cpp:101: Failure
Value of: timeTotal <= CI_avg_time
Actual: false
Expected: true
HelloSPTP test slower than expected! (75,should be 45
[ FAILED ] HelloSPTPTest.performance (75335 ms)
[----------] 1 test from HelloSPTPTest (75335 ms total)
TL;DR
- local inhibition is very slow! 70x (1s vs 74s global/local inhibition)
- this PR (1D/ND) does not change that (-> 🆗 merge)
- we should work on improving speed of local inh (Integrate CUDA SP as a C++ wrapper #50 )
- there are no unit tests for local inhibition!
Removed code for 1D & 2D coordinate conversion and avgConnectedSpan. Use the more general purpose N-dimsensional code instead.