This commit is contained in:
Glenn Jocher 2018-11-09 17:18:37 +01:00
parent 4bae1d0f75
commit 98484bbe2f
1 changed files with 2 additions and 2 deletions

View File

@ -172,8 +172,8 @@ class YOLOLayer(nn.Module):
# lconf = k * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float()) # lconf = k * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float())
lconf = k * BCEWithLogitsLoss(pred_conf, mask.float()) lconf = k * BCEWithLogitsLoss(pred_conf, mask.float())
lcls = k * CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1)) # lcls = (k / 10) * 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])