Example #1
0
  def __init__(self, model=None):
    super(SaL, self).__init__(model)
    if CONFIG.SAL.FC_LAYERS[-1][0] != 2:
      raise ValueError('Shuffle and Learn classifier has only 2 classes:'
                       'correct order or incorrect order. Ensure last layer in '
                       'config.sal.fc_layers is 2.')

    sal_classifier = Classifier(CONFIG.SAL.FC_LAYERS, CONFIG.SAL.DROPOUT_RATE)
    self.model['sal_classifier'] = sal_classifier
Example #2
0
  def __init__(self, model=None):
    super(Classification, self).__init__(model)
    if len(CONFIG.DATASETS) > 1:
      raise ValueError('Classification does not support multiple datasets yet.')

    self._num_classes = DATASET_TO_NUM_CLASSES[CONFIG.DATASETS[0]]
    fc_layers = [(self._num_classes, False)]
    classifier = Classifier(fc_layers, CONFIG.CLASSIFICATION.DROPOUT_RATE)
    self.model['classifier'] = classifier