Esempio n. 1
0
    def error(self):
        class_n = self.label.shape[1]
        FPR_list = []
        TPR_list = []
        PPV_list = []
        for i in range(class_n):

            true = self.label[:, i]
            prob = self.prediction[1][:, i]
            FPR, TPR, PPV = ac(true, prob, 0.5)
            FPR_list.append(FPR)
            TPR_list.append(TPR)
            PPV_list.append(PPV)

        return FPR_list, TPR_list, PPV_list
Esempio n. 2
0
    def error(self, label, prediction):
        with tf.device('/device:GPU:' + self.GPUID):
            class_n = label.shape[1]
            FPR_list = []
            TPR_list = []
            PPV_list = []
            for i in range(class_n):

                true = label[:, i]
                prob = prediction[1][:, i]
                FPR, TPR, PPV = ac(true, prob, 0.5)
                FPR_list.append(FPR)
                TPR_list.append(TPR)
                PPV_list.append(PPV)

            return FPR_list, TPR_list, PPV_list
Esempio n. 3
0
    def error(self):
        with tf.device('/device:GPU:' + self.GPUID):
            class_n = self.label.shape[1]
            FPR_list = []
            TPR_list = []
            PPV_list = []
            for i in range(class_n):

                true = self.label[:, i]
                prob = self.prediction[1][:, i]

                FPR, TPR, PPV = ac(true, prob, 0.5000)
                #FPR, _ = tf.metrics.false_positives_at_thresholds(true, prob, [0.5000])
                #TPR, _ = tf.metrics.true_negatives_at_thresholds(true, prob, [0.5000])
                #PPV, _ = tf.metrics.precision_at_thresholds(true, prob, [0.5000])

                FPR_list.append(FPR)
                TPR_list.append(TPR)
                PPV_list.append(PPV)

            return FPR_list, TPR_list, PPV_list