在下述代码中与TP、FP和FN计算类似补全TN计算的代码:def eval_netnet dataset slicetotal batch_size=12 gpu=True Evaluation without the densecrf with the dice coefficient neteval start = timetime dice_ = torchzeros
补全TN计算的代码如下:
TN = torch.zeros(14).cuda()
for ak in range(14):
if ak == 0:
continue
TN[ak] = slicetotal - TP[ak] - FP[ak] - FN[ak]
将以上代码添加到原有代码中的合适位置即可。
原文地址: http://www.cveoy.top/t/topic/iTW0 著作权归作者所有。请勿转载和采集!