This commit is contained in:
Glenn Jocher 2018-11-23 18:13:35 +01:00
parent 7b13af707d
commit 82124805f8
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ class YOLOLayer(nn.Module):
# lconf += k * BCEWithLogitsLoss(pred_conf[~mask], mask[~mask].float()) # lconf += k * BCEWithLogitsLoss(pred_conf[~mask], mask[~mask].float())
# Sum loss components # Sum loss components
balance_losses_flag = True balance_losses_flag = False
if balance_losses_flag: if balance_losses_flag:
k = 1 / self.loss_means.clone() k = 1 / self.loss_means.clone()
loss = (lx * k[0] + ly * k[1] + lw * k[2] + lh * k[3] + lconf * k[4] + lcls * k[5]) / k.mean() loss = (lx * k[0] + ly * k[1] + lw * k[2] + lh * k[3] + lconf * k[4] + lcls * k[5]) / k.mean()