-
Notifications
You must be signed in to change notification settings - Fork 279
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
Issue #1380: Add SP test checking results with no learning and 0 boos… #1381
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I take it back. Neither of that is needed, I can replicate the issue now and will post the test-case. Seems to be related to initial params (and initialization via constructor vs. |
||
EXPECT_EQ(out1, out2); | ||
} | ||
|
||
TEST(SpatialPoolerTest, testSaveLoad) | ||
{ | ||
const char* filename = "SpatialPoolerSerialization.tmp"; | ||
|
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'd suggest some explanatory comment here:
"This test verifies possible issue where SP with 0-boosting and learning disabled produces different (random) output, compared to the python SP. "
and add
bool learning = False;