def compute(self, inputs, outputs):
<EOL>self._computeFlag = True<EOL>patternNZ = inputs["<STR_LIT>"].nonzero()[<NUM_LIT:0>]<EOL>if self.learningMode:<EOL><INDENT>categories = [category for category in inputs["<STR_LIT>"]<EOL>if category >= <NUM_LIT:0>]<EOL>if len(categories) > <NUM_LIT:0>:<EOL><INDENT>bucketIdxList = []<EOL>actValueList = []<EOL>for category in categories:<EOL><INDENT>bucketIdxList.append(int(category))<EOL>if "<STR_LIT>" not in inputs:<EOL><INDENT>actValueList.append(int(category))<EOL><DEDENT>else:<EOL><INDENT>actValueList.append(float(inputs["<STR_LIT>"]))<EOL><DEDENT><DEDENT>classificationIn = {"<STR_LIT>": bucketIdxList,<EOL>"<STR_LIT>": actValueList}<EOL><DEDENT>else:<EOL><INDENT>if "<STR_LIT>" not in inputs:<EOL><INDENT>raise KeyError("<STR_LIT>")<EOL><DEDENT>if "<STR_LIT>" not in inputs:<EOL><INDENT>raise KeyError("<STR_LIT>")<EOL><DEDENT>classificationIn = {"<STR_LIT>": int(inputs["<STR_LIT>"]),<EOL>"<STR_LIT>": float(inputs["<STR_LIT>"])}<EOL><DEDENT><DEDENT>else:<EOL><INDENT>classificationIn = {"<STR_LIT>": <NUM_LIT:0>, "<STR_LIT>": <NUM_LIT:0>}<EOL><DEDENT>clResults = self._sdrClassifier.compute(recordNum=self.recordNum,<EOL>patternNZ=patternNZ,<EOL>classification=classificationIn,<EOL>learn=self.learningMode,<EOL>infer=self.inferenceMode)<EOL>if clResults is not None and len(clResults) > <NUM_LIT:0>:<EOL><INDENT>outputs['<STR_LIT>'][:len(clResults["<STR_LIT>"])] =clResults["<STR_LIT>"]<EOL>for step in self.stepsList:<EOL><INDENT>stepIndex = self.stepsList.index(step)<EOL>categoryOut = clResults["<STR_LIT>"][clResults[step].argmax()]<EOL>outputs['<STR_LIT>'][stepIndex] = categoryOut<EOL>stepProbabilities = clResults[step]<EOL>for categoryIndex in xrange(self.maxCategoryCount):<EOL><INDENT>flatIndex = categoryIndex + stepIndex * self.maxCategoryCount<EOL>if categoryIndex < len(stepProbabilities):<EOL><INDENT>outputs['<STR_LIT>'][flatIndex] =stepProbabilities[categoryIndex]<EOL><DEDENT>else:<EOL><INDENT>outputs['<STR_LIT>'][flatIndex] = <NUM_LIT:0.0><EOL><DEDENT><DEDENT><DEDENT><DEDENT>self.recordNum += <NUM_LIT:1><EOL>
Process one input sample.
This method is called by the runtime engine.

:param inputs: (dict) mapping region input names to numpy.array values
:param outputs: (dict) mapping region output names to numpy.arrays that 
       should be populated with output values by this method