Skip to content

Commit

Permalink
Issue numenta#1380: Add SP test checking results with no learning and…
Browse files Browse the repository at this point in the history
… 0 boosting
  • Loading branch information
lscheinkman committed Jan 10, 2018
1 parent d608108 commit eba72d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/unit/algorithms/SpatialPoolerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,23 @@ namespace {
EXPECT_EQ(0, countNonzero(activeColumns));
}


TEST(SpatialPoolerTest, testSameOutputForSameInputNoLearningNoBoosting)
{
const UInt inputSize = 10;
const UInt nColumns = 20;
SpatialPooler sp;
sp.initialize({inputSize}, {nColumns});
sp.setBoostStrength(0);

vector<UInt> input = { 1, 1, 0, 0, 1, 1, 0, 0, 1, 1 };
vector<UInt> out1(nColumns, 0);
vector<UInt> out2(nColumns, 0);
sp.compute(input.data(), false, out1.data());
sp.compute(input.data(), false, out2.data());
EXPECT_EQ(out1, out2);
}

TEST(SpatialPoolerTest, testSaveLoad)
{
const char* filename = "SpatialPoolerSerialization.tmp";
Expand Down

0 comments on commit eba72d0

Please sign in to comment.