Skip to content
Snippets Groups Projects
Commit 31e99e9f authored by Bobholamovic's avatar Bobholamovic
Browse files

Add comment in metrics.py

parent eb381382
No related branches found
No related tags found
1 merge request!1Update content
......@@ -66,9 +66,12 @@ class Metric(AverageMeter):
return self._compute(cm)[1]
def update(self, pred, true, n=1):
# Note that this is no thread-safe
self._cm.update(true.ravel(), pred.ravel())
if self.mode == 'accum':
# Note that accumulation mode is special in that metric.val saves historical information.
# Therefore, metric.avg IS USUALLY NOT THE "AVERAGE" VALUE YOU WANT!!!
# Instead, metric.val is the averaged result in the sense of metric.avg in separ mode,
# while metric.avg can be considered as some average of average.
cm = self._cm.sum
elif self.mode == 'separ':
cm = self._cm.val
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment