nupic

What is the purpose of the _classifierInput encoder field in the model parameters?


If you take a look at default model parameters as created by Cerebro, you see the following encoders:

{
  'encoders': {
    '_classifierInput': {
      'classifierOnly': True,
      'clipInput': True,
      'fieldname': u'f',
      'n': 100,
      'name': '_classifierInput',
      'type': 'AdaptiveScalarEncoder',
      'w': 21
    },
    u'f': {
      'clipInput': True,
      'fieldname': u'f',
      'n': 100,
      'name': u'f',
      'type': 'AdaptiveScalarEncoder',
      'w': 21
    }
  }
}

What is the purpose of the _classifierInput encoder field? It looks like it just mirrors the encoder field that comes after it.


Solution

  • This is in clamodel.py:

    def _getClassifierOnlyEncoder(self):
      """
      Returns:  sensor region's encoder that is sent only to the classifier,
                not to the bottom of the network
      """
      return  self._getSensorRegion().getSelf().disabledEncoder
    

    If you want the CLA to learn to predict (or "compute") a value, but not to use the value as input data, I think this is how you do it. For instance, you might have training data which includes the "answer" but this will be missing later (this is how a lot of the ML competitions work).