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

Change default counting mode

parent d4dc0f55
No related branches found
No related tags found
1 merge request!1Update content
......@@ -41,7 +41,7 @@ class AverageMeter:
# These metrics only for numpy arrays
class Metric(AverageMeter):
__name__ = 'Metric'
def __init__(self, n_classes=2, mode='accum', reduction='binary'):
def __init__(self, n_classes=2, mode='separ', reduction='binary'):
super().__init__(None)
self._cm = AverageMeter(partial(metrics.confusion_matrix, labels=np.arange(n_classes)))
assert mode in ('accum', 'separ')
......@@ -94,7 +94,7 @@ class Recall(Metric):
class Accuracy(Metric):
__name__ = 'OA'
def __init__(self, n_classes=2, mode='accum'):
def __init__(self, n_classes=2, mode='separ'):
super().__init__(n_classes=n_classes, mode=mode, reduction='none')
def _compute(self, cm):
return np.nan_to_num(np.diag(cm).sum()/cm.sum())
......
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