Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
set actValueList to None when classification is None
Browse files Browse the repository at this point in the history
  • Loading branch information
ywcui1990 committed Jun 6, 2017
1 parent e23eda7 commit 66b4941
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nupic/algorithms/sdr_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ def compute(self, recordNum, patternNZ, classification, learn, infer):
else:
if learn:
raise ValueError("classification cannot be None when learn=True")
actValueList = [0]
bucketIdxList = [0]
actValueList = None
bucketIdxList = None
# ------------------------------------------------------------------------
# Inference:
# For each active bit in the activationPattern, get the classification
Expand Down Expand Up @@ -341,7 +341,7 @@ def infer(self, patternNZ, actValueList):

# NOTE: If doing 0-step prediction, we shouldn't use any knowledge
# of the classification input during inference.
if self.steps[0] == 0:
if self.steps[0] == 0 or actValueList is None:
defaultValue = 0
else:
defaultValue = actValueList[0]
Expand Down

0 comments on commit 66b4941

Please sign in to comment.