Exemplo n.º 1
0
 def _real_predict(self, X, sess):
     standardizer = self.prediction_iterator.standardizer
     da_params = standardizer.da_processing_params()
     util.veryify_args(da_params, ['sigma'], 'QuasiPredictor.standardizer does unknown da with param(s):')
     color_sigma = da_params.get('sigma', 0.0)
     tfs, color_vecs = tta.build_quasirandom_transforms(self.number_of_transforms, color_sigma=color_sigma,
                                                        **self.cnf['aug_params'])
     multiple_predictions = []
     for i, (xform, color_vec) in enumerate(zip(tfs, color_vecs), start=1):
         print('Quasi-random tta iteration: %d' % i)
         standardizer.set_tta_args(color_vec=color_vec)
         predictions = self.predictor._real_predict(X, sess, xform=xform)
         multiple_predictions.append(predictions)
     return np.mean(multiple_predictions, axis=0)
Exemplo n.º 2
0
def _check_unused(unused, name):
    allowed_keys = ['is_training', 'reuse', 'outputs_collections', 'trainable']
    helper.veryify_args(unused, allowed_keys,
                        'Layer "%s" got unexpected argument(s):' % name)