Beispiel #1
0
 def on_epoch_end(self, epoch, logs={}):
     """
     Compute absolute and compatible precision for test data
     """
     if len(self.test_data) > 0:
         precision, usage_weights = utils.verify_model(self.model, self.test_data, self.test_labels, self.reverse_data_dictionary, self.next_compatible_tools, self.pred_usage_scores)
         self.precision.append(precision)
         self.usage_weights.append(usage_weights)
         print("Epoch %d precision: %s" % (epoch + 1, precision))
         print("Epoch %d usage weights: %s" % (epoch + 1, usage_weights))
 def on_epoch_end(self, epoch, logs={}):
     """
     Compute absolute and compatible precision for test data
     """
     mean_precision = utils.verify_model(self.model, self.test_data,
                                         self.test_labels,
                                         self.reverse_data_dictionary)
     self.abs_precision.append(mean_precision)
     print("Epoch %d topk absolute precision: %.2f" %
           (epoch + 1, mean_precision))
 def on_epoch_end(self, epoch, logs={}):
     """
     Compute absolute and compatible precision for test data
     """
     mean_abs_precision, mean_compatible_precision, mean_predicted_usage_score = utils.verify_model(
         self.model, self.test_data, self.test_labels,
         self.reverse_data_dictionary, self.next_compatible_tools,
         self.pred_usage_scores)
     self.abs_precision.append(mean_abs_precision)
     self.abs_compatible_precision.append(mean_compatible_precision)
     self.usage_prediction_scores.append(mean_predicted_usage_score)
     print("Epoch %d topk absolute precision: %.4f" %
           (epoch + 1, mean_abs_precision))
     print("Epoch %d topk compatible precision: %.4f" %
           (epoch + 1, mean_compatible_precision))
     print("Epoch %d mean usage scores for correct predictions: %.4f" %
           (epoch + 1, mean_predicted_usage_score))
Beispiel #4
0
 def on_epoch_end(self, epoch, logs={}):
     """
     Compute absolute and compatible precision for test data
     """
     if len(self.test_data) > 0:
         usage_weights, precision, precision_pub, low_pub_prec, low_norm_prec, low_num = utils.verify_model(
             self.model, self.test_data, self.test_labels,
             self.reverse_data_dictionary, self.pred_usage_scores,
             self.standard_connections, self.lowest_tool_ids)
         self.precision.append(precision)
         self.usage_weights.append(usage_weights)
         self.published_precision.append(precision_pub)
         self.lowest_pub_precision.append(low_pub_prec)
         self.lowest_norm_precision.append(low_norm_prec)
         print("Epoch %d usage weights: %s" % (epoch + 1, usage_weights))
         print("Epoch %d normal precision: %s" % (epoch + 1, precision))
         print("Epoch %d published precision: %s" %
               (epoch + 1, precision_pub))
         print("Epoch %d lowest published precision: %s" %
               (epoch + 1, low_pub_prec))
         print("Epoch %d lowest normal precision: %s" %
               (epoch + 1, low_norm_prec))
         print("Epoch %d number of test samples with lowest tool ids: %s" %
               (epoch + 1, low_num))