code: def infer(self, objectToInfer, stats=None):
      
      self.setLearning(False)
      self.sendReset()
  
      touches = None
      previousLocation = [None] * self.numColumns
      displacement = [0., 0.]
      features = objectToInfer["features"]
      objName = objectToInfer["name"]
      numOfFeatures = len(features)
  
      # Randomize touch sequences
      touchSequence = np.random.permutation(numOfFeatures)
  
      for sensation in xrange(self.numOfSensations):
        # Add sensation for all columns at once
        for col in xrange(self.numColumns):
          # Shift the touch sequence for each column
          colSequence = np.roll(touchSequence, col)
          feature = features[colSequence[sensation]]
          # Move the sensor to the center of the object
          locationOnObject = np.array([feature["top"] + feature["height"] / 2.,
                                       feature["left"] + feature["width"] / 2.])
          # Calculate displacement from previous location
          if previousLocation[col] is not None:
            displacement = locationOnObject - previousLocation[col]
          previousLocation[col] = locationOnObject
  
          # Sense feature at location
          self.motorInput[col].addDataToQueue(displacement)
          self.sensorInput[col].addDataToQueue(self.featureSDR[col][feature["name"]],
                                               False, 0)
        self.network.run(1)
        if self.debug:
          self._updateInferenceStats(statistics=stats, objectName=objName)
  
        if touches is None and self.isObjectClassified(objName, minOverlap=30):
          touches = sensation + 1
          if not self.debug:
            return touches
  
      return self.numOfSensations if touches is None else touches
docs: Attempt to recognize the specified object with the network. Randomly move
      the sensor over the object until the object is recognized.