Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP local inhibition optimization #783

Merged
merged 50 commits into from
Sep 8, 2020
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b9f8746
Merge pull request #1 from htm-community/master
Feb 20, 2020
95b8dfe
Naive implementations of optimizations suggested by breznak
invalid-email-address Feb 20, 2020
8d580a7
Fix a couple of mistakes.
invalid-email-address Feb 20, 2020
22a720f
Even more performance improvements.
invalid-email-address Feb 22, 2020
7078451
Merge remote-tracking branch 'pr/master' into pr_sp_enh2
breznak Feb 22, 2020
44314b6
Merge branch 'master_community' into pr_sp_enh2
breznak Mar 17, 2020
f5ba4e5
SP: cleanup, UInt calculateWrapAroundNeighbors_()
breznak Mar 17, 2020
00ae915
Merge branch 'master_community' into sp_inh_local_speedup
breznak Mar 17, 2020
f873068
SP cached wrapping neighborhood: use map for cache
breznak Mar 17, 2020
65fb984
SP cached hood: drop wrapAroundNeighbors_
breznak Mar 18, 2020
f594356
SP cached hood: for both wrap, non-wrap hoods
breznak Mar 18, 2020
b5bf1e6
SP inhibitColumns() returns active array
breznak Mar 18, 2020
1d3e86f
final memory management touches
breznak Mar 18, 2020
5514529
Neighborhood: make params const
breznak Mar 18, 2020
17d5839
Neighborhood: merged wrapping and non-wrap classes
breznak Mar 18, 2020
5fb1c3a
SP merge updateBoostFactorsLocal wrap, non-wrap code
breznak Mar 18, 2020
9ac17c2
SP: more use of cached hood
breznak Mar 18, 2020
9bb11d9
move TopologyTest to correct location
breznak Mar 18, 2020
a0985e3
Neighborhood: warn that non-wrapping is slow
breznak Mar 18, 2020
87446ba
Neighborhood: add option to skipCenter
breznak Mar 18, 2020
ce76ba3
SP formatting
breznak Mar 18, 2020
aecbaac
Merge branch 'master_community' into sp_inh_local_speedup
breznak Mar 18, 2020
283c3e6
Test SP: fix typo in comparison
breznak Mar 19, 2020
d780143
SP: updateMinDutyCyclesLocal avoid unnecessary
breznak Mar 19, 2020
8e70e23
SP cache: sort neighbors for better mem locality
breznak Mar 19, 2020
45dccb5
fix for d780143
breznak Mar 19, 2020
23f94f2
SP updateBoostFactorsLocal for both wrap, non-wrap optimized
breznak Mar 19, 2020
4fe6d0b
SP inhibit Local rename variables to better descriptive
breznak Mar 19, 2020
bdb3494
SP local inh: merged wrap, non-wrap code together
breznak Mar 19, 2020
57c67c8
WIP
breznak Apr 10, 2020
2a26e92
Merge branch 'master_community' into sp_inh_local_speedup
breznak Jun 4, 2020
51fa4b8
another brakets fix
breznak Jun 4, 2020
d921e7d
fixes after merge conflicts, for py bindings
breznak Jun 4, 2020
690014d
SP work on hood with centerIncluded logic
breznak Jun 4, 2020
93fb3a7
TopologyTest: add case for wrap=true
breznak Jun 4, 2020
3a1dd5a
SP small change
breznak Jun 4, 2020
4d5b2a1
SP rewrite mapAllMembers() as non-class method
breznak Jun 4, 2020
191e406
SP move mapAllNeighbors to Topology
breznak Jun 4, 2020
34e24ea
Merge branch 'master_community' into sp_inh_local_speedup
breznak Sep 3, 2020
5fe4eca
fix serialization for SP.neighborMap
breznak Sep 3, 2020
17168e6
WIP debugging SP boost tests
breznak Sep 6, 2020
4e7d080
fixed data for failing SP test, float rounding
breznak Sep 7, 2020
fff728a
SP simplify neighborMap code
breznak Sep 7, 2020
6fbe094
fix assert
breznak Sep 7, 2020
a58acb3
Topology:updateAllNeighbors() fix radius type to UInt
breznak Sep 7, 2020
628a4f9
FIXME try disabling RESTapiTest.example segfault in Debug
breznak Sep 7, 2020
84c03b4
another try disabling segfaulting RESTapiTest.example
breznak Sep 7, 2020
5beb518
type conversion on Windows
breznak Sep 7, 2020
f1c9ca2
fix include for iota() on Windows
breznak Sep 7, 2020
4f594ac
run RESTapiTest.example only in Release
breznak Sep 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix a couple of mistakes.
  • Loading branch information
root committed Feb 20, 2020
commit 8d580a7ba42c7fe6dd07e0bcd7548af9f0d017f0
7 changes: 7 additions & 0 deletions src/htm/algorithms/SpatialPooler.cpp
Original file line number Diff line number Diff line change
@@ -151,7 +151,11 @@ void SpatialPooler::setStimulusThreshold(UInt stimulusThreshold) {
UInt SpatialPooler::getInhibitionRadius() const { return inhibitionRadius_; }

void SpatialPooler::setInhibitionRadius(UInt inhibitionRadius) {
if (inhibitionRadius_ != inhibitionRadius) {
inhibitionRadius_ = inhibitionRadius;
calculateWrapAroundNeighbors();
mapAllNeighbors();
}
}

UInt SpatialPooler::getDutyCyclePeriod() const { return dutyCyclePeriod_; }
@@ -807,7 +811,10 @@ void SpatialPooler::updateBoostFactorsLocal_() {
const UInt neighbor = neighborMap_[mapOffset + j];
// std::cout << "N: " << neighbor << " -- ";
localActivityDensity += activeDutyCycles_[neighbor];
// numNeighbors += 1;
// std::cout << "numneigh: " <<numNeighbors << " -- ";
}
numNeighbors++; // this function counts the column itself as a neighbor
} else {
for(auto neighbor: Neighborhood(i, inhibitionRadius_, columnDimensions_)) {
localActivityDensity += activeDutyCycles_[neighbor];