提交 1a8590a9 编写于 作者: C cuicheng01 提交者: cuicheng01

fix TprAtFpr metrics

上级 f8a4485a
......@@ -204,8 +204,10 @@ class TprAtFpr(nn.Layer):
gt_pos_score_list > threshold) / len(gt_pos_score_list)
if len(gt_neg_score_list) == 0 and tpr > max_tpr:
max_tpr = tpr
result = "threshold: {}, fpr: {}, tpr: {:.5f}".format(
threshold, fpr, tpr)
result = "threshold: {}, fpr: 0.0, tpr: {:.5f}".format(
threshold, tpr)
msg = f"The number of negative samples is 0, please add negative samples."
logger.warning(msg)
fpr = np.sum(
gt_neg_score_list > threshold) / len(gt_neg_score_list)
if fpr <= self.max_fpr and tpr > max_tpr:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册