Exemple #1
0
 def evaluate(self, x, y, verbose=2):
     metrics_value = self.model.evaluate(x=x, y=y, verbose=verbose)
     metrics_names = self.model.metrics_names
     if isiterable(metrics_value):
         return list(zip(metrics_names, metrics_value))
     else:
         return metrics_names[0], metrics_value
Exemple #2
0
 def evaluate(self, x, y, n_cls, verbose=2):
     in_1, in_2, out = self._get_batch(x, y, n_cls, 128 * 100)
     metrics_value = self.model.evaluate([in_1, in_2], out, verbose=verbose)
     metrics_names = self.model.metrics_names
     if isiterable(metrics_value):
         return list(zip(metrics_names, metrics_value))
     else:
         return metrics_names[0], metrics_value
Exemple #3
0
 def _print_evaluate(self, data, scalar_values):
     metrics_names = self.model.metrics_names
     if isiterable(scalar_values):
         for item in zip(metrics_names, scalar_values):
             print(data + ': ' + '\t'.join((item[0], str(item[1]))))
     else:
         print(data + ': ' +
               '\t'.join((metrics_names[0], str(scalar_values))))
Exemple #4
0
 def evaluate(self, x, y, n_cls):
     anchor, positive, negetive = self._get_batch(
         x, y, n_cls, 128*100)
     metrics_value = self.model.evaluate([anchor, positive, negetive],
                                         anchor)
     metrics_names = self.model.metrics_names
     if isiterable(metrics_value):
         return list(zip(metrics_names, metrics_value))
     else:
         return metrics_names[0], metrics_value