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

fix missing actValue bug in SDR classifier #1348

Merged
merged 1 commit into from
Jun 13, 2017
Merged
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion src/nupic/bindings/algorithms.i
Original file line number Diff line number Diff line change
Expand Up @@ -1278,11 +1278,13 @@ void forceRetentionOfImageSensorLiteLibrary(void) {
if type(classification["actValue"]) in (int, float):
actValueList = [classification["actValue"]]
bucketIdxList = [classification["bucketIdx"]]
originalValueList = [classification["actValue"]]
category = False
elif classification["actValue"] is None:
# Use the sentinel value so we know if it gets used in actualValues
# returned.
actValueList = [noneSentinel]
originalValueList = [noneSentinel]
# Turn learning off this step.
learn = False
category = False
Expand All @@ -1292,9 +1294,11 @@ void forceRetentionOfImageSensorLiteLibrary(void) {
elif type(classification["actValue"]) is list:
actValueList = classification["actValue"]
bucketIdxList = classification["bucketIdx"]
originalValueList = classification["actValue"]
category = False
else:
actValueList = [int(classification["bucketIdx"])]
originalValueList = [classification["actValue"]]
bucketIdxList = [classification["bucketIdx"]]
category = True

Expand All @@ -1316,7 +1320,8 @@ void forceRetentionOfImageSensorLiteLibrary(void) {
arrayResult["actualValues"][i] = self.valueToCategory.get(int(
arrayResult["actualValues"][i]), classification["actValue"])

self.valueToCategory[actValue] = classification["actValue"]
for i in range(len(actValueList)):
self.valueToCategory[actValueList[i]] = originalValueList[i]

return arrayResult

Expand Down