align loss to darknet

This commit is contained in:
Glenn Jocher 2018-09-24 20:32:05 +02:00
parent 750f528bfe
commit a75119b8f0
1 changed files with 2 additions and 2 deletions

View File

@ -159,8 +159,8 @@ class YOLOLayer(nn.Module):
# Mask outputs to ignore non-existing objects (but keep confidence predictions)
nT = sum([len(x) for x in targets]) # number of targets
nM = mask.sum().float() # number of anchors (assigned to targets)
nB = len(targets) # batch size
k = 1 / nB
# nB = len(targets) # batch size
k = 1
if nM > 0:
lx = k * MSELoss(x[mask], tx[mask])
ly = k * MSELoss(y[mask], ty[mask])