提交 891fa1c0 编写于 作者: C cuicheng01

fix AccuracyScore metric

上级 1020f418
...@@ -302,8 +302,5 @@ class AccuracyScore(MutiLabelMetric): ...@@ -302,8 +302,5 @@ class AccuracyScore(MutiLabelMetric):
fps = mcm[:, 0, 1] fps = mcm[:, 0, 1]
accuracy = (sum(tps) + sum(tns)) / ( accuracy = (sum(tps) + sum(tns)) / (
sum(tps) + sum(tns) + sum(fns) + sum(fps)) sum(tps) + sum(tns) + sum(fns) + sum(fps))
precision = sum(tps) / (sum(tps) + sum(fps))
recall = sum(tps) / (sum(tps) + sum(fns))
F1 = 2 * (accuracy * recall) / (accuracy + recall)
metric_dict["AccuracyScore"] = paddle.to_tensor(accuracy) metric_dict["AccuracyScore"] = paddle.to_tensor(accuracy)
return metric_dict return metric_dict
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册