This commit is contained in:
Glenn Jocher 2018-11-17 00:32:28 +01:00
parent 0bc111f0b4
commit 07f15b68d3
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ class YOLOLayer(nn.Module):
# lconf = k * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float()) # lconf = k * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float())
lconf = (k * 5) * BCEWithLogitsLoss(pred_conf, mask.float()) lconf = (k * 5) * BCEWithLogitsLoss(pred_conf, mask.float())
lcls = (k / 5) * CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1)) lcls = (k / 20) * CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1))
# lcls = k * BCEWithLogitsLoss(pred_cls[mask], tcls.float()) # lcls = k * BCEWithLogitsLoss(pred_cls[mask], tcls.float())
else: else:
lx, ly, lw, lh, lcls, lconf = FT([0]), FT([0]), FT([0]), FT([0]), FT([0]), FT([0]) lx, ly, lw, lh, lcls, lconf = FT([0]), FT([0]), FT([0]), FT([0]), FT([0]), FT([0])