Skip to content

Commit

Permalink
SP: enable segment pruning for Conn.adaptSegment
Browse files Browse the repository at this point in the history
by setting segmentThreshold param. This should be ON, but there
are some issues with platform independent reproducible results
  • Loading branch information
breznak committed Jun 3, 2020
1 parent b91144d commit 3e4ae13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/htm/algorithms/SpatialPooler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ Real SpatialPooler::avgConnectedSpanForColumnND_(const UInt column) const {
void SpatialPooler::adaptSynapses_(const SDR &input,
const SDR &active) {
for(const auto &column : active.getSparse()) {
connections_.adaptSegment(column, input, synPermActiveInc_, synPermInactiveDec_, true, 0); //! stimulusThreshold_); //FIXME segment pruning not platform-independent!
connections_.adaptSegment(column, input, synPermActiveInc_, synPermInactiveDec_, true, stimulusThreshold_);
connections_.raisePermanencesToThreshold( column, stimulusThreshold_ );
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/algorithms/SpatialPoolerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2056,15 +2056,15 @@ TEST(SpatialPoolerTest, ExactOutput) {
// Silver is an SDR that is loaded by direct initalization from a vector.
SDR silver_sdr({ 200 });
SDR_sparse_t data = {
4, 64, 74, 78, 85, 113, 125, 126, 127, 153
11, 17, 31, 63, 78, 125, 126, 153, 173, 193
};
silver_sdr.setSparse(data);


// Gold tests initalizing an SDR from a manually created string in JSON format.
// hint: you can generate this string using
// silver_sdr.save(std::cout, JSON);
string gold = "{\"dimensions\": [200],\"sparse\": [4, 64, 74, 78, 85, 113, 125, 126, 127, 153]}";
string gold = "{\"dimensions\": [200],\"sparse\": [11, 17, 31, 63, 78, 125, 126, 153, 173, 193]}";
std::stringstream gold_stream( gold );
SDR gold_sdr;
gold_sdr.load( gold_stream, JSON );
Expand Down

0 comments on commit 3e4ae13

Please sign in to comment.