updates
This commit is contained in:
parent
b9d87be318
commit
154fae4430
13
models.py
13
models.py
|
@ -254,11 +254,8 @@ class Darknet(nn.Module):
|
||||||
output.append(x)
|
output.append(x)
|
||||||
layer_outputs.append(x)
|
layer_outputs.append(x)
|
||||||
|
|
||||||
self.losses['nT'] /= 3
|
if is_training:
|
||||||
self.losses['TP'] = 0
|
if batch_report:
|
||||||
self.losses['FP'] = 0
|
|
||||||
self.losses['FN'] = 0
|
|
||||||
if is_training and batch_report:
|
|
||||||
self.losses['TC'] /= 3 # target category
|
self.losses['TC'] /= 3 # target category
|
||||||
metrics = torch.zeros(3, len(self.losses['FPe'])) # TP, FP, FN
|
metrics = torch.zeros(3, len(self.losses['FPe'])) # TP, FP, FN
|
||||||
|
|
||||||
|
@ -274,8 +271,14 @@ class Darknet(nn.Module):
|
||||||
self.losses['FP'] = metrics[1].sum()
|
self.losses['FP'] = metrics[1].sum()
|
||||||
self.losses['FN'] = metrics[2].sum()
|
self.losses['FN'] = metrics[2].sum()
|
||||||
self.losses['metrics'] = metrics
|
self.losses['metrics'] = metrics
|
||||||
|
else:
|
||||||
|
self.losses['TP'] = 0
|
||||||
|
self.losses['FP'] = 0
|
||||||
|
self.losses['FN'] = 0
|
||||||
|
|
||||||
|
self.losses['nT'] /= 3
|
||||||
self.losses['TC'] = 0
|
self.losses['TC'] = 0
|
||||||
|
|
||||||
return sum(output) if is_training else torch.cat(output, 1)
|
return sum(output) if is_training else torch.cat(output, 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue